File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Error in Oracle like clause
Joined: Mar 07, 2006
May 23, 2006 15:33:00
Here the like clause is not working,since the sql is itself in sinle quotes.
I don't know how to make the like clause work.
The error it is giving me is:
ORA-00920: invalid relational operator
ORA-06512: at "TABCOUNT", line 10
ORA-06512: at line 2
The code is
CREATE OR REPLACE FUNCTION tabcount (
tab IN VARCHAR2, field IN VARCHAR2 ,whr IN VARCHAR2)
DBMS_OUTPUT.PUT_LINE ('whr' ||whr);
DBMS_OUTPUT.PUT_LINE ('field1' ||field);
' SELECT COUNT(*) FROM ' || tab ||
' WHERE ' || field || 'like ''%'||whr ||'%'''
DBMS_OUTPUT.PUT_LINE ('countis!' ||retVal);
Looking for some answer.
Joined: Jun 05, 2006
Jun 10, 2006 03:04:00
the bug in ur query is the statement whatever u have written as || 'like ''%'||whr ||'%'''
|| ' like ''%'||whr ||'%'''
u have skipped the blank space between the field values & like keyword
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Error in Oracle like clause
PL/SQL substitution variable
Stored procedure which returns array
ORA-06550: line 1, column 36: PLS-00103: Encountered the symbol ";"
Problem in executing Oracle Function from JSP Page
Permission problem calling java from PL/SQL
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013