× 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.



Hello Phil,

You wrote:
>My goals for doing this are so that I will become comfortable with C.
>Otherwise I'd just do this in RPG!

I think the only people who are truly comfortable with C are those who
learned it as their first serious programming language.  Anyone who has
used PL/1, COBOL, RPG, FORTRAN or anything else with fixed-length field
support and a wider range of numeric data types than simply integer and
floating point is never comfortable with C -- it's too limiting unless you
write or buy library functions to compensate for the languages natural
short-comings.  K&R did the programming community a serious disservice by
developing C.

>I figured out that I was incorrectly using STRCPY.

Good.

>I am intrigued with using embedded sql (not the SQL CLI api's).  Can you
>point me to any documentation for doing that in C?  I haven't been able to
>find ANY.  I use embedded sql in RPG all the time, and if I can use it
>successfully in both C and RPG that would be great.  And I wouldn't have
>to figure out how to use _Rlocate (which is what I'm trying to figure out
>now).

Since I am always guilty of telling people to RTFM I should at least be
able to find the appropriate FM, shouldn't I?  :-)

The manual you want is the SQL Programming with Host Languages manual.
Chapter 1 describes the environment and syntax.  Appendix D has example
programs.  This manual is hidden in the Disinformation Centre under the
Database and File Systems section.  Follow the Books (HTML and PDF format)
link.

Embedded SQL in C is very similar to RPG.  The SQL statements are the same
but other things are different due to the different semantics of each
language.  For example:

        o Use EXEC SQL instead of /EXEC SQL
        o C does not need END-EXEC statements because the semi-colon ends
multi-line statements
        o C requires host variables to be declared within a BEGIN DECLARE
block but RPG does not.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/

   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.