Tuesday, March 20, 2012

changing SQL syntax

I am using MS SQL Server 2000.
I am using a java component which generates SELECT statements based on
different critieria. The SELECT statements generated are using the old SQL
syntax. For example it will generate :
SELECT e.employee_id, er.location_code
FROM employee e, employee_record er
WHERE e.employee_id = er.employee_id
What I would like is to get this SELECT statement as :
SELECT e.employee_id, er.location_code
FROM employee e INNER JOIN employee_record er ON (e.employee_id =
er.employee_id)
Now in Enterprise Manager if i create a new view and type in the old SQL
syntax, and see the result, it automatically changes it to new SQL syntax. I
would like to call that functionality from my code after I have received the
SELECT statement from the java component. Is it possible?
Thanks
Rizwan>> I would like to call that functionality from my code after I have
I guess no. It might be an internal parsing/tokenizing routine within the EM
interface & it seems unreasonable to expect some external application have
access to such internal routines.
Anith|||1) Why are you generating SQL instead of calling stored procedures?
2) Why do you care what the genrerated coee looks like anyway? They
run the same!

No comments:

Post a Comment