Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: ct_sql Question
Date: Jan 17 2002 6:40PM

I have a script which executes a stored proc on the server and posts the
result back on the web page. I have noticed a strange thing in regards to
the Sequence of the columns in the output on the web page Vs isql. The
stored proc has a select clause as 

"select a,b,c from t1"

If I execute this sp from the isql I see the output as it should be i.e. "a
,b ,c". When I execute the same proc from the perl script and display the
output to the web page the columns are in the order of 
"b, c, a". 

I am using the ct_sql() function to execute the proc as below

my $data = $dbhndl2->ct_sql("exec sp__QMegs", undef, CS_TRUE);

I tried using my $data = $dbhndl2->ct_sql("exec sp__QMegs") and the sequence
got same on the web page as 
"a, b, c" but the column headings were not printed.

if I don't use the "undef" in the ct_sql() I get an error msg as below:

main::(r-chk-q.cgi:89): my $data = $dbhndl2->ct_sql("exec sp__QMegs",
Can't use string ("1") as a subroutine ref while "strict refs" in use at
C:/Perl/lib/Sybase/ line 910.
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.
  DB<1> q

How can I correct the sequence of the columns on the web page?? Any