Subject RE: [firebird-support] Newbie on SPs: HELP ON STORED PROCEDURE
Author Clay Shannon
Carol,

<< I am using IB Expert personal edition and when I try to compile de SP, an
error is reported
(parser error)
The cursor is placed after the number 1 in the first select statement..>>

I don't know if that's an IB Expert problem or what.

I use Database Workbench (an awesome product) and this:

SELECT 1 FROM rdb$database WHERE EXISTS
(SELECT 1 FROM CAREGIVERS WHERE ID = 0)

works fine for me in the script editor. In the above case, I get an empty
result set, because my lowest ID val in that table is 2. If I change the "="
to a "<>", I get a result of "1".

Clay Shannon,
Dimension 4 Software

-----Original Message-----
From: Carol Milius [mailto:lista@...]
Sent: Tuesday, February 01, 2005 2:32 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Newbie on SPs: HELP ON STORED PROCEDURE


hi Clay,

Thanks for the tip!

I am using IB Expert personal edition and when I try to compile de SP, an
error is reported
(parser error)
The cursor is placed after the number 1 in the first select statement..

thank again!

Carol.

>BTW, didn't you used to work with Bob what's...
No.




On Tue, 1 Feb 2005 13:40:22 -0600, "Clay Shannon" <cshannon@...>
escreveu:

> De: "Clay Shannon" <cshannon@...>
> Data: Tue, 1 Feb 2005 13:40:22 -0600
> Para: <firebird-support@yahoogroups.com>
> Assunto: RE: [firebird-support] Newbie on SPs: HELP ON STORED PROCEDURE
>
> <html><body><tt><< I am trying to make a SP to check if the record already
exists.>><BR><BR>Carol,<BR><BR>Try something like this:<BR><BR>SELECT 1 FROM
rdb$database WHERE EXISTS <BR>(SELECT 1 FROM <a table> WHERE
<conditions>)<BR><BR>If result = 1, the record exists; otherwise, it
doesn't.<BR><BR>BTW, didn't you used to work with Bob what's-his-face on
"Let's Make a<BR>Deal"?<BR><BR>Clay Shannon,<BR>Dimension 4
Software<BR>-----Original Message-----<BR>From: Carol Milius
[mailto:lista@...] <BR>Sent: Tuesday, February 01, 2005 12:58
PM<BR>To: firebird-support@yahoogroups.com<BR>Subject: [firebird-support]
Newbie on SPs: HELP ON STORED PROCEDURE<BR><BR><BR>Hi!<BR><BR>I am trying to
make a SP to check if the record already exists.<BR>The SP below is
something I am trying but it is not working..<BR>I am reading de IB manuals
but can not get an clear exemple..<BR>Any coments are welcome (links
too)<BR><BR>Best Regards,<BR><BR>Carol<BR><BR>Input: IN_FIELDNAME,
IN_TABLENAME, IN_FIELDVALUE<BR>Output: OUT_EXISTS<BR>Var:
VAR_FIELDVALUE<BR><BR>begin<BR> OUT_EXISTS = 'No';<BR><BR> For Execute
Statement<BR><BR> 'Select ' || IN_FIELDNAME ||<BR> ' From ' ||
IN_TABLENAME<BR> Into :VAR_FIELDVALUE<BR> Do<BR> if
(VAR_FIELDVALUE = IN_FIELDVALUE) Then<BR> OUT_EXISTS = 'Yes';<BR><BR>
suspend;<BR><BR>end<BR><BR><BR><BR><BR><BR><BR> <BR>Yahoo! Groups
Links<BR><BR><BR><BR> <BR><BR><BR><BR><BR></tt><!-- |**|begin egp html
banner|**| --><br><tt><hr width="500"><b>Yahoo! Groups
Links</b><br><ul><li>To visit your group on the web, go to:<br><a
href="http://groups.yahoo.com/group/firebird-support/">http://groups.yahoo.c
om/group/firebird-support/</a><br> <li>To unsubscribe from this group, send
an email to:<br><a
href="mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscrib
e">firebird-support-unsubscribe@yahoogroups.com</a><br> <li>Your use of
Yahoo! Groups is subject to the <a
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of
Service</a>.</ul></tt></br><!-- |**|end egp html banner|**|
--></body></html>



Yahoo! Groups Links