Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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 12c Default Isolation Level 17 64
update based on the value on another table 8 40
construct a query sql 11 43
sql script run from cron does not work 46 35
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 …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

739 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