RE: Return error value from stored procedure
Paul Tugwell <Paul <at> guardbase.co.uk>
2005-07-08 15:57:21 GMT
Thanks for the reply. That's what I tried before sending the e-mail.
Unfortunately !$recordset seems to always to be false whether the stored
procedure has returned a result set or an error message, so the else
clause is always invoked.
-----Original Message-----
From: adodb-general-admin <at> lists.sourceforge.net
[mailto:adodb-general-admin <at> lists.sourceforge.net] On Behalf Of
operationsengineer1 <at> yahoo.com
Sent: 08 July 2005 15:32
To: adodb-general <at> lists.sourceforge.net
Subject: [ADodb-general] Return error value from stored procedure
are you looking for the error from your stored
procedure? if so, i'm not sure if the following will
work...
if{ (!$recordSet)
print $conn->ErrorMsg();
}else{
...
}
taken from the manual (w/ added if, else brackets)...
http://phplens.com/lens/adodb/docs-adodb.htm#ex1
--- adodb-general-request <at> lists.sourceforge.net wrote:
> Send ADodb-general mailing list submissions to
> adodb-general <at> lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web,
> visit
>
>
https://lists.sourceforge.net/lists/listinfo/adodb-general
> or, via email, send a message with subject or body
> 'help' to
> adodb-general-request <at> lists.sourceforge.net
>
> You can reach the person managing the list at
> adodb-general-admin <at> lists.sourceforge.net
>
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of ADodb-general digest..."
>
>
> Today's Topics:
>
> 1. Return error value from stored procedure (Paul
> Tugwell)
>
> --__--__--
>
> Message: 1
> Date: Thu, 7 Jul 2005 10:00:57 +0100
> From: "Paul Tugwell" <Paul <at> guardbase.co.uk>
> To: <adodb-general <at> lists.sourceforge.net>
> Subject: [ADodb-general] Return error value from
> stored procedure
>
> This is a multi-part message in MIME format.
>
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/plain;
> charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> I am new to ADOdb, so please excuse me if this is a
> stupid question
>
> =20
>
> I have a stored procedure that when send a string
> read from a barcode,
> decodes the string into several parts then checks
> whether a record
> exists in a Firebird 1.5 database related to this
> barcode. This can
> produce 3 possible results
>
> 1) The barcode has an invalid format e.g. it does
> not contain the
> expected information
>
> 2) The barcode has a valid format, but there is no
> related record in the
> database
>
> 3) The barcode has a valid format, and a related
> record exists in the
> database
>
> =20
>
> Scenarios 1 and 2 each return a different custom
> message generated by a
> Firebird exception
>
> Scenario 3 returns a result set
>
> =20
>
> I am using the following code in php
>
> =20
>
> sql =3D "SELECT BAR_TYPE, COIL, COIL_SX, MATERIAL,
> QTY, WEIGHT FROM
> READ_BARCODE('".$_POST["edtBarcode"]."')";
>
> $rs =3D $conn->Execute($sql);
>
> =20
>
> If a valid barcode is entered, I get the expected
> result
>
> =20
>
> If an invalid barcode is entered, how do I detect
> the error message
> returned?
>
> =20
>
>
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/html;
> charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> <html
> xmlns:o=3D"urn:schemas-microsoft-com:office:office"
> =
> xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
> xmlns=3D"http://www.w3.org/TR/REC-html40">
>
> <head>
> <meta http-equiv=3DContent-Type
> content=3D"text/html; =
> charset=3Dus-ascii">
> <meta name=3DGenerator content=3D"Microsoft Word 11
> (filtered medium)">
> <style>
> <!--
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {margin:0cm;
> margin-bottom:.0001pt;
> font-size:10.0pt;
> font-family:Arial;}
> h1
> {margin-top:0cm;
> margin-right:0cm;
> margin-bottom:12.0pt;
> margin-left:0cm;
> page-break-after:avoid;
> font-size:16.0pt;
> font-family:Arial;
> text-decoration:underline;}
> h2
> {margin:0cm;
> margin-bottom:.0001pt;
> page-break-after:avoid;
> font-size:10.0pt;
> font-family:Arial;
> text-decoration:underline;}
> h3
> {margin:0cm;
> margin-bottom:.0001pt;
> page-break-after:avoid;
> font-size:10.0pt;
> font-family:Arial;}
> a:link, span.MsoHyperlink
> {color:blue;
> text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> {color:purple;
> text-decoration:underline;}
> span.EmailStyle17
> {mso-style-type:personal-compose;
> font-family:Arial;
> color:windowtext;}
> <at> page Section1
> {size:595.3pt 841.9pt;
> margin:2.0cm 2.0cm 2.0cm 2.0cm;}
> div.Section1
> {page:Section1;}
> -->
> </style>
>
> </head>
>
> <body lang=3DEN-GB link=3Dblue vlink=3Dpurple>
>
> <div class=3DSection1>
>
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I am
> new to ADOdb, so please excuse me if this is a
> stupid =
> question<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
>
style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I
> have a stored procedure that when send a string read
> from a barcode, =
> decodes
> the string into several parts then checks whether a
> record exists in a =
> Firebird
> 1.5 database related to this barcode. This can
> produce 3 possible =
> results<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>1)
> The barcode has an invalid format e.g. it does not
> contain the expected
> information<o:p></o:p></span></font></p>
>
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar
happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by
HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar