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: KRISHNAN GANESAN <KRISHNANG_at_MSN.COM>
Date: 1998/03/03
Message-ID: <#$QEDqxR9GA.233@upnetnews02.moswest.msn.net>#1/1

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 Tue Mar 03 1998 - 00:00:00 CST

Original text of this message

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