PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: ct_sql Question
Date: Jan 17 2002 7:23PM

Sabherwal, Balvinder (MBS) writes:
 > 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". 

Right - ct_sql() was never intended to preserve the order of the
columns when using the hashrow functionality.

You may want to adapt ct_sql() to your needs by adding a call to
ct_col_names() and storing that somewhere for later use when printing
the column names.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler@peppler.org - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com