help---I can't open oracleDB in web browser.

happywind 2001-03-29 11:09:00
hello .
I'm a Oracle user ,and developing Linux/CGI/Proc_c++ programs.
Now , there is a strange error when programs opened by web browser (netscape/IE).

my program is no error runing in text-output model.(in command line : ./test2_3.o)
but when it works in web brower,it dispaly error message:
1. "Error while trying to retrieve next for error ORA-12545" ---when I "EXEC SQL CONNECT : user_name IDENTIFIED BY : pass_word;"
2."error:ORA-01012:unable to open message file (SQL-02113)"---when I execute any select orders.(I think it was because that I have not open the OracleDB yet.)


I can't understand why it's all right in text-model but error in web browser!

my pro_c++ code is below:
---------------test2_3.pc-----------
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>

#include <sqlca.h>
#include <oraca.h>
using namespace std;
#include "mylib.cpp"
#include "html_function.cpp"

void main ()
{

html_begin ("read sitedbshm");

EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error:"); // 出错声明

EXEC SQL BEGIN DECLARE SECTION; file://数据库变量声明
VARCHAR user_name[LEN_USER_NAME];
VARCHAR pass_word[LEN_PASS_WORD];
char aaa_c[10],bbb_c[10];
EXEC SQL END DECLARE SECTION;

user_name.len = strlen ( strcpy ((char *) user_name.arr, "aaa" ) );
pass_word.len = strlen ( strcpy ((char *) pass_word.arr, "aaa" ) );

EXEC SQL CONNECT : user_name IDENTIFIED BY : pass_word

EXEC SQL DECLARE sql_result CURSOR FOR
SELECT aaa,bbb
FROM tablename1
where rownum <=8

EXEC SQL OPEN sql_result ;
EXEC SQL WHENEVER NOT FOUND DO break ;
cout << "<table border>";
for ( ; ; )
{
EXEC SQL FETCH sql_result INTO :aaa_c , :bbb_c ;
cout <<"<tr><td>aaa="
<< aaa
<<"<td> bbb="
<< bbb;
}

EXEC SQL CLOSE sql_result ;
cout << "connection has been closed.\n";

EXEC SQL COMMIT WORK RELEASE;

html_end();
}
-------------------------------------------------
compile it to test2_3.o and copy it to /cgi-bin
now ,the <table> has been displayed correctly, but oracle's error string in it ~_~!


please help me !!!!!!!!!!!!!!!!!!!!!!!

thank you very much^o^


Happywind



...全文
58 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

69,373

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