[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Insert Stmt.



Change your statement begin-SQL on-error=SQLError to begin-sql on-error=myerror

Create a procedure called myerror and set a flag to indicate that there is an 
error, and then after your end-sql before you do the other inserts test to see 
if the flag is set.  Don't forget to reset the flag, before your first insert.

Dwain Bartlett
SABHRS Services Bureau, ITSD
HR Systems Analyst
(406) 444-0418
dbartlett@mt.gov


-----Original Message-----
From: sqr-users-bounces+dbartlett=state.mt.us@sqrug.org
[mailto:sqr-users-bounces+dbartlett=state.mt.us@sqrug.org]On Behalf Of
radhika reddy
Sent: Monday, December 27, 2004 2:34 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] Insert Stmt.


Hi,

   I am trying to find solution for the following problem in SQR. Hope i get 
some ideas from you. I am working on Conversion program where i am inserting 
values into one table(using some validations). My requirement is if the 
insert is not successful then i should not insert values into 2nd and 3rd 
tables.

Example,First insert statement is:-

begin-procedure INSERT-table
begin-SQL on-error=SQLError
INSERT INTO PS_job(
EMPLID,
EMPL_RCD,
EFFDT,
EFFSEQ,
DEPTID,
JOBCODE)
values
($Emplid,
&A.EMPL_RCD,
&A.EFFDT,
&A.EFFSEQ,
'E',
''
)

end-SQL

END-PROCEDURE

if this insert is not successful then i should not insert values into 2nd 
and 3rd tables.

any ideas?

Thanks

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users