on 11-27-2014 1:27 PM
Hi all
I have multiple CSV Files which i am importing into a Database Table through CTL load and after that i have to pass the Table to a procedure with different set of Records again and again. Please advice if there is any way to pass a database Table as a Parameter to a Stored Procedure.
Thanks in Advance.
Regards
Vignesh J
Yes it's possible to do that.
But please do your share of looking up the documentation.
Hint: "Developing Procedures" ,"Table types"
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lars
I went through the document but the problem is i have around 20 csv files to be loaded every day and each of them passed to 3 procedure as a parameter.
And These 20 csv Files have 3 Distinct Structure.
So if i create a table type i have to select the data from the Database Table and then store it in Temporary Table Type Variable and Then Pass it as Parameter Right.
I want to Pass the 20 Database Table Directly to the Procedure and Not Store in Table Types and Then pass it as Parameter.
Regards
Vignesh J
Hi Dzianis
I guess you miss understood my Question
I need to use Different Files For the Same Logic Again and Again with Different set of Records.
For Ex :
This is a Db Table : ABC
and of Table Type : TYPE
-- To Read the Data Stored in the From the File.---------------
CREATE PROCEDURE READ_DATA( OUT O1 TYPE)
LANGUAGE SQLSCRIPT
AS
BEGIN
O1 = SELECT * FROM ABC WHERE CUST_ID = 'ABC' ;
END;
--------------------------------------------------------------------------------------
--- Procedure that uses the Data-----------------------------------------
CREATE PROCEDURE LOGIC( IN ABC TYPE)
LANGUAGE SQLSCRIPT
AS
BEGIN
inp = SELECT * FROM :ABC WHERE CUST_ID = 'ABC' ;
insert into bmw (select * from :inp);
END;
------------------------------------------------------------------------------------------
Then in the Main Procedure :
CALL READ_DATA (ABC); ---This Call Will Fetch the Data from the Table into the Table Type Variable
ADM = SELECT * FROM :ABC;
Call LOGIC (ADM); --Then Pass the Variable to the Logic Procedure.
----
This is How Lars was Suggesting i just wanted to Known if there is any other way to implement the Logic.
Kindly Read the Use Case Properly Before Responding.
Regards
Vignesh J
You need an ETL tool here, e.g. SAP DataServices.
See, passing table-typed variables into a procedure is a very basic functionality.
What you now revealed as a requirement is a full blown data loading process.
There are tools for that and you better use them instead of spending time finding out how difficult and time consuming it is to build something reasonable yourself.
That's what I think.
BTW: if you want to notify Former Member you better use the @<user name> method than adding a tag to your question...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.