Jacob Salomon wrote:
>
> Arun Shastry wrote:
> >
> > I'm working with some stored procedures and noticed something really
> > cool that Sybase/MS SQL Server have and Informix doesn't.
> >
> > In either one of the other DBMS's, if the last statement is a SELECT
> > that returns multiple records, that would be returned to the calling
> > application too. Informix returns a nasty -659 SQL error. I guess I
> > could get them into a set of local variables and loop thru them, but
> > the other approach would have been great.
>
> If I understand you correctly, the last statement in the stored proc is
> a syntactically incorrect (in SPL) statement but the Sybase engine will
> let it get by and return its rows to the caller. But this is only
> because it is the last statement before the return.
>
That's the big difference with Sybase.
What sybase allows you to do is to have a trigger call an OpenServer
registered callback function. (C or C++)
Then you have the trigger pass a pointer to the srv_proc structure to
your C code.
You can then pull the returned rows out of sybase into local variables.
Gee a low level C interface into the engine. Isn't that a great idea?
;-)
Seriously though there are some drawbacks.
If you write really shitty C code, then you really, really affect the
performance
of your engine whenever you refer to this table, and you may cause waits
on resources.
But I guess thats what separates the men from the boys.
-Mikey
--
#include <std_disclaimer.h> /* Mike Segel (MS385) */
#include <No_Spam.h>
#ifdef OFFENDED_BY_CONTENT
The author takes no responsibility for this post.
Any resembalence to a coherent rational thought is purely coincidence.
-The Management.
#endif
*****************************
* Attention *
-*- Due to AGIS's Refusal to Act Responsibly
-*- Due to ACSI's Refusal to Act Responsibly
We are blocking all of their domains at the packet level.
This block will exist until they modify their policies to
conform to existing RFCs and net community standards.
We encourage all ISPs and domain holders to do the same.
*****************************