A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
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
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Error in Oracle like clause
Problem in executing Oracle Function from JSP Page
PL/SQL substitution variable
Permission problem calling java from PL/SQL
ORA-06550: line 1, column 36: PLS-00103: Encountered the symbol ";"
Stored procedure which returns array
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014