Solved

IB/Firebird Stored Procedures in ASP.

Posted on 2004-09-20
1
832 Views
Last Modified: 2013-12-09
I am using the IBPhoenix ODBC Driver.

I have a Simple Stored Procedure
CREATE PROCEDURE GET_GUID
RETURNS (
    SGUID CHAR (38))
AS
declare variable s CHAR(38);
BEGIN
S = '{';
s= '{' || GUID_CREATE() ||'}';

SGUID = S;

END

Which creates a GUID.

I am trying to access this from an ASP Site with no luck.
My Asp Code look like.

connect = "data source=wsi;user id=SYSDBA;password=masterkey"

Dim guid
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connect
Set sp = Server.CreateObject("ADODB.Command")
sp.ActiveConnection = Connect
sp.CommandType = adCmdStoredProc
sp.CommandText = "execute Procedure GET_GUID"
sp.Parameters.append sp.Createparameter(":SGUID", adChar,adParamOutput)
sp.Execute
guid = sp("SGUID")

I cannot seem to access the Returned Value. Please tell me what I am doing wrong.
0
Comment
Question by:andyd70
1 Comment
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 12111072
you need a 'SUSPEND' statement and then call it as if it were a table. I don't know asp
but you should be sending something like this to the database.

"select sguid into :var from get_guid"

and here is the revised proc

CREATE PROCEDURE GET_GUID
RETURNS (
    SGUID CHAR (38))
AS
declare variable s CHAR(38);
BEGIN
S = '{';
s= '{' || GUID_CREATE() ||'}';

SGUID = S;

SUSPEND;

END

I assume that GUID_CREATE is a udf that is working ok.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Often, when running a query with joins, the results show up "duplicates", and often, those duplicates can be "eliminated" in the results using DISTINCT, for example. Using DISTINCT is simple: just add it after the SELECT keyword, an…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now