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

Re: handling errors



Thanks Karen! That worked great! Hey I just noticed you work at DoIT. Have
you been working with SQR long? I just started really getting into it the
last few months.

-----Original Message-----
From: Karen Gunderson [mailto:karen.gunderson@DOIT.WISC.EDU]
Sent: Wednesday, March 20, 2002 3:44 PM
To: SQR-USERS@list.iex.net
Subject: Re: handling errors


Maria,

You could handle this through code that you write in a module that you call
with the on-error command  (ex begin-SQL  on-error=SQL-error-INSERT.

In that module (SQL-error_INSERT, you could include some code like:

if $sql-error = 'ORA-00001: unique constraint (SYSADM.PS_whatever table)
violated'
  print out your error message.

Alternatively, you could do a SELECT before attempting the insert, and, if
the record was found, you could write an error message.

Karen.

Karen Gunderson
Project Manager
Division of Information Technology (DOIT)
University of Wisconsin-Madison
608/265-9370

-----Original Message-----
From: Discussion of SQR, Brio Software's database reporting language
[mailto:SQR-USERS@list.iex.net]On Behalf Of Brickl, Maria
Sent: Wednesday, March 20, 2002 3:23 PM
To: SQR-USERS@list.iex.net
Subject: handling errors


How does one handle errors such as the unique constraint error in SQR
programs. I know there will be a unique constraint on the following program
if I try loading values which are already in the table. What I would like to
get is a message saying that those values are already loaded rather than the
oracle errror you get. And then have it End the program and maybe write
duplicate values to a error report.

Where in your program do you put that? And what is the coding?

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Maria K Brickl
Information Systems Programmer/Analyst
University of Wisconsin Colleges
780 Regent St, PO Box 8680, Madison, WI  53708-8680
Phone: 608.265.2677 / Fax: 608.265.5770
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*