Solved

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

Posted on 2004-09-30
4
383 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle dataguard 5 47
Trying connecting to SQL server 2016 from sql developer using Third Party JDBC Drivers, 2 33
Oracle collections 15 29
date show only hh:mm 2 29
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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…

820 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