Hi, everyone
I have a program as follows. It can be successfully precompiled on Oracle 8.1.6.0.0 for UNIX, but not on Oracle 8.1.6.0.0 for Windows NT. When it is precomiled on WinNT, the following error occurs:
EXEC SQL FETCH salespeople INTO :emp_rec_ptr;
PCC-S-02420, Incomplete (or missing) type specification
I don't understand the error message. Can you tell me how to fix the problem? Thanks a lot. (See code below, please)
------------------------------------------------------------
#include <stdio.h>
#include <sqlca.h>
struct emp_info
{
char emp_name[30];
float salary;
float commission;
};
main()
{
EXEC SQL BEGIN DECLARE SECTION;
struct emp_info *emp_rec_ptr;
char username[20];
char password[40];
EXEC SQL END DECLARE SECTION;
if (!(emp_rec_ptr = (struct emp_info *) malloc(sizeof(struct emp_info))))
exit(1);
strcpy(username, "SCOTT"
strcpy(password, "TIGER"
EXEC SQL CONNECT :username IDENTIFIED BY assword;
EXEC SQL DECLARE salespeople CURSOR FOR
SELECT ENAME, SAL, COMM
FROM EMP
WHERE JOB LIKE 'SALES%';
EXEC SQL OPEN salespeople;
for (;
{
EXEC SQL FETCH salespeople INTO :emp_rec_ptr;
printf("%-11s%9.2f%13.2f\n", emp_rec_ptr->emp_name,
emp_rec_ptr->salary, emp_rec_ptr->commission);
}
EXEC SQL CLOSE salespeople;
EXEC SQL COMMIT WORK RELEASE;
exit(0);
}
------------------------------------------------------------
I have a program as follows. It can be successfully precompiled on Oracle 8.1.6.0.0 for UNIX, but not on Oracle 8.1.6.0.0 for Windows NT. When it is precomiled on WinNT, the following error occurs:
EXEC SQL FETCH salespeople INTO :emp_rec_ptr;
PCC-S-02420, Incomplete (or missing) type specification
I don't understand the error message. Can you tell me how to fix the problem? Thanks a lot. (See code below, please)
------------------------------------------------------------
#include <stdio.h>
#include <sqlca.h>
struct emp_info
{
char emp_name[30];
float salary;
float commission;
};
main()
{
EXEC SQL BEGIN DECLARE SECTION;
struct emp_info *emp_rec_ptr;
char username[20];
char password[40];
EXEC SQL END DECLARE SECTION;
if (!(emp_rec_ptr = (struct emp_info *) malloc(sizeof(struct emp_info))))
exit(1);
strcpy(username, "SCOTT"
strcpy(password, "TIGER"
EXEC SQL CONNECT :username IDENTIFIED BY assword;
EXEC SQL DECLARE salespeople CURSOR FOR
SELECT ENAME, SAL, COMM
FROM EMP
WHERE JOB LIKE 'SALES%';
EXEC SQL OPEN salespeople;
for (;
{
EXEC SQL FETCH salespeople INTO :emp_rec_ptr;
printf("%-11s%9.2f%13.2f\n", emp_rec_ptr->emp_name,
emp_rec_ptr->salary, emp_rec_ptr->commission);
}
EXEC SQL CLOSE salespeople;
EXEC SQL COMMIT WORK RELEASE;
exit(0);
}
------------------------------------------------------------