Hi,
I am writing a DB2 SQL Stored Procedure.
This SP will recieve an Input Parameter in the form of a Big String from the Front End Java Application. The String would contain a set of Numbers (comma delimited Strings).
In the Stored Procedure I need to parse that data and do the required calculations by fetching data from some other files based on the Input Parameter.
I am unable to find a way as to how the parse the data in the Stored Procedure.
I had a look at the existing Stored Procedure Code.
Here it is:
set lineSelectionInsert =
'Insert into qtemp/OLINESEL (' || lineSelectionStrng || ' )';
Execute Immediate lineSelectionInsert;
where LineSelectionStrng is an Input Parameter to the SP & lineSelectionInsert is a work variable declared as Varchar(4000).
Can anyone explain me how the above code works??
I am also giving the structure of the File OLINESEL.
(What is CCSId 37??)
Would Appreciate if anyone could provide me with the Answers.
Thanks,
Chandra.
I am writing a DB2 SQL Stored Procedure.
This SP will recieve an Input Parameter in the form of a Big String from the Front End Java Application. The String would contain a set of Numbers (comma delimited Strings).
In the Stored Procedure I need to parse that data and do the required calculations by fetching data from some other files based on the Input Parameter.
I am unable to find a way as to how the parse the data in the Stored Procedure.
I had a look at the existing Stored Procedure Code.
Here it is:
set lineSelectionInsert =
'Insert into qtemp/OLINESEL (' || lineSelectionStrng || ' )';
Execute Immediate lineSelectionInsert;
where LineSelectionStrng is an Input Parameter to the SP & lineSelectionInsert is a work variable declared as Varchar(4000).
Can anyone explain me how the above code works??
I am also giving the structure of the File OLINESEL.
Code:
Create Table qtemp/OLINESEL ( brandID char(2) CCSID 37 ,zone char(4) CCSID 37 ,lineNumber char(9) CCSID 37 ,mlnModel char(6) CCSID 37 ,mlnEndDate date ,mlnECLFlag char(1) CCSID 37 ,mlnNewPrc decimal(15,0) ,mlnPERMInp decimal(15,0) ,mlnPOSInp decimal(15,0) ,mlnClStkU decimal(7,0) ,mlnPwNAMAD decimal(15,0) ,mlnPERMMdc decimal(15,0) ,mlnRqUpFLt decimal(9,2) ,mlnPrcAdj decimal(15,0) );
Would Appreciate if anyone could provide me with the Answers.
Thanks,
Chandra.
Comment