Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing expression error in application used to submit SQL but when works fine in SQL Developer

When I wrote the code below in Oracle SQL Developer it works fine, when pasting this code into Webwise a tool we use to create reports, it errors saying missing experession? We usually just copy and paste the code and it works fine...

Code is :

select o.wh_id, 
       o.bill_to_code,
       (case when d.pick_area like 'GPS%' then 'GPS' 
             else d.pick_area
       end) as pick_area,
       count(*) as OUC
  from t_order o 
       INNER JOIN
       t_pick_detail d
         on o.order_number = d.order_number
 where o.wh_id = '~wh_id~'
group by o.wh_id, 
         o.bill_to_code,
         (case when d.pick_area like 'GPS%' then 'GPS' 
               else d.pick_area
         end)
order by o.bill_to_code;
like image 340
user3095083 Avatar asked Apr 01 '15 10:04

user3095083


People also ask

What does it mean by missing expression error in SQL?

All that 'missing expression' means is that When attempting to operate a query, a particular part of the clause necessary for it to function was omitted in the text. Stated simply, you left out an important chunk of what you were trying to run.

How do you resolve ORA 00936 missing expression?

Action: Check the statement syntax and specify the missing component. The ORA-00936 happens most frequently: 1 - When you forget list of the column names in your SELECT statement.

How do I find the compilation error in SQL Developer?

control-shift-L should open the log(s) for you. this will by default be the messages log, but if you create the item that is creating the error the Compiler Log will show up (for me the box shows up in the bottom middle left).


1 Answers

To finalize this post, Remove the ';' to ensure it works.

As an added note. The underlying mechanism that actually runs your SQL may have a different interpreter and in some cases, this will cause issues. When dealing with various tools that interact with the same platform, ensure syntax is correct per the documentation of that system.

like image 79
David Crook Avatar answered Oct 20 '22 00:10

David Crook