Solved

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

Posted on 2004-09-30
4
379 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á
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
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 explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to take different types of Oracle backups using RMAN.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now