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
Solved

retrieving parameters from sql server's stored procedure

Posted on 2001-08-08
5
132 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
5 Comments
 
LVL 6

Accepted Solution

by:
Jaymol earned 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

790 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