[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
[sqr-users] Insert duplicates
- Subject: [sqr-users] Insert duplicates
- From: "Kaithi, Murali" <Murali.Kaithi@spencergifts.com>
- Date: Fri, 15 Apr 2005 11:15:14 -0400
- Delivery-date: Fri, 15 Apr 2005 10:16:10 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- Thread-index: AcVBzeywCI2Va7YvQve9W/1+TfkMOA==
- Thread-topic: Insert duplicates
Hi,
I am trying to insert into a table from another table.
If I get across the duplicates, I would like to skip them and insert
rest of the rows.
I remember the below code worked before but is not now, I am confused.
Could someone help me.
My insert statement would start like
begin-sql ON-ERROR=SQL-Error1
And below is my SQL-Error1 procedure
begin-procedure SQL-Error1
show '#sql-status is ' #sql-status
evaluate #sql-status
#ifdef DB2
when = 6100 !DB2 error for empty-table result set
break
#end-if
#ifdef DB2UNIX
when = 6100 !DB2 error for empty-table result set
break
#end-if
when = -99999 !Token "when" clause for non-DB2 environments
when = -9 !unique constraint for Oracle Environments
when-other
display $sqr-program noline
display ': ' noline
display $ReportID noline
display ' - SQL Statement = '
display $SQL-STATEMENT
display 'SQL Status =' noline
display #sql-status 99999 noline
display ' ' noline
display 'SQL Error = ' noline
display $sql-error
display $Sql-Msg
SHOW $loadrecord
Do Rollback-Transaction
stop
end-evaluate
end-procedure SQL-Error1
Thanks,
Murali
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users