[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

IB/Firebird Stored Procedures in ASP.

Posted on 2004-09-20
1
Medium Priority
?
855 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

872 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