Home » Other » Client Tools » SQL SYNTAX ON ORACLE SQL DEVELOPER (ORACLE SQL DEVELOPER VERSION 2.1.1.64)
SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471944] Wed, 18 August 2010 00:37 Go to next message
ayubx
Messages: 4
Registered: August 2010
Junior Member
Hi all ,

I am having an issue with the following query in Oracle SQL Developer connected to a SQL SERVER 2000 database ,

declare @loc varchar(4);
declare @logdate varchar(12);

set @loc = (select value from pg_system_config_det where name = 'LocationID')
set @logdate = '10-aug-10'

select
sum(LocalCurrency_Amount),
c.logical_date,
c.OpenAccount_Time,
c.CloseAccount_Time,
t.batch_no,
c.location_id
from
pg_cashier_login_det c ,
pg_trans_tender_det t
where
c.location_id = @loc
and c.logical_date = @logdate -- and '29-nov-09'
and t.location_id = c.location_id
and c.Cashier_login_id = t.Cashier_login_id
group by c.logical_date,c.location_id, t.batch_no,c.OpenAccount_Time,c.CloseAccount_Time
order by c.logical_date asc

Error messages
"Error starting at line 1 in command:"
and
"Invalid JDBC escape syntax at line position 19 '=' character expected"

This query works fine on MS SQL Query analyzer. I am not facing any issue with queries without variable declaration on SQL Developer. what could be wrong ?

Thanks



Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471945 is a reply to message #471944] Wed, 18 August 2010 00:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>This query works fine on MS SQL Query analyze
YES, but Oracle is not MS SQL
Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471950 is a reply to message #471945] Wed, 18 August 2010 00:47 Go to previous messageGo to next message
ayubx
Messages: 4
Registered: August 2010
Junior Member
the assumption here is Oracle SQL developer would accept MS SQL syntax when connected to a SQL SEerver 2000 database which is the case here.

suggestion please ?
Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471952 is a reply to message #471950] Wed, 18 August 2010 00:51 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>suggestion please ?
Change your assumption.
Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471954 is a reply to message #471952] Wed, 18 August 2010 00:56 Go to previous messageGo to next message
ayubx
Messages: 4
Registered: August 2010
Junior Member
changing the variable declaration to Oracle did not help. Thanks for the input
Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471955 is a reply to message #471954] Wed, 18 August 2010 00:57 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: SQL SYNTAX ON ORACLE SQL DEVELOPER [message #471956 is a reply to message #471955] Wed, 18 August 2010 01:00 Go to previous message
ayubx
Messages: 4
Registered: August 2010
Junior Member
Thanks. Will do.
Previous Topic: connect oracle developer 6i without connect string
Next Topic: Creating spool file dynamically
Goto Forum:
  


Current Time: Tue Apr 23 11:42:23 CDT 2024