dbTalk Databases Forums  

invalid relational error, please help

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss invalid relational error, please help in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Totti
 
Posts: n/a

Default Re: invalid relational error, please help - 01-05-2008 , 08:23 AM






to be honest, you both were right, as Shakespeare mentioned the IN was
not there and as charles ALWAYS points rightly to the problem, i hadnt
the purch in the from clause.
thank you all men , i hope someday i ll be an expert and able to help
people as you are helping here.
thans a lot;

Reply With Quote
  #22  
Old   
Charles Hooper
 
Posts: n/a

Default Re: invalid relational error, please help - 01-05-2008 , 08:30 AM






On Jan 5, 5:11*am, "shakespeare" <what... (AT) xs4all (DOT) nl> wrote:
Quote:
"Totti" <saliba.toufic.geo... (AT) gmail (DOT) com> schreef in berichtnews:497200a1-e933-418b-a5c1-db8d2b28141f (AT) e10g2000prf (DOT) googlegroups.com...
hi all i am having the following error :

ORA-00920 invalid relational operator

i read the quotes of other people who had the same problem but i didnt
understand how this ties to my situation, since it is about memory and
relative things, since the formula when working with other tables in
my DB shows no problems at all;

the formula is the following :

SELECT TO_CHAR(purinv.Inv_Date,'mm')
MONTH ,TO_CHAR(purinv.Inv_Date,'YYYY') YEAR,
SUM(DECODE(PROD.category,'Special',prod.unit_price * sales.qty , 0))
AS "Special",
SUM(DECODE(PROD.category,'Base',prod.unit_price * sales.qty , 0)) AS
"Base",
SUM(DECODE(PROD.category,'Common',prod.unit_price * sales.qty , 0)) AS
"Common"
from prod, sales, purinv
where sales.prod_code = prod.code and Prod.category ('Special',
'Base', 'Common')
and purch.inv_code = purinv.code
group by
TO_CHAR(purinv.Inv_Date,'mm') ,TO_CHAR(purinv.Inv_Date,'YYYY')
order by TO_CHAR(purinv.Inv_Date,'YYYY'),TO_CHAR(purinv.Inv _Date,'mm')

any help appreciated

and Prod.category ('Special',

'Base', 'Common')

is also suspect, unless it is a boolean function.
I guess you meant and Prod.category IN ('Special',

'Base', 'Common')

Shakespeare
Thanks for pointing out the missing "IN", which is very likely the
source of the Invalid Relational Operator error. Oracle had not yet
returned the error message "Error: ORA-00904: "purch"."inv_code":
invalid identifier".

To the OP: it is often helpful to place only one WHERE clause item on
each line, and also do the same in the SELECT clause, as Oracle will
often help pinpoint the line triggering the syntax error.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.


Reply With Quote
  #23  
Old   
Charles Hooper
 
Posts: n/a

Default Re: invalid relational error, please help - 01-05-2008 , 08:30 AM



On Jan 5, 5:11*am, "shakespeare" <what... (AT) xs4all (DOT) nl> wrote:
Quote:
"Totti" <saliba.toufic.geo... (AT) gmail (DOT) com> schreef in berichtnews:497200a1-e933-418b-a5c1-db8d2b28141f (AT) e10g2000prf (DOT) googlegroups.com...
hi all i am having the following error :

ORA-00920 invalid relational operator

i read the quotes of other people who had the same problem but i didnt
understand how this ties to my situation, since it is about memory and
relative things, since the formula when working with other tables in
my DB shows no problems at all;

the formula is the following :

SELECT TO_CHAR(purinv.Inv_Date,'mm')
MONTH ,TO_CHAR(purinv.Inv_Date,'YYYY') YEAR,
SUM(DECODE(PROD.category,'Special',prod.unit_price * sales.qty , 0))
AS "Special",
SUM(DECODE(PROD.category,'Base',prod.unit_price * sales.qty , 0)) AS
"Base",
SUM(DECODE(PROD.category,'Common',prod.unit_price * sales.qty , 0)) AS
"Common"
from prod, sales, purinv
where sales.prod_code = prod.code and Prod.category ('Special',
'Base', 'Common')
and purch.inv_code = purinv.code
group by
TO_CHAR(purinv.Inv_Date,'mm') ,TO_CHAR(purinv.Inv_Date,'YYYY')
order by TO_CHAR(purinv.Inv_Date,'YYYY'),TO_CHAR(purinv.Inv _Date,'mm')

any help appreciated

and Prod.category ('Special',

'Base', 'Common')

is also suspect, unless it is a boolean function.
I guess you meant and Prod.category IN ('Special',

'Base', 'Common')

Shakespeare
Thanks for pointing out the missing "IN", which is very likely the
source of the Invalid Relational Operator error. Oracle had not yet
returned the error message "Error: ORA-00904: "purch"."inv_code":
invalid identifier".

