Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Stored Procedure Parameter Problem

Posted on 1997-11-24
1
Medium Priority
?
225 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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