General information
Title:
Creating Oracle Stored Procedures- Always Invalid
HI!
When I try to create some stored procedures on my Oracle DB they always come out as invalid.
I can't seem to figure out how to do them from VFP
My current method is something like:
lcsql=" CREATE OR REPLACE PROCEDURE UpdatePdmLog"+chr(13)
lcsql=lcsql+"(cUser in CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cDB IN CHAR DEFAULT NULL, "+chr(13)
lcsql=lcsql+" cType IN CHAR DEFAULT NULL, "+chr(13)
lcsql=lcsql+" cMainkey IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" coldLinekey IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cNewLineKey IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cData IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cStatus1 IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cStatus2 IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cAdmStatus IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cAdmStatu2 IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" cAdmCode IN CHAR DEFAULT NULL,"+chr(13)
lcsql=lcsql+" nRec IN NUMBER DEFAULT NULL) "+chr(13)
lcsql=lcsql+"IS"+chr(13)
lcsql=lcsql+"nlognum number;"+chr(13)
lcsql=lcsql+"cPDMNAME varchar2(50);"+chr(13)
lcsql=lcsql+"/*LOGNUM ,LUSER ,PDMNAME ,DATABASE,LTYPE,LDATE,LTIME ,MAINKEY */ "+chr(13)
lcsql=lcsql+"/*OLINEKEY,NLINEKEY ,LDATA,STATUS1,STATUS2 ,ADMSTATUS ,ADMSTATUS2,ADMCODE,RECNO*/"+chr(13)
lcsql=lcsql+"BEGIN"+chr(13)
lcsql=lcsql+"/*Get next LOGNUM and PDMname*/"+chr(13)
lcsql=lcsql+"SELECT NVL(MAX(LOGNUM)+1,1) INTO nlognum FROM "+thisform.dbuser+".PDMLOG ;"+chr(13)
lcsql=lcsql+"SELECT pdmname INTO cPDMNAME FROM "+thisform.dbuser+".PREFSALL;"+chr(13)
lcsql=lcsql+"INSERT /*+ append */ INTO "+thisform.dbuser+".PDMLOG (LOGNUM ,LUSER ,PDMNAME ,LTYPE,DATABASE,LDATE,LTIME ,MAINKEY , "+chr(13)
lcsql=lcsql+" OLINEKEY,NLINEKEY ,LDATA,STATUS1,STATUS2,ADMSTATUS,ADMSTATUS2,ADMCODE,RECNO)"+chr(13)
lcsql=lcsql+" VALUES (nLognum, cUSER, cPDMNAME, cType, cDB, SYSDATE, to_char(sysdate,'hh:mi:ss'), cMainkey, cOldLinekey, cNewLineKey, cData, cStatus1, cStatus2, cAdmStatus,cAdmStatu2,cAdmCode,pdmlogseq.nextval);"+chr(13)
lcsql=lcsql+'UPDATE '+thisform.dbuser+'.STYLES SET CHANGEDATE = SYSDATE(),'+chr(13)
lcsql=lcsql+" CHANGETIME=to_char(sysdate,'hh:mi:ss'),"+chr(13)
lcsql=lcsql+" CHANGEINIT=USER,"+chr(13)
lcsql=lcsql+" CHANGENUM=CHANGENUM+1 WHERE 'MAINKEY'=cMainkey;"+chr(13)
lcsql=lcsql+" COMMIT; "+chr(13)
lcsql=lcsql+"END;"+chr(13)
cfilename=SQLEXEC(gnconnectionhandle,lcSQL)
Has anyone been able to create stored procs without making them invalid???
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only