Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is there a way to use "COLUMN FORMAT" in a Pro*C/C++ app?

Re: Is there a way to use "COLUMN FORMAT" in a Pro*C/C++ app?

From: Ramon F Herrera <ramon_at_conexus.net>
Date: 2 Apr 2007 07:09:39 -0700
Message-ID: <1175522979.896779.116320@e65g2000hsc.googlegroups.com>


On Apr 2, 2:41 am, "sybrandb" <sybra..._at_gmail.com> wrote:
> On Apr 2, 7:50 am, "Ramon F Herrera" <r..._at_conexus.net> wrote:
>
>
>
> > My application has some SQL statements like this:
>
> > SELECT
> > to_char(amount1, '99,999,990.00'), \
> > to_char(amount2, '99,999,990.00'), \
> > to_char(amount3, '99,999,990.00'), \
> > to_char(amount4, '99,999,990.00'),
> > [...]
>
> > Is that the only way to format real numbers from a precompiler
> > application?
>
> > The command "COLUMN FORMAT" seems to work only from SQL*Plus.
>
> > TIA,
>
> > -Ramon F Herrera
>
> The COLUMN command is a sql*plus command, it isn't a SQL command. So
> yes, it is the only way.
> Obviously you could define the format as a string constant, but it
> seems you prefer hardcoding and maintenance nightmares.
>
> --
> Sybrand Bakker
> Senior Oracle DBA

Sybrand:

I have found instances in which the Oracle precompiler doesn't deal properly with '#define' constants in "EXEC SQL" statements, so I am staying away from those.

However, per your suggestion, I did change all my variable sizes to constants, located in a central .h file. Once I determine the best sizes for all my VARCHARs, that file will probably remain untouched until the end of time.

Thanks!

-Ramon Received on Mon Apr 02 2007 - 09:09:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US