PL/SQL -> Ada (summary)

From: Patrick Ryan <pat_at_chinook.halcyon.com>
Date: 1995/05/08
Message-ID: <3olno5$ial_at_news1.halcyon.com>


The consensus is that Ada is similar to PL/SQL but different enough to require alot of recoding. Ada is more rigorous in coding style. The data constructs allowed by PL/SQL would require retooling (sometimes *lots* of retooling.) One addition I would add is that the concept of cursor loops that gets used alot in PL/SQL has no direct counterpart in Ada.

My original posting was:

>My company is researching rewriting some code from PL/SQL version 2.0
>into a 3GL. My understanding is the PL/SQL and Ada are similar
>languages. I was wondering if:
 

>o Anyone has ever done a project like this and was willing to share
>their experiences with how long the conversion would take.
 

>o Anyone can confirm or deny the similarities between the two languages,
>even if you haven't tried to do such a project.
 

>I will compile responses and post them to the net. Please send me
>e-mail, even if you are posting a response.

The responses follow:

>>Date: Thu, 4 May 1995 02:13:06 GMT
>>From: SLOTT_at_news-feed.delphi.com
>>Message-Id: <199505040213.CAA10322_at_news2.delphi.com>
>>To: pat_at_halcyon.com
>>Subject: Re: PL/SQL 2.0 -> Ada
>>Newsgroups: comp.databases.oracle
>>
>>Having worked extensively in both PL/SQL and Ada, I will say that
>>the syntax is only vaguely similar. Once you start doing Embedded SQL
>>in Ada, you will see profound differences between PL/SQL and Embedded Ada.
>>
>>Whereas the PL/SQL designers borrowed the idea of a package, Ada takes
>>this much further.
>>
>>Also, Ada is very rigid in the type definition rules, but PL/SQL is very
>>flexible. A skilled PL/SQL programmer would struggle with Ada until
>>they "got the joke." Ada requires more careful design than most other
>>programming languages. Unlike, for example, C, Ada programs won't compile
>>if an array is indexed by a subtype different that the variable used
>>to acecss the array. In C integers are just integers. In Ada, all numbers
>>can be kept distinct from each other.
>>
>>I think you would be happier using your PL/SQL as detailed design and
>>rewriting it in whatever language you are most comfortable in. Or,
>>choose a language for ease in installation (i.e. C on most Unix platforms.)
>>
>>I don't want to sound negative on Ada--it is one of the finest programming
>>languages ever designed. However, it is much more subtle and sophisticated
>>than PL/SQL.
>>
>>S.Lott

>>From: Steven Whatley <swhatle_at_Starbase.NeoSoft.COM>
>>To: pat_at_halcyon.com (Patrick Ryan)
>>Subject: Re: PL/SQL 2.0 -> Ada
>>Newsgroups: comp.databases.oracle
>>
>>In article <3o60a0$7en_at_news1.halcyon.com> you wrote:
>>: My company is researching rewriting some code from PL/SQL version 2.0
>>: into a 3GL. My understanding is the PL/SQL and Ada are similar
>>: languages. I was wondering if:
>>
>>I have used Ada 83 and PL/SQL 1.0 & 2.0 extensively. I learned Ada
>>before PL/SQL and PL/SQL was a snap to learn. There are minor syntax
>>differences between Ada and PL/SQL. Ex: PL/SQL does not use a ":" in
>>variable declarations. PL/SQL supports named and positional parmaters.
>>The conversion sould be fairly simple but tedious.
>>
>>I recommend that you use Oracle's Pro*Ada pre-compiler. That wee you
>>can use the SQL statments as is by just adding the keywords EXEC SQL
>>in front of the statment. Also you will need to group all of the
>>variables which will be used with the SQL statmemts together in a special
>>declaration section for the pre-compiler. If these varibles are used in
>>a SQL statment they will need to be prefixed with a ':'. Finally you
>>will need to create error traps to catch Oracle exceptions such as
>>DATA_NOT_FOUND.
>>
>>BTW, did you know that TASK is a reserved word in PL/SQL? It isn't being
>>used for anything but it is reserved for future use.
>>
>>If you have any other questions. feel free to ask me.
>>
>>Later,
>>Steven

>>Date: Wed, 3 May 1995 05:54:22 GMT
>>From: tssmith_at_netcom.com (Tim Smith)
>>To: pat_at_halcyon.com
>>Subject: Re: PL/SQL 2.0 -> Ada
>>Newsgroups: comp.databases.oracle
>>
>>In comp.databases.oracle you write:
>>>o Anyone can confirm or deny the similarities between the two languages,
>>>even if you haven't tried to do such a project.
>>
>>I won't comment on projects, but yes, PL/SQL has some obvious external
>>similarities to Ada. The internal similarities are even more striking
>>(read up on Dianas, and you'll be prepared for a lot about PL/SQL
>>internals). The guy who designed PL/SQL was very up to date about
>>languages, I think (well, I know).
>>
>>--Tim (tssmith_at_netcom.com)
Received on Mon May 08 1995 - 00:00:00 CEST

Original text of this message