Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

retrieving parameters from sql server's stored procedure

Posted on 2001-08-08
5
Medium Priority
?
137 Views
Last Modified: 2010-04-06
i have a stored procedure with output parameters.
how do i get values returned by the parameters from delphi?

thanks
0
Comment
Question by:sapulidi
[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
5 Comments
 
LVL 6

Accepted Solution

by:
Jaymol earned 200 total points
ID: 6363975
Hi,

To retrieve the values in the output type parameters, use this...

  ReturnedValue:=StoredProc1.ParamByName('ReturnValue').Value;

It's as simple as that.  (Obviously change the 2 variable names to suit.)

John.
0
 
LVL 21

Expert Comment

by:gemarti
ID: 6364071
Have you tried placing a DataSource and Query Component on your Form or DataModule?

In the DataSource Component you will Select Query1 as the dataset.
In the Query Component you would select the DatabaseName (If it's not in the list you'll have to create it from either BDE or ODBC).

Add this SQL Statement to the query1.SQL String List:  SELECT * FROM storedprocedure (:parameter)



0
 
LVL 4

Expert Comment

by:fva
ID: 6367004
In addition to the above:
gemarti's suggestion will work only for DBMS's that return a resultset (e.g. MS-SQL).
If your proc is on Oracle _and_ one of the params is an OUT/INOUT REF CURSOR, then the resultset has to be accessed differently. Treat your stored proc as a dataset and instead of Exec just Open it and use it as a regular dataset. Do not forget to close it at the end.

F.
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8741578
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Jaymol's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

704 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