Solved

IB/Firebird Stored Procedures in ASP.

Posted on 2004-09-20
1
835 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

856 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