Solved

Stored Procedure Parameter Problem

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
code issue 8 185
When I am typing into a TEdit last word repeats 7 161
Delphi Form ownership 4 126
Delphi IDE crash without error message ... 7 119
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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