Relational Operator OR
I am trying to use the OR relational operator in a !Format field and my code only seems to be picking up the first part of the 'or' statement. Does anyone see anything wrong with this syntax, maybe I have just been looking at it for too long.
@(If ("@CHECK__PAY_CLS_CD."=="S1021"||"@CHECK__PAY_CLS_CD."=="S1226"||"@CHECK__PAY_CLS_CD."==" S1026", "changed", "@CHECK__PAY_CLS_CD."))
I would like to see the word "changed" printed if the value is equal to "S1021" or "S1226" or "S1026" currently it will only print the word "changed" if the first part is true, it doesn't seem to be checking the rest of the expression.
I'd appreciate any ideas anyone may have.
Thanks,
Kris
I'm using OR operator in my preambe coding and it works well. I'd like to use like this:
@(If((("@CHECK__PAY_CLS_CD."=="S1021") || ("@CHECK__PAY_CLS_CD."=="S1226") || ("@CHECK__PAY_C LS_CD."=="S1026")), "changed", "@CHECK__PAY_CLS_CD."))
Hope this can help.
Similar Messages
-
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 -
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 -
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. -
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 -
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). -
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 -
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 -
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> -
ORA 920 Relational operator missing
We are in a process of moving data from .txt file to staging table. Earlier we have conducted the same run many times and it was proper and successful. Today we tried the same but it ended in an error saying ORA-920.Relational operator missing.
We checked the colums there was no change in the mapping . It was as it as it was for previous runs.
Could u pls help me out of this.It would be really appreciable.
AniruddhaHi,
Could you copy the command from Operator here, please?
Cezar Santos
http://odiexperts.com -
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. -
The relational operator ==
Why the relational operator == does not work properly for comparing two objects of the same class?
yawmark wrote:
jverd wrote:
scphan wrote:
[http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.21.3]
Know what an object is and what a class is.And what a reference is.
And what actually gets stored in a variable.And how to make waffles. That's important, too.
No, seriously.
Not as important as knowing how to make apple pie...
Especially the required amount of rum in the filling is very important.
Maybe you are looking for
-
Trying to understand the B_EO_INBOUND_PARALLEL ?
Bonjour a tous et a toutes, We have 15 integrations scenarios. -> ¾ are Async (JMS / IDOC & IDOC / JMS) -> ¼ are Sync (JMS / RFC to CICS and return in JMS) We are trying to give priority to the Sync scenarios in order to avoid a timeout on the sende
-
How to inclease open_cursors in oracle?
Hi, someone give me hands,please. I want to change oracle parameter "open_cursors" from default value of it. Where is init.ora file in oracle 10g database? Let me know.
-
Burning my iMovie for tv viewing
My movie is all set - slides, video, music. Can I simply insert a DVD and drag it oer to burn it - or do I HAVE to bring it into iDVD - which leads me to further frustrations (I don't want the drop zone - I just want the movie!) Anyone who can help,
-
Updated iPhone 4s ios 6.1 App Store and iTunes is very slow sometimes does not open what to do?
-
Since installing Lion Adobe InDesign CS3 crashes when I print.
I upgraded to Lion yesterday and, now that I am at work, I find that InDesign CS3 (5.0.4) crashes when I print. It doesn't hang...it just pops. My printer drivers (for our Xerox WC7775, with Fiery) no longer work for my other applications (Word, BBEd