Solved

StoredProc Parameters.

Posted on 1998-06-01
3
347 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
  • 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now