Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 10th, 2005, 04:31 PM
meadow meadow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 16 meadow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 19 sec
Reputation Power: 0
Question Stored Procedure, Fixed values for Output strings/variables?

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
;

Reply With Quote
  #2  
Old August 11th, 2005, 04:58 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 32 m 11 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old August 11th, 2005, 05:05 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
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

Reply With Quote
  #4  
Old August 11th, 2005, 05:05 AM
meadow meadow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 16 meadow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 19 sec
Reputation Power: 0
How sweet wasn't that =) works perfectly now! thank you very much!

Reply With Quote
  #5  
Old August 11th, 2005, 05:06 AM
meadow meadow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 16 meadow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 19 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Stored Procedure, Fixed values for Output strings/variables?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway