Re: Pro*C for Windows NT

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/04/11
Message-ID: <335093a4.9335724_at_newshost>#1/1


Don't ask me why cause I don't know but pro*c on NT sets PARSE=NONE by default (while parse=full seems to be the default on other platforms).

With parse=none, you must use exec sql begin declare section/exec sql end declare section around bind variables.

Add parse=full to the proc command line and it should work....

On Fri, 11 Apr 1997 14:01:33 -0400, "Søren M. Olesen" <smo_at_stibo.com> wrote:

>Hi
>
>I'm trying to compile the following code, using Pro*C 2.2.2.0.0 for
>Windows NT:
>
>
>#include <stdio.h>
>#include <string.h>
>
>#define UNAME_LEN 20
>#define PWD_LEN 40
>
>VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle supplied struct */
>varchar password[PWD_LEN]; /* varchar can be in lower case also. */
>
>#include <sqlca.h>
>
>
>void sql_error();
>main() {
> char temp_char[32];
> strncpy((char *) username.arr, "SCOTT", UNAME_LEN);
> username.len = strlen((char *) username.arr);
> strncpy((char *) password.arr, "TIGER", PWD_LEN);
> password.len = strlen((char *) password.arr);
> EXEC SQL CONNECT :username IDENTIFIED BY :password;
> printf("\nConnected to ORACLE as user: %s\n", username.arr);
>}
>
>I get these errors:
>
>Pro*C/C++: Release 2.2.2.0.0 - Production on Fri Apr 11 13:57:35 1997
>
>Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
>
>System default option values taken from:
>D:\win32app\orant\pro22\pmscfg.cfg
>
>Semantic error at line 20, column 22, file test.pc:
> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>.....................1
>(1) PCC-S-02322, found undefined identifier
>
>Semantic error at line 20, column 46, file test.pc:
> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>.............................................1
>(1) PCC-S-02322, found undefined identifier
>
>
>
>Can anyone tell me what version of the compiler that allows me to
>compile this code, without having to explicit defining my host variables
>??
>
>
>Soren M. Olesen

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Apr 11 1997 - 00:00:00 CEST

Original text of this message