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



I have an SQL table function that runs DSPOBJD to an outfile and then
returns that outfile as the output of the table function. The table
function works. But I get an info message CPD000D - Command *LIBL/DSPOBJD
not safe for a multithreaded job.

What does that message mean exactly? Can I mark the table function to tell
the system it will be running single threaded code?

here is SQL that runs the table function:

select a.objname, a.objsize, a.crtdate
from table(sql_dspobjd('audrcv*','qgpl')) a
where a.crtdate < current date - 10 days

Here is the table function:
CREATE OR REPLACE FUNCTION sql_dspobjd(
inName char(10),
inLib char(10) default '*LIBL',
inObjType char(10) default '*ALL')
RETURNS table ( libName char(10),
objName char(10),
objType char(10),
objAttr char(10),
objSize decimal(10,0),
textdesc char(50),
locked char(1),
damaged char(1),
crtDate date )
language sql
modifies sql data
BEGIN

declare vSqlCode decimal(5,0) ;
declare sqlCode int ;
declare cmds varchar(2000) ;
declare cmdsLx decimal(15,5) ;

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
SET VSQLCODE = SQLCODE ;


-- run DSPPGMREF to outfile.
set cmds = 'dspOBJD obj(' || trim(INLib) || '/' ||
trim(inName) || ') objtype(' ||
trim(inObjType) || ') output(*outfile) ' ||
'outfile(qtemp/core0043o)' ;
set cmdsLx = length(trim(cmds)) ;
CALL QCMDEXC( cmds, cmdsLx ) ;


return
select a.odlbnm libName, a.odobnm objname,
a.odobtp objType, a.odobat objAttr,
a.odobsz objSize, a.odobtx textDesc,
a.odoblk locked, a.odobdm damaged,
date(timestamp_format(
case when a.odccen = '0' then '19' else '20' end
|| substr(a.odcdat,5,2) || substr(a.odcdat,1,4),
'YYYYMMDD')) crtDate
from qtemp/core0043o a ;

END

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.