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



That... but I was actually more surprised about the use of an SQL query to answer the question. The first inquiry is odd... for the assumption that there must be only one file in the *SYSBAS or across the iASP and *SYSBAS; e.g. there is nothing to resolve the first file with that file name within the library list. If the input file name and library name had been the long names, then at least the SQL would provide something more than what directly a non-SQL request could effect without using the Retrieve Short Name (QDBRTVSN) API. If I wanted only to know if a 10-byte file name [in the library list or a 10-byte library name] was created by SQL DDL, then I would use the Retrieve Database File Description (QDBRTVFD) API.

Regards, Chuck

On 02 Sep 2013 04:33, Vernon Hamberg wrote:
I'm just curious - in daily operations, what does this matter? IOW,
what do you differently based on whether a file is a table or not?

On 8/30/2013 9:12 AM, Gene Burns wrote:
I have a service program to check this:



p CheckTableType...
p b export

d CheckTableType...
d pi 1a
d FilName 10a
d FilLib 10a options(*nopass)

d type s 1a
d sqlOK c '00000'

/free


exec sql
Set Option
Naming = *Sys,
Commit = *None,
UsrPrf = *User,
DynUsrPrf = *User,
Datfmt = *iso,
CloSqlCsr = *EndActGrp;

if %parms() = 1;
exec sql
select table_type into :type
from qsys2/systables
where system_table_name = :FilName;
else;
exec sql
select table_type into :type
from qsys2/systables
where system_table_name = :FilName and
system_table_schema = :FilLib;
endif;

if sqlstate <> sqlOK;
type = *blank;
endif;

return type;

/end-free


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.