我正在练习Pro*C
计划和SQL
,我有以下简单程序:
#include <stdio.h>
#include <sqlca.h>
char user_id[20]="test/test"
char emp_name[20];
main()
{
EXEC SQL CONNECT :userid;
printf("Connected\n");
EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT name
FROM badge;
EXEC SQL OPEN emp_cursor;
printf("Employees---------------");
EXEC SQL WHENEVER NOT FOUND DO break;while (1)
{
EXEC SQL FETCH emp_cursor INTO :emp_name;
printf("%s\n", emp_name);
}
EXEC SQL CLOSE emp_cursor;
EXEC SQL COMMIT WORK RELEASE;
exit(0);
}
它只是从名为BADGE
的表中检索所有名称:
CREATE TABLE BADGE
(
badge_id NUMBER PRIMARY KEY,
name VARCHAR(20),
surname VARCHAR(20) NOT NULL,
birthday DATE
);
但是,当我尝试编译源代码时,我遇到以下错误:
proc test.pc proc:符号查找错误:proc:undefined symbol:kgsuglo_
任何人都可以帮我解决错误吗?
答案 0 :(得分:1)
我在with open(r'C:\outputfile.csv', 'a', encoding='utf-8') as fd:
for line in text_list:
fd.write(line.strip()+'\n')
遇到此问题,并通过升级到instantclient-precomp-linux.x64-12.1.0.1.0.zip