I used to use it for some Oracle reporting, but I would like to know if SQR can handle calls to stored procedures. In trying it out, I was unable to use this syntax:
begin-procedure select-data
begin-select ! I guess this is probably why. it is an SP, not a true select
stored_procedure_call
end-select
end-procedure
Is a construct like this possible using SQR? Thanks for any info. Please reply to me via email at: gann...@jpmorgan.com. I will post a summary of any replies.
Patrick Gannon
J.P Morgan & Co.
gann...@jpmorgan.com
I have not written SQR for some time, but I recall that you could call a
stored procedure and pass parameters, but you were not able to receive
output from the stored procedure into SQR. (this is not a known fact)
Devan Green
Satel Corp
Use this instead.
begin-procedure select_data
begin-sql
exec stored_procedure_call
end-sql
end-procedure
---
Kai
*****************************************
* Kai Tham *
* 168 Group, Inc. *
* (212)886-1825 *
*****************************************
For the results from the first sql query, you can then "do" a paragraph
to process each row. Parameter can be input and/or output similar to
"isql" processing.
This is all documented in some release notes somewhere.
Good luck
JBrendan
BTW - You could also do something like:
begin-sql
exec procA $value1 #value2....
end-sql
But you lose some functionality for row by row processing of results.
--
=============================================================================
Brendan McKelvey (jbrendan) Mail : brendan....@sybase.com
Sybase Technical Support
77 South Bedford St. 5th Floor Phone: 1-800-8SYBASE
Burlington, MA 01803 1-800-879-2273
"Dont worry, be happy!!" "Happy, Happy, Joy, Joy!!"
=============================================================================
| From LindaVan...@solectron.com Thu Apr 28 00:46 PDT 1994
| From: LindaVan...@solectron.com
| Date: 27 Apr 94 12:40
| To: dav...@sybase.com
| Subject: Re: (fwd) SQR & Sybase
| Content-Type: text
|
| There are two ways to execute a stored procedure in SQR with Sybase:
|
| 1) begin-sql
| execute myproc $var, #var2, ...
| end-sql
|
| This is for stored procedures that do not return data, only perform
| some action
|
| 2) EXECUTE [-Cn] [ON-ERROR=procedure [DO=procedure]
| [@#status_variable=] stored_procedure_name
| [[@param=] $|#|$var|value [OUT[PUT] [,...]
| [into &col_name data_type [(len)]] [,...]
| [WITH RECOMPILE]
|
| This is straight from the book... this is for stored procedures
| that return data - only the first set of results are
| processed (just like begin-select can only handle one
| select statement). The DO=procedure will do all the
| processing like printing, making nested procedure calls,
| calculations, etc.
|
|