Solved

Stored Procedure Parameter Problem

Posted on 1997-11-24
1
218 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

21 Experts available now in Live!

Get 1:1 Help Now