|
Been thinking.
Look at QSYS2.SYSTABLES to get the list of tables. Build an SQL statement
based on that list. Would not need a view, just process that results in
the program.
On Fri, Jul 12, 2024 at 4:12 PM Javier Sanchez <
javiersanchezbarquero@xxxxxxxxx> wrote:
Sorry, in SQLRPGLE you would have to write a logic to add every tableyou
separately, that's why I said you can ignore the error if it's not found.
El vie, 12 jul 2024 a las 15:08, Javier Sanchez (<
javiersanchezbarquero@xxxxxxxxx>) escribió:
You can always write a CONTINUE HANDLER for an SQL error/exception if
calleddon't find any of the tables needed, and if you write it in an embeddedthere.
SQLRPGLE program you simply ignore the error and you will get what is
HTH
JS
El vie, 12 jul 2024 a las 14:33, K Crawford (<kscx3ksc@xxxxxxxxx>)
escribió:
I have a series of tables that are created to archive tables, the max
number of archive tables is 999. These tables exist in a library
000.ARCHIVE. When a new table needs to be archived the process is to
increment
the table number by one and drop off 999. The new table is number
listhaveThe list would look like this:
ETBL000
ETBL001
ETBL002
.
.
.
ETBL997
ETBL998
ETBL999
I have a program that reads each of the tables searching for a string.
The
overhead of open/close is making it slower than the users like.
I am thinking about creating a view like this.
create or replace view archive.v@etbl_0
as (
select '000' as TblNumber, e.* from archive.etbl000 e
Union all
select '001' as TblNumber, e.* from archive.etbl001 e
Union all
select '002' as TblNumber, e.* from archive.etbl002 e
.
.
.
Union all
select '997' as TblNumber, e.* from archive.etbl997 e
Union all
select '998' as TblNumber, e.* from archive.etbl998 e
Union all
select '999' as TblNumber, e.* from archive.etbl997 e
)
RCDFMT v@etbl_0R
;
Downside to this is that writing the view will be a pain. but I only
relatedto do it once.
Another gotcha is that it is possible that a table may not exist. For
example etbl002 may have gotten deleted. This should make the SQL
statement fail.
Anyone have any better ideas?
--
Kerwin Crawford
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
--questions.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
Kerwin Crawford
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
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.