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

Re: [sqr-users] #sql-status and unique constraint



To reduce database hits and network traffic.  99% of the time, there
will NOT be a record out there.  But out of maybe 200,000 records, I
might have 5 or six repeats.  Using a query ahead of time, or a "where
not exists" subquiery in this particular case simply generates
unnecessary database traffic.

On Thu, 15 Jan 2004 16:26:27 -0500, you wrote:

>Why would you want to ignore such errors?
>
>It is straightforward to encapsulate your DDL in PL/SQL code that will
>insert OR update.
>
>>>> maillists@starbuckk.net 01/15/04 12:28PM >>>
>Has anyone encountered issues with testing #sql-status for unique
>constraint and not getting correct results?
>
>Oracle's return code for unique contstraint is -9. I've found that for
>some reason, #sql-status doesn't always contain this value.  It seems
>to be inconsistant, as I ran one program today that had repeated
>unique constraint errors and it worked for awhile, then suddenly
>failed (the program is supposed to ignore unique constraint errors and
>abort on an error other than unique constraint).
>
>I have found a more dependable alternative in using an instr for the
>value of "unique constraint" in $sql-error, but it is mystifying to me
>why the #sql-status seems to be unreliable.
>
>Any ideas?
>
>Note this is an SQR 4.x installation, on Oracle 8.
>


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