Solved

ORA-00933 error! I am use VC.net and OTL(oracle template library)

Posted on 2004-09-30
4
390 Views
Last Modified: 2013-12-12
my table "imgdata":
   id         number(5);
   name   varchar2(20); the value is like "andy"
   hand    varchar2(2); the value is "R" or "L"
   finger   varchar2(2);

my function:
void cmd_check(char* handval)
{
char* a = "select count(id) from imgdata where hand =: val<char[2]>";
otl_stream o(10,a,db);
o.set_commit(0);
o<<(char *)handval;
int b;
o>>b;
printf("%d\n",b);
}
main()
{
......
cmd_check("R");
......
}
When I run this funtion,I get the ORA-00933: SQL command not properly ended error.While when I input SQL command blew int SQL/PLUS:
select count(id) from imgdata where hand = 'R';
I get the correct output.How could the error happened? I cann't find the problem by myself.Please help me.
0
Comment
Question by:redsword
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Expert Comment

by:Helena Marková
ID: 12197991
Did you try this directly ?
char* a = "select count(id) from imgdata where hand ='R' ";

It is just a tip, I am not familiar with VC.net and OTL.
0
 

Accepted Solution

by:
redsword earned 0 total points
ID: 12214764
O, I find the problem! It's blank!
the otl parameter format should like :
"select count(id) from imgdata where hand = :val<char[2]>";
the "colon" should close with the parameter ,not equal mark!

0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question