> -----Original Message-----
> From: Neil Lunn [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 03, 2001 8:44 PM
> To: 'Guangzu Wang (Houston)'; [EMAIL PROTECTED]
> Subject: RE: Only return the FIRST field from DBD/ODBC/Sql Server stored
> proce dure
>
>
> > -----Original Message-----
> > From: Guangzu Wang (Houston) [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 04, 2001 3:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: Only return the FIRST field from DBD/ODBC/Sql Server stored
> > proce dure
> >
> >
> > I use DBD::ODBC with Easysoft ODBC bridge to connect SQL
> > server 6.5 from
> > Linux. I have a stored procedure that is supposed to return
> > several fields.
> > It only returns the first field of my result set. I searched
> > the archive of
> > this mailing list and haven't found some encouraging news.
> >
> > The book of "Programming the Perl DBI" (pp 296) mentioned
> > stored procedure
> > can be called using "{?= call procedure_name(?,?)}" but then
> > said "DBD::ODBC
> > currently does not support output parameter". Doesn't that
> > mean I can NOT
> > use that method? I tried but failed. I tried both escape
> > method like {call
> > procedure_name} and direct run  as "exec procedure_name", same result.
>
> Not sure what you mean. What does the sp do? If it's just
> returning a rowset
> as you seem to imply by the term "field" then it is not different from any
> SELECT, PREPARE, FETCH, FETCH ... etc operation. If this isn't so you will
> be better off to clarify this to the list.
>
> >
> > The same book mentioned in several places (like pp 223) that
> > fetchrow_array
> > returns the value of the first field if used "in a scalar
> > context". I am not
> > sure about this "scalar context", is this something related
>
> @list   = $sth->fetchrow_array;  # ie (1,2,3,4)
> $scalar = $sth->fetchrow_array;  # only gets 1st element $list[0]

I believe that in a scalar contex it will return true or undef, but in the
list context
($scalar) = $sth->fetchrow_array it will return the first element.

Ilya Sterin


>
> Which is probably what you are doing, though I am sure the book has clear
> examples. I would also suggest a read of your perlvar manpage if
> you are not
> fammiliar with the concept of scalars.
>
>
> Neil
>
> > to my problem
> > about the stored procedure?
> >
> > Does any one has a clue? Thanks  a lot in advance.
> >
> > Guangzu
> >
>
> __________________________________________________________________________
> Please Note :
> Only  the intended recipient is authorised to access or use this
> e-mail.  If
> you are not the intended recipient,
> please delete this e-mail and notify the sender immediately.
> The contents
> of this e-mail are the writer's
> opinion and are not necessarily endorsed by the Gunz Companies unless
> expressly stated.
>
> We use virus scanning software but exclude all liability for viruses or
> similar in any attachment.
>

Reply via email to