|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Haven't been using SQL so much, so I Would Like to know how i set a value for my output variables without feetching it from a table =) The Script shall return 1 or 0 depending if the email address already exists in the table or not.
This is my SQL Code, Returns no Errors but the Output values is blank. ALTER PROCEDURE AVAILABLEEMAIL ( IPEMAIL VARCHAR(255), ) RETURNS ( OPEMAIL INTEGER, ) AS BEGIN IF (NOT EXISTS(SELECT EMAIL FROM EMAIL_ADDRESSES WHERE EMAIL = :ipEMAIL)) THEN /* EXCEPTION EXC_EMAIL_NOTFOUND; */ OPEMAIL = 1; ELSE OPEMAIL = 0; END ; |
|
#2
|
|||
|
|||
|
Just add SUSPEND before final END.
-- Best regards, Fikret Hasovic http://fikret.fbtalk.net USAID TAMP Senior Programmer * Firebird Foundation member. - Join today at http://www.firebirdsql.org/ff/foundation * JEDI VCS contributor http://jedivcs.sourceforge.net/ * Firebird and Fyracle news http://www.fyracle.org |
|
#3
|
|||
|
|||
|
It depends on how you're using your Stored Procedure.
If you want to call it via SELECT, you need to have a "suspend" in there to signal the server that it should return the values to the caller and suspend the current procedure. If you want to call it via EXECUTE or a client side Stored Procedure component, it should work fine as is. With regards, Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL Server Upscene Productions http://www.upscene.com Database development questions? Check the forum! http://www.databasedevelopmentforum.com
__________________
Martijn Tonies Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
|
#4
|
|||
|
|||
|
How sweet wasn't that =) works perfectly now! thank you very much!
|
|
#5
|
|||
|
|||
|
I call it via a Webapplication (ASP) think this will do acctually, but thanks, if you got any information how i could catch the exception messages in ASP please let me know =) thanks again
|
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Stored Procedure, Fixed values for Output strings/variables? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|