Regarding Relational operator in PL/SQL
Hi,
I want to use not greater than operator in query.
where id !> 7
but it gives error.
Kindly give syntax for the not greater than.
or if you like
... where not id > 7
Similar Messages
-
Hi,
if I :
create table t (a number, b number, c number);
and then run the following query:
delete from t where a='1' and (b, c) in (
select b, c from t
where a='1'
group by b, c
having count(*) > 1);
-- nothing to see here
I get the following error:
ORA-00920: invalid relational operator
If I remove the "-- nothing to see here" comment, the query runs fine.
If I remove the quotes around the 1s it also runs fine, with or without the trailing comment.
I had a look through the forum and couldn't see this listed anywhere, though I presume others have come across similar problems?
I presume there is a simpler test case; I tried to reduce it a bit, but most of what is there seems to be needed to reproduce the error.
Note that it doesn't have to be a comment following the query; any text at all will cause the same error.
regards,
WilliamHaving just played around a bit, if you change the subquery to just return a single column, say "b" rather than "b" and "c":
delete from t where a='1' and b in (
select b from t
where a='1'
group by b
having count(*) > 1);
-- nothing to see here
Then I get error "ORA-00911: invalid character" instead.
If I run the buffer as a script (F5) I get:
SQL ERROR:ORA-00911: invalid character
delete from t where a='1' and b in (
select b from t
where a='1'
group by b
having count(*) > 1);
-- nothing to see here
ORA-00911: invalid character
In case that helps you locate it at all.
Note: if I move the "group by" clause onto the where line then it runs correctly.
regards,
William
Message was edited by:
user454290 -
BP Selection by Role- Problem with relation operator
Hai Experts,
I am using sandbox system. I am trying to search Business Partner by role, when I give the role as BUP002(Prospect) and enter, the system is throwing a message that "BP Role BUP00 does not exist" and i have checked the relation operator which will be available next to the BP Role(when we input the role as BUP002), the relation has been set it as " Role=BUP00" , because we do not have any role with BUP00,hence the system is throwing that message. Now i need your help where do we set that relation may be in configuration or customization.Kindly provide me the exact path and way to do it.
Thanks and Regards,
TejaHi Teja,
Please check the SPRO settings, just follow the path below
SPRO->Click SAP Reference IMG->Customer Relationship Management->Master data->Business Partner-> Basic settings->Assign template for content managment folder to BP roles,
Just check it, here there is a view that u need to maintain.
Just check it I am not so sure about, as I dont have a local system in which I can try it. So check it and let me know if it is working fine.
Have a grat day ahead.
Thanks and Regards,
Antony Thomas -
Unsupported Relational Operator Types and DB2e 9.1
Hello,
we are using MAM3.0SR3 and adapt this application. So during SP20 installtion we had to swtich to DB2e 9.1 (Prerequisit). However, know it seams the relational operator type LIKE doesn't work anymore. I also tested similar relational operator types which also don't work anymore:
RelationalOperatorType.LIKE_INSENSITIVE (wildcard "*")
RelationalOperatorType.LIKE (wildcard "*")
RelationalOperatorType.SQL_LIKE (wildcard "*")
RelationalOperatorType.IN
All the mentioned operator types producing NullPointerExceptions. I used DB2e 8.2.4 before and there LIKE was working fine (the others I didn't test with DB2e 8.x.x). Now I use CONTAINS.
There exists STARTS_WITH too, but for "ENDS_WITH" is now replacement available (which could realized with LIKE before).
Know anybody of you a SAP note or document, where these restriction are described? And what about ENDS_WITH?
Thanks in advance
Andreas DommesHi Andreas,
have a look here - hopefully that helps:
http://publib.boulder.ibm.com/infocenter/db2e/v9r1f1/index.jsp?topic=/com.ibm.db2e.doc/adg/dbeapr1112.htm
Furthermore if the DB is not active - have you tried to deploy it manually?
Regards,
Oliver
Message was edited by: Oliver - sorry, first reply was just wrong.
Oliver Kaluscha
Message was edited by:
Oliver Kaluscha -
Relational operator -- is not supported.
Hi Friends,
I am getting this error "The above error Relational operator " - " is not supported".
I am just trying to subtract one value (say x ) from another ( say y). Even I am trying to use +,*,% also for trail purpose.
The same error is getting. Here I am giving the program...
REPORT ZLOGIC_SUR .
data : a type p,
b type p,
c type p,
d type p,
e type p.
a = 10.
b = 20.
c = 30.
d = 40.
if ( b - a ) = 10.
write e.
else.
write a.
endif.
Please let me know where I am doing mistake..
Regards,
ABPA learner..Hi
do it like this
data : a type p,
b type p,
c type p,
d type p,
e type p,
v TYPE p.
a = 10.
b = 20.
c = 30.
d = 40.
v = ( b - a ).
if v = 10.
write e.
else.
write a.
endif.
Regards
Preeti
<b>
Reward</b> -
Requesting help-On a report Getting ora-00920 invalid relational operator.
Hi everyone,
I am having a report region with the following query:
select CASE
WHEN ISITRECENTADDENDUM(meckey_fk,code)
THEN
'<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:61:&SESSION.::NO::P61_MECKEY_FK:'
|| &P60_MECKEY.
|| ''', 700, 700);">'
|| '<img src="#IMAGE_PREFIX#gobut.gif">'
|| '</a>'
ELSE NULL
END EditAddendum,
'<a href="javascript:popURL('''
||'&REPORTS_URL.keynewmec&P_1=&P60_MECNUM.'
|| ''', 700, 700);">'
|| '<img src="#WORKSPACE_IMAGES#printer.jpg">'
|| '</a>'
PrintMEC,
"CODE",
"MECKEY_FK",
"ADDENDUM",
"WHO_CREATED",
"WHEN_CREATED"
from "C_ADDENDUMS"
where "MECKEY_FK" = v('P60_MECKEY')
And my function returning boolean is as follows:
create or replace FUNCTION "ISITRECENTADDENDUM"
(meckeyi in number,
codei in varchar2)
return Boolean
is
x varchar2(1);
begin
select max(code) into x from c_addendums where meckey_fk = meckeyi;
if x = codei then
return true;
else
return false;
end if;
exception
when others then
return FALSE;
end;
But I am getting ORA-00920 invalid relational operator. Can anyone please help me out? I am not knowing where the error is. When I run the function by itself I am getting "False" returned as expected. Appreciate any advice on this.
Rgds,
Suma.Suma,
It looks like what you are trying to do is display a link for the record with the highest value in the Code column, and nothing for the other records.
If that is the case, you can eliminate the function and just use a SQL query like this:
(not tested)
select CASE
WHEN code = Max(code) over (partition by meckey_fk)
THEN
'<a href="#">'
|| ' '
|| '< img class="TargetAlertIcon" src="chrome://targetalert/content/skin/internal.png"></a>'
ELSE NULL
END EditAddendum,
'<a href="#">'
|| ' '
|| '< img class="TargetAlertIcon" src="chrome://targetalert/content/skin/internal.png"></a>' PrintMEC,
"CODE", "MECKEY_FK", "ADDENDUM", "WHO_CREATED", "WHEN_CREATED"
from "C_ADDENDUMS"
where "MECKEY_FK" = :P60_MECKEYIs that what you're trying to do?
Doug -
Invalid relational operator error
Dear All,
When i try to run the below query i am getting Invlid relational operator. Please help me on the below issue
Declare
lv_number VARCHAR2(2000);
lv_count NUMBER;
BEGIN
For I IN (select emp_no from emp where rownum < 2) Loop
lv_number := ',' ||i.emp_no||lv_number;
ENd Loop;
dbms_output.put_line(substr(lv_number,2));
lv_number := ' IN ( '|| substr(lv_number,2)|| ')';
dbms_output.put_line(lv_number);
select Count(1)
INTO lv_count
FROM emp
where emp_no|| lv_number ;
-- The above logic written to achive my requirement
END ;You need to use dynamic SQL:
Declare
lv_number VARCHAR2(2000);
lv_count NUMBER;
BEGIN
For I IN (select empno from emp where rownum < 2) Loop
lv_number := ',' ||i.empno||lv_number;
ENd Loop;
dbms_output.put_line(substr(lv_number,2));
lv_number := ' IN ( '|| substr(lv_number,2)|| ')';
dbms_output.put_line(lv_number);
EXECUTE IMMEDIATE 'select Count(1)
FROM emp
where empno' || lv_number
INTO lv_count;
dbms_output.put_line('COUNT = ' || lv_count);
END;
7369
IN ( 7369)
COUNT = 1
PL/SQL procedure successfully completed.
SQL> SY. -
Using regexp_instr in a where clause - invalid relational operator
Whey I try to run this query in TOAD I get an ORA-00920: invalid relational operator error. It's part of a 10g stored procedure. When I highlight it and run it it prompts me for the missing values and then the error pops up. The AND in line 4 is highlighted.
select CRIME_CLASSIFICATION_ID, crime_type, nvl(count(CRIME_CLASSIFICATION_ID),0) as CRIMECNT
From vaps.vw_offenses
where regexp_instr(valoc,to_char(location_id))
AND ( fromdate is null or
offense_date between to_date(fromdate, 'mm/dd/yyyy') AND to_date(todate,'mm/dd/yyyy')
group by crime_classification_id, crime_typeHi,
Review what REGEXP_INSTR does: it returns a NUMBER.
Your WHERE clause couldn't make any sense if you used any other kind of NUMBER expression in that place, e.g. a NUMBER literal such as 12:
select CRIME_CLASSIFICATION_ID, crime_type, nvl(count(CRIME_CLASSIFICATION_ID),0) as CRIMECNT
From vaps.vw_offenses
where 12 -- This is obviously wrong
AND ( fromdate is null or
offense_date between to_date(fromdate, 'mm/dd/yyyy') AND to_date(todate,'mm/dd/yyyy')
group by crime_classification_id, crime_type
It's not going to work any better with a function (like REGEXP_INSTR) that returns a NUMBER.
How can you fix it? That depends on what you want to do. Why are you calling REGEXP_INSTR? What is that condition checking?
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Error: ORA-00920: invalid relational operator (WWV-16016)
Hi,
When I try to query in the form, I'm getting the following error
An unexpected error occurred: ORA-00920: invalid relational operator (WWV-16016).
The form has a field of type varchar2 with lov attached to it. This error is happening only if I enter characters more than 40 or select a value which has more than 40 characters from the lov.
Anbody had this problem?..Is there a solution for this?..Help would be appreciated.
Thanks
PJI figured out the problem and it seems like if the value has any 'IN' or 'BETWEEN' and try to query this error is happening and it's not because of character length. I think Portal assumes that relational operator is entered and tries to query based on those words. Is it a bug in the Portal?..
Thanks
PJ -
Passing Relational operator along with input
Hi friends
I have a procedure
get_emp_list(p_sal in varchar2
p_out out sys_refcursor)
as
begin
open p_out
for
select * from emp
where sal (=,<,>) p_sal;
end;
Friends pls help me in writing the query,
The input will be like <1000 or >1000 or =1000.
Relational operator will be passed as a input in p_sal
I have to take the output based on the input values.
Pls give me any tips
Rajeshor more accurately as per your requirements...
procedure get_emp_list(p_sal in varchar2, p_out out sys_refcursor) as
begin
open p_out for
select * from emp
where (substr(p_sal,1,1) = '=' and sal = to_number(substr(p_sal,2)))
or (substr(p_sal,1,1) = '<' and sal < to_number(substr(p_sal,2)))
or (substr(p_sal,1,1) = '>' and sal > to_number(substr(p_sal,2)));
end;However this assumes the operator will only be a single character so you'll have to alter accordingly if you want to deal with <=, >= etc. -
Sir,
This is srinivas from India
Recently I started working with Objects in Pl/SQL
I am facing problem with table operator in pl/sql
my Query is
Select s.rollno,s.Name,column_value from student s,table(marks)
above query working fine in at SQL Prompt
but the same thing if I am trying to use at Cursors in PL/SQL it is giving error
please suggest me how to use Table operator in PL/SQL
student
srinivasI suggest you post your problem to the Products->Database->SQL/PLSQL discussion Forum.
This Forum is meant for the Apple Macintosh OS. -
Case with where clause - ORA-00920: Invalid relational operator
Hi All, when I try to run the query below, I get the following error...
ORA-00920: invalid relational operator
00920. 00000 - "invalid relational operator"
*Cause:
*Action:
Error at Line: 16 Column: 5
Does anyone know what's wrong with my query? thanks in advance.
SELECT concat (year,period)
FROM DD_ACTUALS_FACT
WHERE CASE Period
WHEN 'JAN' THEN '01'
WHEN 'FEB' THEN '02'
WHEN 'MAR' THEN '03'
WHEN 'APR' THEN '04'
WHEN 'MAY' THEN '05'
WHEN 'JUN' THEN '06'
WHEN 'JUL' THEN '07'
WHEN 'AUG' THEN '08'
WHEN 'SEP' THEN '09'
WHEN 'OCT' THEN '10'
WHEN 'NOV' THEN '11'
WHEN 'DEC' THEN '12'
END as "MonthNo"
ORDER BY CONCAT (year,"MonthNo") DESCThe problem is the as "MonthNo" - you can't give an "AS" alias to an expression in a where clause.
You have not actually given any condition, just a set of translations from period into a number.
You also haven't said what you're trying to do.
Perhaps you want:
SELECT concat (year,period)
FROM DD_ACTUALS_FACT
WHERE something
ORDER BY CONCAT (year, CASE Period
WHEN 'JAN' THEN '01'
WHEN 'FEB' THEN '02'
WHEN 'MAR' THEN '03'
WHEN 'APR' THEN '04'
WHEN 'MAY' THEN '05'
WHEN 'JUN' THEN '06'
WHEN 'JUL' THEN '07'
WHEN 'AUG' THEN '08'
WHEN 'SEP' THEN '09'
WHEN 'OCT' THEN '10'
WHEN 'NOV' THEN '11'
WHEN 'DEC' THEN '12'
END ) DESC -
Validate related invoices from pl/sql?
Hello,
Does anybody know how to run "validate related invoices" from pl/sql?
thanks in advance!You can use WWCTX_API.SET_CONTEXT - this is documented in the
PLSQL PDK. -
Relational operator LIKE is not supported.
Hi friends,
I am trying to write a routine in bw. I am using LIKE pattern.
But it is giving the below error.
"E:Relational operator "LIKE" is not supported."hi,
can you post your code and mention what do you want to achieve?
thanks
ec -
String. Relational operator and odd printing
Hi,
I'm wondering if someone could help me with this puzzlement I have. I've search the forum and I search the tutorial with "string and relation operator" and "string and compare" but I couldn't find any answer.
Basically, I want to make sure that we can't use "<", ">", ">=", and "<=" between two strings because I got compiler error. Tutorial only says to use equals() method but I can't find anything that says "Don't use relational operator such as... !"
Another question I have is I have this test code just to know String more.
<code>
public class Test {
static void compare (String s1, String s2) {
System.out.println ("s1 is = " + s1);
System.out.println ("s2 is = " + s2);
System.out.println (s1 + " == " + s2 + s1==s2); //this line prints "false"
System.out.println (s1 + " != " + s2 + s1!=s2); //this line prints "true"
System.out.println ("s1.equals(s2): " + s1.equals(s2));
public static void main (String args[]) {
compare ("Hello", "huhaha");
compare ("Hello", "hello");
compare ("Hello", "Hello");
</code>
I'm wondering why the line that I commented prints "false" and "true" where I expected to print the value of s1 which is "Hello" and s2 which is "huhaha"?
Sorry if the question seems stupid. I do admit I'm a little slow.
Thank you!This question is asked all the time on this forum.
Basically, the "==" operator between any two Objects (Strings included) is comparing instances. That is, are the two Objects references to the same "real" instance? If so, it will return true. However, just because two Strings contain the same value does not mean they are the exact same instance. So two different strings which contain the value "XXX" could still have "==" return false. For this reason, it is recommended that (in general) you use "==" and "!=" as it relates to Objects only when comparing them to null (there is only one null).
Instead, use the "equals()" method. There are no "<", "<=", ">", or ">=" operators in relation to Objects. Instead, use the Object's compare() method, if available (which it is for Strings).
Maybe you are looking for
-
How to create a game. Basic steps.
So, just browsing through these forums, I see many posts by prospective game designers wanting to get started. But many of these questions are so ill-researched or off basis that most people don't even know how to respond. So here's a quickie guide o
-
Internet Sharing & Home Sharing
I have a MacBook Pro sharing hotel Ethernet over wifi. Meaning the machine is serving as a wifi router because the wifi here is completely choked by all the people using it....but Ethernet is blazing fast..so I'm making my own wifi. One interesting
-
Connection TimeOut in Websphere App Server.
Hi, I am using JSF with JNDI and WebSphere to get query details. We have set the Connection Pooling Timeout in JNDI DataSource settings in WebSphere to 60 minutes. I have attached the Exception Stack Trace for your verification. This is a very seriou
-
Hi Experts, I am unable to clear an open item partially using payment lot when I give only the print doc number in selection value -it goes into postprocess. However, when I provide the total open amount it gets cleared.If I give the document number
-
Exception Handling of Screenflows inside Processes
Greetings, We are currently encountering a problem where some unhandled Exceptions are not being caught in our BPM application. Whenever an exception occurs inside a process, BPM has provided a way of handling those exceptions by using the "Process E