Pro*C for Windows NT

From: (wrong string) øren M. Olesen <smo_at_stibo.com>
Date: 1997/04/11
Message-ID: <334E7C7D.6F67_at_stibo.com>#1/1


Hi

[Quoted] 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); }

[Quoted] 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 Received on Fri Apr 11 1997 - 00:00:00 CEST

Original text of this message