Well, I'm not certain about Oracle (although there should be something
similar), but with SQL Server, You can use the RETURN statement to return an
integer to CF; you can then do whatever conditional processing you want.
Here's some copy from the MS Transact-SQL Help.
-------------
RETURN
Exits unconditionally from a query or procedure. RETURN is immediate and
complete and can be used at any point to exit from a procedure, batch, or
statement block. Statements following RETURN are not executed.
Syntax
RETURN [integer_expression]
Arguments
integer_expression
Is the integer value returned. Stored procedures can return an integer value
to a calling procedure or an application.
Return Types
Optionally returns int.
Note Unless documented otherwise, all system stored procedures return a
value of 0, which indicates success; a nonzero value indicates failure.
Remarks
When used with a stored procedure, RETURN cannot return a null value. If a
procedure attempts to return a null value (for example, using RETURN @status
and @status is NULL), a warning message is generated and a value from 0
through -14 is returned.
The return status value can be included in subsequent Transact-SQL
statements in the batch or procedure that executed the current procedure,
but it must be entered in the following form:
EXECUTE @return_status = procedure_name
-------------------------------
-----Original Message-----
From: Francisco Montes; Spain on Line [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 27, 2000 1:51 AM
To: CF-Talk
Subject: Slightly OT: Raising exceptions from the database
This is a multi-part message in MIME format.
------=_NextPart_000_0017_01C02860.06C725E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
Does anybody know how can i raise a exception in SQL Server 7 with a =
custom message or error code that i can receive and process in CF with a =
CFCATCH tag?
I tried the RAISEERROR function but it doesn=B4t actually raise the =
error to an "exception" level... so CF can=B4t detect it as an exception =
than could be handled later...
And the bonus question: If we use Oracle instead of SQL Server 7... how =
can we do it?
Francisco Montes
Spain on Line
------=_NextPart_000_0017_01C02860.06C725E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>Hi all,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#000000 size=3D2>Does anybody know how can i raise a =
exception in=20
SQL Server 7 with a custom message or error code that i can receive and =
process=20
in CF with a CFCATCH tag?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>I tried the RAISEERROR function but it doesn´t =
actually=20
raise the error to an "exception" level... so CF can´t =
detect it=20
as an exception than could be handled later...</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>And the bonus question: If we use Oracle instead of =
SQL Server=20
7... how can we do it?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>Francisco Montes</FONT></DIV>
<DIV><FONT size=3D2>Spain on Line</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV></DIV></DIV></BODY></HTML>
------=_NextPart_000_0017_01C02860.06C725E0--
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.