To the OP: it is often helpful to place only one WHERE clause item on
each line, and also do the same in the SELECT clause, as Oracle will
often help pinpoint the line triggering the syntax error.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.


Reply With Quote
  #24  
Old   
Charles Hooper
 
Posts: n/a

Default Re: invalid relational error, please help - 01-05-2008 , 08:30 AM



On Jan 5, 5:11*am, "shakespeare" <what... (AT) xs4all (DOT) nl> wrote:
Quote:
"Totti" <saliba.toufic.geo... (AT) gmail (DOT) com> schreef in berichtnews:497200a1-e933-418b-a5c1-db8d2b28141f (AT) e10g2000prf (DOT) googlegroups.com...
hi all i am having the following error :

ORA-00920 invalid relational operator

i read the quotes of other people who had the same problem but i didnt
understand how this ties to my situation, since it is about memory and
relative things, since the formula when working with other tables in
my DB shows no problems at all;

the formula is the following :

SELECT TO_CHAR(purinv.Inv_Date,'mm')
MONTH ,TO_CHAR(purinv.Inv_Date,'YYYY') YEAR,
SUM(DECODE(PROD.category,'Special',prod.unit_price * sales.qty , 0))
AS "Special",
SUM(DECODE(PROD.category,'Base',prod.unit_price * sales.qty , 0)) AS
"Base",
SUM(DECODE(PROD.category,'Common',prod.unit_price * sales.qty , 0)) AS
"Common"
from prod, sales, purinv
where sales.prod_code = prod.code and Prod.category ('Special',
'Base', 'Common')
and purch.inv_code = purinv.code
group by
TO_CHAR(purinv.Inv_Date,'mm') ,TO_CHAR(purinv.Inv_Date,'YYYY')
order by TO_CHAR(purinv.Inv_Date,'YYYY'),TO_CHAR(purinv.Inv _Date,'mm')

any help appreciated

and Prod.category ('Special',

'Base', 'Common')

is also suspect, unless it is a boolean function.
I guess you meant and Prod.category IN ('Special',

'Base', 'Common')

Shakespeare
Thanks for pointing out the missing "IN", which is very likely the
source of the Invalid Relational Operator error. Oracle had not yet
returned the error message "Error: ORA-00904: "purch"."inv_code":
invalid identifier".

To the OP: it is often helpful to place only one WHERE clause item on
each line, and also do the same in the SELECT clause, as Oracle will
often help pinpoint the line triggering the syntax error.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.


Reply With Quote
  #25  
Old   
Charles Hooper
 
Posts: n/a

Default Re: invalid relational error, please help - 01-05-2008 , 08:30 AM



On Jan 5, 5:11*am, "shakespeare" <what... (AT) xs4all (DOT) nl> wrote:
Quote:
"Totti" <saliba.toufic.geo... (AT) gmail (DOT) com> schreef in berichtnews:497200a1-e933-418b-a5c1-db8d2b28141f (AT) e10g2000prf (DOT) googlegroups.com...
hi all i am having the following error :

ORA-00920 invalid relational operator

i read the quotes of other people who had the same problem but i didnt
understand how this ties to my situation, since it is about memory and
relative things, since the formula when working with other tables in
my DB shows no problems at all;

the formula is the following :

SELECT TO_CHAR(purinv.Inv_Date,'mm')
MONTH ,TO_CHAR(purinv.Inv_Date,'YYYY') YEAR,
SUM(DECODE(PROD.category,'Special',prod.unit_price * sales.qty , 0))
AS "Special",
SUM(DECODE(PROD.category,'Base',prod.unit_price * sales.qty , 0)) AS
"Base",
SUM(DECODE(PROD.category,'Common',prod.unit_price * sales.qty , 0)) AS
"Common"
from prod, sales, purinv
where sales.prod_code = prod.code and Prod.category ('Special',
'Base', 'Common')
and purch.inv_code = purinv.code
group by
TO_CHAR(purinv.Inv_Date,'mm') ,TO_CHAR(purinv.Inv_Date,'YYYY')
order by TO_CHAR(purinv.Inv_Date,'YYYY'),TO_CHAR(purinv.Inv _Date,'mm')

any help appreciated

and Prod.category ('Special',

'Base', 'Common')

is also suspect, unless it is a boolean function.
I guess you meant and Prod.category IN ('Special',

'Base', 'Common')

Shakespeare
Thanks for pointing out the missing "IN", which is very likely the
source of the Invalid Relational Operator error. Oracle had not yet
returned the error message "Error: ORA-00904: "purch"."inv_code":
invalid identifier".

To the OP: it is often helpful to place only one WHERE clause item on
each line, and also do the same in the SELECT clause, as Oracle will
often help pinpoint the line triggering the syntax error.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.