Solved

Stored Procedure Parameter Problem

Posted on 1997-11-24
1
217 Views
Last Modified: 2010-04-04
I have a stored procudure in SQL Server with 3 parameters:
        pa varchar(10)
        pb varchar(20)
        pc smallInt OUTPUT
and therefore I creaet a stored procedure in Delphi with parameters
        @pa     INPUT
        @pb     INPUT
        @pc     INPUT/OUTPUT
when I try to call it from Delphi, it keeps coming out an error message.
If I bind the parameters by name, it says "Parameter 'pa' not found";
if I bind the parameters by number, it says "Invalid parameter".
What can I do with this? Any advices are appriciated.
0
Comment
Question by:huangsu
1 Comment
 

Accepted Solution

by:
hansmtbank earned 200 total points
ID: 1351663
When you set DatabaseName and StoredProcName properties
in Object Inspector try to set Active=True. If it fails then you
didn't set Params property in this stored procedure. Choice
this property Params and set all TYPES and null values for all
parameters.
It seems to me that Delphi can pass Params without type casting. If Params[0] is Integer I set it's value
 MyProc.Params[0].AsInteger := 1;

and not

MyProc.Params[0].AsString := '1';

Regards!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

14 Experts available now in Live!

Get 1:1 Help Now