Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Relational Databases
Expertise: Beginner
Apr 10, 1998

Using Output parameter with TQuery

Question:
In a TQuery component, I use the SQL property to call up a stored procedure which is kept on a MSSQL server. The string used is 'Execute [nameofproc] :param1, :param2, etc.

However I am trying to return a value from the stored proc using an 'OUTPUT' parameter. How can I read this value from Delphi? The SQL help suggests using a 'param = retvar output' syntax, but Delphi is not happy when I add this into the execute statement.

Answer:
For most SQL operations, you can get away with using a TQuery; that is, if they're strictly one-way. For other SQL operations, you need to use the TStoredProc. TStoredProc has facilities built in for singleton return values.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date