473,587 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

output param & multiple recordests from stored procedures

here's my code:

my $sth = $dbhSQL->prepare('{ca ll proc(?,?,?)}');
$sth->bind_param(1," asd");
$sth->bind_param(2," klm");
$sth->bind_param_ino ut(3,\$no_go, 1000);
$sth->execute;
print "no go = $no_go\n";
while(
my @row=$sth->fetchrow_array ){
print "@row\n";
}
$sth->finish;

Here's my stored procedure:

CREATE PROCEDURE proc
@id varchar(50),@iy t varchar(20),@no _go int OUTPUT
AS
SET NOCOUNT ON
DECLARE @id_err int,@ans_glue_e rr int

BEGIN TRANSACTION
SELECT user_id FROM myTable
WHERE user_id=@id AND iyt=@iyt
SET @id_err = @@ERROR
IF @@ROWCOUNT <> 0
BEGIN
SELECT date,date_mod FROM ans_glue
WHERE user_id=@id
SET @no_go = 0
SET @ans_glue_err=@ @ERROR
END
ELSE
BEGIN
SET @no_go = 1
END
IF @id_err = 0 AND @ans_glue_err = 0
BEGIN
COMMIT TRANSACTION
END
ELSE
BEGIN
ROLLBACK TRANSACTION
END

the procedure runs perfectly in Cold Fusion, returning both recordsets
and output param, but in perl, it won't print the output param and I
don't know how to access the second recordset
HELP!
Jul 20 '05 #1
1 2958
Cliff (cl***@walkacro ssfire.com) writes:
here's my code:

my $sth = $dbhSQL->prepare('{ca ll proc(?,?,?)}');
$sth->bind_param(1," asd");
$sth->bind_param(2," klm");
$sth->bind_param_ino ut(3,\$no_go, 1000);
$sth->execute;
print "no go = $no_go\n";
while(
my @row=$sth->fetchrow_array ){
print "@row\n";
}
$sth->finish;
...
the procedure runs perfectly in Cold Fusion, returning both recordsets
and output param, but in perl, it won't print the output param and I
don't know how to access the second recordset
HELP!


You are probably better off to ask this in a forum devoted to DBI.
ActiveState hosts a mailing list, see
http://aspn.activestate.com/ASPN/Mai...eaded/perl-DBI.
--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3982
by: Bari Allen | last post by:
I have a Stored procedure in SQL, that works, when tested in SQL, with one input & several output parameters, as follows: CREATE PROCEDURE myProcedure @MyID int , @First varchar(80) OUTPUT , @Second varchar(80) OUTPUT , @Third varchar(80) OUTPUT , @Amount as numeric(18,0) OUTPUT etc.
2
3013
by: Lepa | last post by:
Hi I'm trying to make this to work and need help Here my SP and I'm building sql with output param. Alter PROCEDURE lpsadmin_getSBWReorderDollars ( @out decimal(10,2) output, @sType varchar(20),
11
11079
by: Axel | last post by:
Hi, I am currently creating an ASP page that returns a recordset of search result based on multiple keywords. The where string is dynamically built on the server page and that part work quite well. However I want to also return the number of records in the recordset and I can not manage to get any output parameter working. Even if I assign...
2
2538
by: Bari Allen | last post by:
ASP Classic question: I have a Stored procedure in SQL, that works, when tested in SQL, with one input & several output parameters, as follows: CREATE PROCEDURE myProcedure @MyID int , @First varchar(80) OUTPUT , @Second varchar(80) OUTPUT , @Third varchar(80) OUTPUT , @Amount as numeric(18,0) OUTPUT
1
5692
by: stjulian | last post by:
If inside a stored procedure, there a SELECT statement to return a recordset and another SELECT to set the value of an output parameter (as in SELECT @OutValue = Name FROM table WHERE pkid=5), would 2 execute statements be needed to return the OUTPUT parameter? Like this? adocmd.CommandTimeout = 120 adocmd.ActiveConnection = conn
3
11274
by: michelle | last post by:
I am trying to get an output value from a stored procedure using sqlDataSource in asp.net 2.0. But I only get a null value for the output. Can someone please help? The sqlDataSource: <asp:SqlDataSource ID="DataSource1" runat="server" ConnectionString="<%$ ConnectionStrings: ConnectionString1 %>" SelectCommand="UserLkp"...
8
2679
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for which invites will target selected personnel among our customers via email. Each email will provide a custom hyperlink for each respondent using a...
11
9449
by: gnewsgroup | last post by:
First, just in case, BLL = Business Logic Layer and DAL = Data Access Layer. I guess this is really a question about architecture. I believe there are many architect here. Software architecture is sorta new to me. I searched a little and did find this: http://www.velocityreviews.com/forums/t300246-bll-and-dal.html
3
5104
by: leesquare | last post by:
Hello, I need some help getting output values from my stored procedures when using adodbapi. There's an example testVariableReturningStoredProcedure in adodbapitest.py, and that works for my system. But my stored procedure also inserts and accesses a table in the database. Here's what I have it boiled down to: So, when I have
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.