Solved

StoredProc Parameters.

Posted on 1998-06-01
3
354 Views
Last Modified: 2010-04-06
I've got a stored Procedure in Sybase that takes has in input parameter of a date and four output parameters.  I Set the input parameter, Prepare the StoredProc Component. then Open it.  Howver I get an ODBC error.. Wrong number of parameters... Blah blah..

Any ideas?

Roger Webb
0
Comment
Question by:Whytboy
[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
  • 2
3 Comments
 

Accepted Solution

by:
KirkGray earned 100 total points
ID: 1349584
Sometimes Deplhi doesn't like runtime parameter binding in queries (for example when you refer to a SP in sql server using a database prefix.... ie 'master..xp_regread').

I solved the problem by building the query myself.  Ie... Do Your Own parameter Subsitution at Runtime.  I know it's a little slower ('cause of no prepare and stuff)... but if it works, it works!


0
 

Author Comment

by:Whytboy
ID: 1349585
Problem is... then you are stuck with the query right there.. can't use it in other programs anywhere without rebuilding.. then if you need to change it... you gotta remember everywhere the query is used.

Roger
0
 

Expert Comment

by:KirkGray
ID: 1349586
I don't think you got what I mean.

My Idea was still to use your stored procedure, but not Delphi parameter subsutition.

Like put this SQL in a TQuery:

SP_MyProc 'a text parameter'

as opposed to using a TStoredProc component.  

Just an idea, I thought might have helped, But I think you would have trouble with output parameters using this technique anyhow.

Cheers Man,

  Kirk.
0

Featured Post

Independent Software Vendors: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

734 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