|
I am trying to create a stored procedure in iNav that will read aSELECT 'I' , PRCSHT , 'A' ,
file on my i5 and update our price file.
This is something I have to do on a somewhat regular basis, and I
was trying to create a stored procedure to help me with it.
I usually receive new price sheets from sales, via a spreadsheet
which I upload to our i5, then run an SQL script to load the data
into the price master.
I'm getting stuck with trying to figure out how to create the Proc
and have it use a variable name for the input price sheet and
library.
Is there a way to do this?
Here's the SQL that was generated:
CREATE PROCEDURE CCSDTATEST.INS_DOPPRCM_LOAD_FILE (
IN PRCSHT CHAR(10) ,
IN BEGDTEYMD CHAR(6) ,
IN PRCSHTLIB CHAR(10) )
LANGUAGE SQL
<<SNIP>>
INSERT INTO CCSDTATEST . DOPPRCM
( KEY1SRC , KEY1 , KEY2SRC , DTELSTUPD , REVDTE , BEGDTE , ENDDTE ,
PRCACT , QTYACT , STDPKGFLG , PRCBY , SETPRC , METHOD , KEY2 , PRCOVR1 )
SELECT 'I' , ''' || PRCSHT || ''' , 'A' ,
( SELECT CURMDY FROM IQDATE . CURDATE ) ,
( SELECT CURMDY + 1 FROM IQDATE . CURDATE ) ,
BEGDTEYMD , '123149' ,
'P' , 'N' , 'N' , 'V' , 'N' , 'N' ,
ITEMID , PRICE FROM PRCSHTLIB . PRCSHT ;
COMMENT ON SPECIFIC PROCEDURE CCSDTATEST.INS_DOPPRCM_LOAD_FILE
IS 'Insert COPS Price Sheet data from Load File' ;
An example call and resulting error.
CALL CCSDTATEST.INS_DOPPRCM_LOAD_FILE('DCV1102','110217','PRICES11')
SQL State: 42704
Vendor Code: -204
Message: [SQL0204] PRCSHT in PRCSHTLIB type *FILE not found.<<SNIP>>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.