Home » Infrastructure » Windows » ORA-00922
ORA-00922 [message #99670] Thu, 14 February 2002 01:11 Go to next message
shankari
Messages: 2
Registered: February 2002
Junior Member
Hi,
If I want to set a escape character(say ) in SQL prompt, I do write following way:
set escape ;
Now If want to execute same statement using ODBC from vc++,I run following piece of code:

CString strQuery = "SET ESCAPE ON";
SQLHENV henv;
SQLHDBC hdbc;
HSTMT hstmt;
RETCODE retCode;
UCHAR szDsn[[4]]="DSN";
UCHAR szUid[[4]]="UID";
UCHAR szPwd[[4]]="PWD";
retCode = SQLAllocHandle(SQL_HANDLE_ENV,NULL,&henv);
retCode = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);
retCode = SQLAllocHandle(SQL_HANDLE_DBC,henv,&hdbc);
retCode=SQLConnect(hdbc,szDsn,SQL_NTS,szUid,SQL_NTS,
szPwd,SQL_NTS);
retCode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc,hstmt);
retCode = SQLExecDirect(hstmt,(UCHAR FAR*) (LPCSTR)strQuery,SQL_NTS);

On executing the above stmts, I get the following error
"ORA-00922: missing or invalid option"

Could you please help me to resolve this problem.Or if you have any other idea about how to set escape character through vc++ program , please tell that also.

Thanks,
shankari
Re: ORA-00922 [message #99706 is a reply to message #99670] Mon, 25 February 2002 06:06 Go to previous message
Befeo
Messages: 4
Registered: February 2002
Junior Member
if I have to set an <ESC> I would test a dricr program using the C language function iscntrl().

I would try to access the equivalent of ASCII for <ESC> using a pointer to access it. To make that work you use a putc() to turn the ASCII into binary.

Test it using a driver to see what the iscntrl() function returns when you test the pointer, or its contents (parameter type not familiar).

You can use printer codes and CHR$() if that is your application.

Have a good time
Previous Topic: connection refused
Next Topic: Re: Exporting Access to Oracle
Goto Forum:
  


Current Time: Thu Mar 28 03:54:04 CDT 2024