Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Indicator variable required but not supplied

Author  Topic 

Jozza
Starting Member

4 Posts

Posted - 2006-05-01 : 12:58:37
Hi there,

I have a stored procedure that selects the value of the order date in a table named Order and i am currently experiencing some problems with it.

I have a record (orderID=5 primary key) that i want to retrieve in an application (Tibco Staffware). Executing the stored procedure in the Enterprise manager/ SQL Query analyzer or retrieving the order date in Staffware with OrderID value "1" work fine, however running the sp with the input as "5" for the orderid in Staffware the ODBC SQL server driver gives the error message:
ODBC SQL Server Driver: "Indicator variable required but not supplied"

Detail:

CREATE PROCEDURE cus_lookuporder ( @OrderID int, @orderdate char(8) output)
AS
set @orderdate = (Select CONVERT(CHAR(8), orderdate, 3) from "Order" where OrderID = @OrderID)
GO


Table design:
OrderID int 4
Orderdate datetime
FK_ProductID int 4
FK_CustomerID int 4
FK_ScheduleID int 4

Data:
1 8-4-2006
2 8-4-2006
3 5-4-2006
4 4-4-2006
5 1-5-2006
*The other 3 columns have null values for all records.

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-05-01 : 13:20:29
So, what does this return when you run it in Query Analyzer:

Select CONVERT(CHAR(8), orderdate, 3) from Order where OrderID = 5
Go to Top of Page

Jozza
Starting Member

4 Posts

Posted - 2006-05-01 : 13:25:38
quote:
Originally posted by blindman

So, what does this return when you run it in Query Analyzer:

Select CONVERT(CHAR(8), orderdate, 3) from Order where OrderID = 5


using the Object browser to execute the stored procedure it returns:
Stored Procedure: DemoDB.dbo.cus_lookuporder
Return Code = 0
Output Parameter(s):
@orderdate = 01/05/06
Same goes for running the sql query Select CONVERT(CHAR(8), orderdate, 3) from "Order" where OrderID = 5
Go to Top of Page

Jozza
Starting Member

4 Posts

Posted - 2006-05-01 : 13:33:20
Problem solved. The stored procedure referring to in Staffware was an old copy of the database named CustomerDB instead of DemoDB. :)
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-05-01 : 15:27:32
Don't run stuff through the object browser. Be a real DBA and use Query Analyzer.
Go to Top of Page

Jozza
Starting Member

4 Posts

Posted - 2006-05-02 : 02:53:59
quote:
Originally posted by blindman

Don't run stuff through the object browser. Be a real DBA and use Query Analyzer.



Since Staffware only gets to 'talk' with SQL server through stored procedures, input and output parameters I prefer using the object browser.
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-05-02 : 09:31:55
quote:
Originally posted by Jozza

Since Staffware only gets to 'talk' with SQL server through stored procedures, input and output parameters I prefer using the object browser.

Not sure what one thing has to do with the other, but using Query Analyzer to execute the procedures would more closely simulate Staffware's interaction with the database.
Go to Top of Page
   

- Advertisement -