Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

REWRITE FUNCTION for NON-ANSI to ANSI SQL help/source?

3 posts in General Discussion Last posting was on 2003-01-22 16:21:48.0Z
woods_travis Posted on 2003-01-21 18:40:35.0Z
From: woods_travis@hotmail.com
Date: Tue, 21 Jan 2003 13:40:35 -0500
Newsgroups: ianywhere.public.general
Subject: REWRITE FUNCTION for NON-ANSI to ANSI SQL help/source?
Message-ID: <0D8002F96850D1D3006697D585256CB5.006697E585256CB5@webforums>
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:276
Article PK: 2098

hello.

i am a java programmer who has alot of code that i wrote non-ansi based sql
in. i was in the midst of attempting to write a converter that i could put
in between my code and my database that would convert non-ansi SQL to ansi
sql. i have been using freeware databases, because i dont make money off of
my sites.... i basically code for friends and try to do some community
service help with it.

is there a way to look at the code (since it appears alot of sybase
functions are written in C and/or Java) that performs the REWRITE/ANSI
conversion? that function covers nearly everything i could ever need
(mainly converting outer joins... but my outer joins have (+) instead of *
by the = sign, so i would have to modify a function)...

does anyone have any similiar functions/methods i could mimic or that i
would find useful?

thanks in advance for your replies.

basically- I am looking for code that would help me with outer join
rewrites from non-ansi to ansi... it will be a much longer process to write
without the help of someone that has alread stepped on the landmines :(

travis


Glenn Paulley Posted on 2003-01-22 16:21:48.0Z
Message-ID: <3E2EC51C.6070105@ianywhere.com>
Date: Wed, 22 Jan 2003 11:21:48 -0500
From: Glenn Paulley <paulley@ianywhere.com>
Reply-To: paulley@ianywhere.com
Organization: iAnywhere Solutions
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: Re: REWRITE FUNCTION for NON-ANSI to ANSI SQL help/source?
References: <0D8002F96850D1D3006697D585256CB5.006697E585256CB5@webforums>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Newsgroups: ianywhere.public.general
Lines: 48
NNTP-Posting-Host: 172.31.141.207
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:269
Article PK: 2087

In ASA version 8, you can use the REWRITE function with the ANSI
parameter, that converts TSQL outer joins to ANSI syntax. This doesn't,
of course, handle ORACLE outer joins - by the way, there's no guarantee
that simply replacing '+' with '*' and running the query in ASE will
return the same results as in ORACLE.

I don't have any knowledge of any standalone code that will do the
conversion.

Glenn

woods_travis@hotmail.com wrote:

>hello.
>
>i am a java programmer who has alot of code that i wrote non-ansi based sql
>in. i was in the midst of attempting to write a converter that i could put
>in between my code and my database that would convert non-ansi SQL to ansi
>sql. i have been using freeware databases, because i dont make money off of
>my sites.... i basically code for friends and try to do some community
>service help with it.
>
>is there a way to look at the code (since it appears alot of sybase
>functions are written in C and/or Java) that performs the REWRITE/ANSI
>conversion? that function covers nearly everything i could ever need
>(mainly converting outer joins... but my outer joins have (+) instead of *
>by the = sign, so i would have to modify a function)...
>
>does anyone have any similiar functions/methods i could mimic or that i
>would find useful?
>
>thanks in advance for your replies.
>
>basically- I am looking for code that would help me with outer join
>rewrites from non-ansi to ansi... it will be a much longer process to write
>without the help of someone that has alread stepped on the landmines :(
>
>travis
>
>
>

--
Glenn Paulley
Research and Development Manager, Query Processing
iAnywhere Solutions Engineering

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer


Robert Waywell Posted on 2003-01-22 16:18:31.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <0D8002F96850D1D3006697D585256CB5.006697E585256CB5@webforums>
Subject: Re: REWRITE FUNCTION for NON-ANSI to ANSI SQL help/source?
Date: Wed, 22 Jan 2003 11:18:31 -0500
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <2VT$ASjwCHA.351@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:270
Article PK: 2088

I would approach this by doing a search and replace to change the (+) to the
appropriate *= or =* and then run the statements through the REWRITE
function. Keep in mind that there are some statements that the REWRITE
function will not be able to convert because they will be ambiguous. That
set of statements will require you to rewrite them by hand.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

<woods_travis@hotmail.com> wrote in message
news:0D8002F96850D1D3006697D585256CB5.006697E585256CB5@webforums...
> hello.
>
> i am a java programmer who has alot of code that i wrote non-ansi based
sql
> in. i was in the midst of attempting to write a converter that i could put
> in between my code and my database that would convert non-ansi SQL to ansi
> sql. i have been using freeware databases, because i dont make money off
of
> my sites.... i basically code for friends and try to do some community
> service help with it.
>
> is there a way to look at the code (since it appears alot of sybase
> functions are written in C and/or Java) that performs the REWRITE/ANSI
> conversion? that function covers nearly everything i could ever need
> (mainly converting outer joins... but my outer joins have (+) instead of *
> by the = sign, so i would have to modify a function)...
>
> does anyone have any similiar functions/methods i could mimic or that i
> would find useful?
>
> thanks in advance for your replies.
>
> basically- I am looking for code that would help me with outer join
> rewrites from non-ansi to ansi... it will be a much longer process to
write
> without the help of someone that has alread stepped on the landmines :(
>
> travis
>