Solved

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

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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle Next Available Number 2 44
su - oracle could not open session 6 79
Oracle Listener Not Starting 11 44
PL/SQL More than one element associated with another element 7 31
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

803 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