SQL 6.5 stored procedure - parameter not returning 
Author Message
 SQL 6.5 stored procedure - parameter not returning

I'm somewhat new to stored procedures, so this may be a simple problem.

I have a simple stored procedure in a SQL Server 6.5 database, with one
input param and one output param.  The output param should get the same
value as the return value.  However, when I try to run the SP in a query
inside SQL Server, get a blank output for the output param, but the
correct answer for the return value.
(I have a separate problem with getting to it with VB6 and ADO, and
converting to SQL Server 7, which I will post another problem later)

Any ideas will be much appreciated.

Code follows.  (SP, then query, then results)
-----------------------------
Stored Procedure:
-----------------------------

as





--------------------------
Query:
-------------------------












-------------------
Query Results: (1 row matched)
----------------

Reg Table for TestMe -- Data Found 1 times
Reg Table for TestMe -- Data Found  times

-------------------------
-----------------------

Thanks.
--
============================================================
David Lakein -- ColdFusion, Visual Basic, Math+Statistics programmer
TeraTech Inc. - Tools for Programmers(tm)
100 Park Ave, Suite 360, Rockville MD 20850 USA
Voice: +1-301-424-3903
Web: http://www.*-*-*.com/

============================================================



Fri, 22 Mar 2002 03:00:00 GMT  
 SQL 6.5 stored procedure - parameter not returning
David,

When  you execute the stored procedure and you want the output parameter to
be "called by reference", you need to specify the OUTPUT keyword when you
invoke it:


Hope this helps!

John Peterson


Quote:
> I'm somewhat new to stored procedures, so this may be a simple problem.

> I have a simple stored procedure in a SQL Server 6.5 database, with one
> input param and one output param.  The output param should get the same
> value as the return value.  However, when I try to run the SP in a query
> inside SQL Server, get a blank output for the output param, but the
> correct answer for the return value.
> (I have a separate problem with getting to it with VB6 and ADO, and
> converting to SQL Server 7, which I will post another problem later)

> Any ideas will be much appreciated.

> Code follows.  (SP, then query, then results)
> -----------------------------
> Stored Procedure:
> -----------------------------
> Create Procedure sp_CountMainActivity


> as





> --------------------------
> Query:
> -------------------------












> -------------------
> Query Results: (1 row matched)
> ----------------

> Reg Table for TestMe -- Data Found 1 times
> Reg Table for TestMe -- Data Found  times

> -------------------------
> -----------------------

> Thanks.
> --
> ============================================================
> David Lakein -- ColdFusion, Visual Basic, Math+Statistics programmer
> TeraTech Inc. - Tools for Programmers(tm)
> 100 Park Ave, Suite 360, Rockville MD 20850 USA
> Voice: +1-301-424-3903
> Web: http://www.teratech.com

> ============================================================



Fri, 22 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Return value from stored procedure in SQL 6.5 to VB4 to a 16 bits client

2. Return a value from stored procedure in SQL 6.5 to VB4 to a 16 bits client

3. Passing parameters from Excel to SQL 6.5 stored procedures

4. sending parameters from VB 6 to SQL 6.5 stored procedure

5. Passing parameters from Excel to SQL 6.5 stored procedures

6. sending parameters from VB 6 to SQL 6.5 stored procedure

7. Stored Procedures with VB5/SQL Server 6.5

8. Accessing SQL 6.5 Stored procedures thru VB4.0

9. executing SQL Server 6.5 stored procedure using VB 5

10. Accessing return parameter from SQL server Stored Procedure

11. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

12. ADO and SQL 6.5 sp_droplogin Stored procedure

 

 
Powered by phpBB® Forum Software