× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 25 Apr 2003, E Doc wrote:

> 6.  SQL statements in /Free format, in a word, suck.  I cannot abide:
>
>  /Free
>   doMonkeyCount(inMonkey: outBanana );
>
>   if outBanana > squidgyNumber;
>
>  /End-Free
>
> C/Exec SQL
>  + INSERT INTO monkeyeat
>  +   VALUES(:outBanana)
> C/End-Exec
>
>  /Free
>
>     // Check SQL return code
>     if SQLSTTS = c_MYBAD;
>       handleSQLErr();
>     endif;
>
>     return outBanana;
>
>   endif;
>
>  /End-Free

What if you call dump embedded sql altogether and just call sql
statements?  For example, tell me if you like this any better (all code
here is free format):

   if outBanana > squidgyNumber;
     sql_run_statement('INSERT INTO monkeyeat VALUES(' +
                        %editc(outBanana:'3') + ')');

     // Check SQL return code
     if (sql_error());
       handleSQLErr();
     endif;

     return outBanana;
   endif;

How does that strike you?  These calls would probably also need an sql
cursor as one of the arguments. So then the sql_error() call would look
like:

        sql_error(cursor);

That way you could have multiple cursors open.  Those cursors could also
point to any machine, something like:

        cursor = sql_open_cursor(SERVER);

Now you would never leave the free format and the sql precompiler wouldn't
have to keep up with the rpg precompiler since it doesn't use embedded
sql.  Comments?

James Rich

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.