Alexander Farber (EED) writes:
> Hi Michael,
>
> thanks again for your helpful response!
> I have just 2 more questions:
>
> Michael Peppler wrote:
> > One, you need to check $sth->{syb_result_type} to see what sort of
> > result row you are retrieving. It you "use DBD::Sybase" you'll have
> > the symbolic values available (CS_COMPUTE_RESULT, CS_ROW_RESULT,
> > CS_STATUS_RESULT - "compute by" row, normal row, proc status
> > respectively).
> >
> > Second the column name for the compute by rows *should* be "sum(2)"
> > and "sum(3)".
>
> 1) Why have you made it 1-based and not 0-based?
That's the way columns are numbered in a result set in Sybase.
> However I wonder if all CS_COMPUTE_RESULT's are returned in one
> pass (ie. in one $href), because if I call the stored procedure
> manually from sqsh, I see the compute results on different lines:
All the compute results are returned as a single row (as long as the
"by ..." is the same - you could have multiple compute-by clauses).
I suspect that sqsh (and, no doubt, isql) separates different types of
aggregate functions to make it more easily legible, as you could have
both a sum(foo) and a max(foo) in the compute-by clause.
Michael
--
Michael Peppler - Data Migrations Inc. - [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: [EMAIL PROTECTED]