Solved

IB/Firebird Stored Procedures in ASP.

Posted on 2004-09-20
1
836 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
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…

749 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