Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find precision and scale for decimal

400 views
Skip to first unread message

Michael Weber

unread,
Mar 13, 2012, 10:42:18 AM3/13/12
to
System: IBM Informix Dynamic Server Version 9.40.UC6W4

Hi guys,

sorry for my bad language but i'll try to describe my problem.

Where is the precision and scale for decimal located? I have a database
an i'm looking for the precision and scale in the syscolumns table.

Would you be so kind to help me?

Thanking you in anticipation.

Greets Michael

Art Kagel

unread,
Mar 13, 2012, 11:07:33 AM3/13/12
to Michael Weber, inform...@iiug.org
It is encoded in syscolumns.collength.  Here's a snippet from the code to my dbschema replacement utility, myschema, where it decodes the column:

 case SQLDECIMAL:
        if ((syscolumns.collength % 256) == 255)
            /* Floating point. */
            fprintf( outfile,
                     "DECIMAL(%d)",
                     syscolumns.collength / 256 );
        else
            /* Fixed point. */
            fprintf( outfile,
                     "DECIMAL(%d,%.1d)",
                     syscolumns.collength / 256,
                     syscolumns.collength % 256 );
        break;

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.



_______________________________________________
Informix-list mailing list
Inform...@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list

0 new messages