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



For single record access, using SQL will dramatically slow the program down.

On the SQLCOD vs. SQLSTT blurb, the issue isn't cross platform portability. The 
real issue is that SQLSTT's are a standard and SQLCOD's aren't. SQLSTT's are 
very unlikely to change but SQLCOD's do change from time to time. The last time 
I'm aware of a change was in going from V4R5 to V5R1.

Matt

-----Original Message-----
From: Carel Teijgeler [mailto:coteijgeler@xxxxxxxxx]
Sent: Friday, January 07, 2005 4:22 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Open/Close of Files


(Lost the original post of this threat.)

I was thinking about embedded SQL.

If it is possible to do an OPEN CURSOR/CLOSE CURSOR on an EXEC IMMEDIATELY SQL 
directive, then you may generate an OPEN/CLOSE SQL statement on the 
fly.Sommething like this (beware, I am not that familiar with embedded SQL):

P OpenFiles         B
D OpenFiles         PI                          N
D       CursorName                     18
D OpenStatement         S            56
D Error                         S                   N
C                         Eval   OpenStatement = 'OPEN ' + Cursorname
C+SQL EXEC IMMED :OpenStatement
C+END
C                          If         SQLCODE < 0
C                          Eval     Error = *ON
C                          EndIf
C                          Return error
P OpenFiles          E   

If this works, it will mean a rewrite of the programme with the SQL 
instructions in the right order for the (pre)compiler.

Just a thought.

Regards,
Carel Teijgeler

P.S. I know some will mention to test SQLSTATE instead, but I do not think this 
programme will be ported to another platform, will it?

*********** REPLY SEPARATOR  ***********

On 7-1-05 at 14:51 Jon Paris wrote:

>>> Could you write a subprocedure in CLLE using the OPNDBF command?
>
>That just opens the ODP - it won't help the RPG - it still needs to open
>the
>file.
>
>The only way I know to handle it via a pointer is to use the C record I/O
>APIs.
>
>As Bob noted earlier - sharing of files between modules in RPG "sucks".
>Even COBOL's EXTERNAL option is an improvement in many ways.
>



-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.