I'm trying to write a procedure that gathers data for all given files. I want the procedure to be used for multiple files. You should be able to give the procedure any number of files, say 25 to it and it goes and gathers all of the data for these files.
Scripts to gather data from the individual tables is pretty easy to write. One of them is below:
select * From Table_name a
Where a.FILE_ID in pi_fileid
and a.FILE_TYPE = 'L';
I also tried testing as shown below:
EXECUTE IMMEDIATE 'select count(*) from Table_name
where file_id in (' || pi_fileid || ')
AND file_type = ''L''
AND status = ''FP''' INTO cnt;
pi_fileid is the varchar with file names in it. They would be comma delimited.
My Procedure execute call looks like this:
DECLARE
PI_FILETYPE VARCHAR2(200);
PI_DATE DATE;
PI_FILEID VARCHAR2(200);
BEGIN
PI_FILETYPE := 'BLA_BLA';
PI_DATE := '30-dec-2009';
PI_FILEID := (''Z1100E71g'' ,''Y1100E71g'');
GATHER_PKG.GATHEREFILE ( PI_FILETYPE, PI_DATE, PI_FILEID );
COMMIT;
END;
But, from the looks of it, this does not gather anything from the database as the server appears to be thinking I'm looking for ''Z1100E71g.def'', instead of 'Z1100E71g.def'. So, this returns nothing.
Is there a way to do this?