× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



SYSCOLUMNS is an LF on aIBM supplied PF with data on all fields in any
file. You can query it with SQL.

I do not think calculated fields (when using SQL functions SUM, COUNT, AVG,
etc) will be found in SYSCOLUMNS. Even a SUBSTR may return a column of data
type VARCHAR.

How can i know if the field is packed decimal (13,2)  or DBCS
a. packed decimal - IF LENGTH(13,2)
  system only return         SQLTYPE 484=Packed Decimal 
                                    SQLLEN  BINARY(4) , how to translate
to integer

SQLLEN of packed and zoned fields (columns) is a little odd. The numbers
are split up in precision and scale; scale is the number of decimals.
In your example 13,2    13 = precision 2 = scale
To calculate the length the precision is multiplied with 256 and the scale
is added to that result. So the SQL length of 13,2 will be the value of
3330 ((13 * 256) + 2)

If you use SQL DESCRIBE into the SQLDA, all those metadata is retrieved.
The only thinh you have tpo do is spully for each column the address of the
receiving host variable.

Regards,
Carel Teijgeler  

*********** REPLY SEPARATOR  ***********

On 11-8-2006 at 10:01 simontcy wrote:

never use MS SQL server before , can you describe how to use the file
SYSCOLUMNS

from: rob@xxxxxxxxx

Describe table is one way. Have you thought of querying the file 
QSYS2/SYSCOLUMNS? If you have any experience with MS SQL Server then it 
might even look familiar to you.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.