Microsoft
Software
Hardware
Network
Question : ORA error-too many values
When I debug, I see the problem was with the execute immediate statement. The table where cursor is selecting the data from is a temporary table available for that session.
PROCEDURE PROGRAMASSIGNMENT_CONV (P_CLIENTID IN NUMBER) IS
TYPE PROGRAMASSIGNMENT_TAB IS TABLE OF PROGRAMASSIGNMENT%ROWTYPE INDEX BY SIMPLE_INTEGER;
L_PROGRAMASSIGNMENT PROGRAMASSIGNMENT_TAB;
-- L_PROGRAMASSIGNMENTID PROGRAMASSIGNMENT.PROGRAMA
SSIGNMENTI
D%TYPE;
L_LIMIT PLS_INTEGER := 500000;
CURSOR CUR_PROGRAMASSIGNMENT IS
SELECT PROGRAMASSIGNMENTID_SEQ.NE
XTVAL,
A.CLIENTID,
A.VENDORID,
A.PID,
A.SUBPID,
A.PROGRAMID,
A.TRIAGEFILTERID,
A.CASEID,
A.CLIENTCASENO,
A.WORKFLOWSTATUS,
A.APPLICATIONID,
A.ISPRIMARYIND,
A.STATUSCHANGEREASONID,
A.INTERVENTIONLEVELID,
A.DMINTERVENTIONTYPEID,
A.PROGRAMRANK,
A.IDENTIFIEDDATE,
A.SELECTEDDATE,
A.OPENEDDATE,
A.CLOSEDDATE,
A.DECLINEDDATE,
A.INTAKEDATE,
A.INTAKESOURCEID,
A.REFERRALID,
A.INSERTEDBY,
sysdate,
A.RUNID
FROM CDRLOAD.GTEMP_BSC_PROGRAMA
SSIGNMENT A;
l_clientname VARCHAR2 (100);
BEGIN
-- populate cdrload.gtemp_bsc_programa
ssignment from sql server thru DBLINK
l_clientname := getclientname (p_clientid, 'CDR_PROGRAMASSIGNMENT_CON
V');
EXECUTE IMMEDIATE 'INSERT INTO cdrload.gtemp_bsc_programa
ssignment SELECT * FROM ' || l_clientname;
SELECT A.RUNID
INTO L_RUNID
FROM CDRLOAD.GTEMP_BSC_PROGRAMA
SSIGNMENT A
WHERE ROWNUM = 1;
OPEN CUR_PROGRAMASSIGNMENT;
LOOP
FETCH CUR_PROGRAMASSIGNMENT BULK COLLECT
INTO L_PROGRAMASSIGNMENT LIMIT L_LIMIT;
RUNIDTRACKING_PKG.STATUS_T
RACKING(P_
CLIENTID,
'conversion_pkg.CDR_PROGRA
MASSIGNMEN
T_CONV',
'Bulk collect count for INSERT',
L_PROGRAMASSIGNMENT.COUNT,
L_RUNID);
-- insert into programassignment table
FORALL I IN 1 .. L_PROGRAMASSIGNMENT.COUNT
INSERT INTO PROGRAMASSIGNMENT VALUES L_PROGRAMASSIGNMENT (I);
EXIT WHEN CUR_PROGRAMASSIGNMENT%NOTF
OUND;
END LOOP;
CLOSE CUR_PROGRAMASSIGNMENT;
EXCEPTION
WHEN OTHERS THEN
RUNIDTRACKING_PKG.STATUS_T
RACKING(P_
CLIENTID,
'conversion_pkg.CDR_PROGRA
MASSIGNMEN
T_CONV',
SQLERRM,
0,
L_RUNID);
END PROGRAMASSIGNMENT_CONV;
Answer : ORA error-too many values
You need to use your column names.
I don't know your table structures. You need to get the column names from gtemp_bsc_programassignmen
t and CDR_PROGRAMASSIGNMENT_CONV
and insert them explicitly into the insert statement:
INSERT INTO cdrload.gtemp_bsc_programa
ssignment(
----INSERT
YOUR COLUN NAMES HERE-----)
SELECT (----INSERT YOUR COLUN NAMES HERE-----) FROM IngersollRand.CDR_PROGRAMA
SSIGNMENT_
CONV@INGES
T;
Random Solutions
mysql stored proc parameter
OMA and OWA
"Invalid Argument provided." Error when Generating PDFs in VB.NET Application via Crystal Reports Viewer
ReportViewer break pages
How to view .stp or .wsp files in Microsoft Office sharepoint designer mode
Bind List<List<string>> to Grid
lastb: /var/log/btmp: File too large
sort varchar
laptop display problems
Extract icon from EXE/DLL