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: Why won't this 1 line pgm pre-compile with Pro-C on NT?

Re: Why won't this 1 line pgm pre-compile with Pro-C on NT?

From: Steve Phelan <stevep_at_XXnospamXX.toneline.demon.co.uk>
Date: 1998/03/04
Message-ID: <889002746.7779.0.nnrp-02.c2de712e@news.demon.co.uk>#1/1

That's true, but you can skip the DECLARE section if MODE=ORACLE. Look in the Pro*C/C++ Guide and decide which approach is best for you.

Steve Phelan.

KRISHNAN GANESAN wrote in message
<#$QEDqxR9GA.233_at_upnetnews02.moswest.msn.net>...
>Username and password are host variables. You need to declare them as
>follows:
>
>EXEC SQL BEGIN DECLARE SECTION;
> char username[10];
> char password[10];
>EXEC SQL END DECLARE SECTION;
>
>Krish.
>
>Zoran wrote in message <34FCBC5A.22EE2C2A_at_echo-on.net>...
>>I'm trying to use the Pro-C precompiler for Oracle 8 on NT and it won't
>>pre-compile a simple 1 line pgm with just a connect statement.
>>
>>It's complaining about an undefined identifier, but it is defined... why
>>won't it see it?
>>
>>Here's my program:
>>
>>#include <stdio.h>
>>#include <stdlib.h>
>>#include <sqlca.h>
>>
>>main () {
>> char username[10] = "SCOTT";
>> char password[10] = "TIGER";
>>
>> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>>}
>>
>>This is what I get from the proc pre-compiler:
>>
>>
>>Pro*C/C++: Release 8.0.3.0.0 - Production on Tue Mar 3 21:17:40 1998
>>
>>(c) Copyright 1997 Oracle Corporation. All rights reserved.
>>
>>System default option values taken from: C:\ORANT\pro80\pmscfg.cfg
>>
>>Semantic error at line 9, column 23, file x.pc:
>> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>>......................1
>>PCC-S-02322, found undefined identifier
>>Semantic error at line 9, column 47, file x.pc:
>> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>>..............................................1
>>PCC-S-02322, found undefined identifier
>>
>>Thanks in advance Zoran.
>
>
Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

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