Ratkiia
Ratkiia

Reputation: 49

How to extract data with Actual Column Size rather then Fixed Column Size in SYBASE by ISQL query

ISQL command executes the SQL file and generates a text file. The results data columns size is based on the fixed size of the column and not based on the actual size of the data. e.g. The Table "STUDENT" has columns "FirstName" varchar(10) "LastName" varchar(10)

ISQL Command :- isql -UUserID -PPassword -SDatabase1 -DUserID -iName.sql -b -s -w2000 -oName.txt

When I execute the SELECT query(Name.sql) by the ISQL command it result in Actual :- FirstName |LastName JOHN______|DOE_______

Note : "_" is blank spaces

Expected :- FirstName|LastName JOHN|DOE

I did google and I got few links but they were not helpful to me. https://docs.faircom.com/doc/isql/32422.htm http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30191.1550/html/utility/utility14.htm

Installed SYBASE version : 15.7.0

Upvotes: 1

Views: 295

Answers (1)

Ratkiia
Ratkiia

Reputation: 49

After researching I came to know that Sybase ISQL has this limitation and data result column is based on the fixed size of the column rather then the actual size. There are other options available like having temporary table/views and we can get the desired data. I ended up writing a utility that does the job for me.

Upvotes: 0

Related Questions