Solved

StoredProc Parameters.

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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