help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: from ms access SQL syntax to SQL Server SQL sysntax


From: Hans Aberg
Subject: RE: from ms access SQL syntax to SQL Server SQL sysntax
Date: Fri, 6 Jun 2003 23:12:27 +0200

At 20:27 +0200 2003/06/06, Luis Hernandez wrote:
>We already have a utility that converts MS Access SQL statements to
>Oracle. It is written in VC++ and Bison. Now, I have to add support to
>SQL Server. The code is complex so I'm trying to avoid coding. Accuracy?
>It has to work.

You might try to tweak it. If you say that it already reads MS Access SQL
and only wants to change the output from Oracle to SQL Server you perhaps
only have to tweak the actions in the Bison .y grammar. What you have to do
depends how the output code is generated.

Bison itself, in order to support multiple language output, was added with
the M4 macro processor. If many output languages or the programming might
become complicated, you might consider adding such a macro processor for
output. Then, instead of writing a complete file output, you merely output
a series of macro outputs. Then that is picked together by another via
another skeleton file that you write which your macro program (like M4)
processes.

>>From (Jet):    SELECT Choose (T1.SurceType, T1.Name, T2.Name)  FROM
>Table1
>>T1, Table2 T2
>>
>>
>>To (SQLServer):  SELECT Case (T1.SurceType WHEN 1 THEN T1.Name WHEN 2
>THEN
>>T2.Name) FROM Table1 T1, Table2 T2
>>
>>
>>If you know one, let me know please.

It looks as though the changes in the output code are rather minor. So
perhaps if you look at the .y actions outputting the translation, you might
be able to get away with not so much tweaking.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]