Re: Column name MOD causing problem

From: Mike Morgan <mike.morgan_at_teldta.com>
Date: 1995/10/18
Message-ID: <4639eg$j3j_at_madison.tdsnet.com>#1/1


dci_at_sun.vais.net (Dynamic Computing) wrote:
>I am writing a Pro*c program to fetch some data from an existing table,
>but the table has a column name - mod. When I use EXEC SQL SELECT mod,
>field2 from MYTABLE, the precompiler is confused and thinks the field
>name - mod is the oracle function mod and gives a syntax error. Can
>anyone give me some ideas how I can get around this without altering the
>column name in the table. Thanks a lot in advance.
>
>Janie
>dci_at_vais.net

-- 

Try enclosing the column name in double quotes like:

EXEC SQL SELECT "mod", field2 from MYTABLE;

NB: The double quotes will force case sensitivity.  If, when you DESCRIBE 
MYTABLE, the column is in upper case, then make it:

EXEC SQL SELECT "MOD", field2 from MYTABLE;

Hope this helps,

Mike Morgan
Technology Integration Services - Unix DBA

email: mike.morgan_at_teldta.com

TDS Computing Services
301 S. Westfield Road
Madison, WI 53705  USA
(608)845-4661

"Murphy's Law of computing:  Anything that can go wrSegmentation 
fault(coredump)"
*******************************************************
Received on Wed Oct 18 1995 - 00:00:00 CET

Original text of this message