users are getting below error when using the scripts tab in toad for viewing the ddl of a table in toad.
-- Permissions are absent in the script due to errors.
-- See exception log for details.
Entries from exception log:
New exception: 6/23/2026 9:24:55 AM
IBM.Data.DB2.DB2Exception: ERROR [42815] [IBM][DB2/LINUXX8664] SQL0171N The statement was not processed because the data type, length or value of the argument for the parameter in position "1" of routine "SYSIBM.HEX" is incorrect. Parameter name: "".
Stack trace:
at IBM.Data.DB2.DB2Command.ExecuteReaderObject(CommandBehavior behavior, String method, DB2CursorType reqCursorType, Boolean abortOnOptValueChg, Boolean skipDeleted, Boolean isResultSet, Int32 maxRows, Boolean skipInitialValidation)
at IBM.Data.DB2.DB2Command.ExecuteReaderObject(CommandBehavior behavior, String method)
at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior)
at IBM.Data.DB2.DB2Command.ExecuteReader()
at Quest.Compare.Schema.DB2.DBModel.CNS2Connection.ExecuteReader(String& sQuery, SortedList slParameters, Int32 nTimeout, IDbCommand& iCommand)
Outer exception:
System.ApplicationException: ERROR [42815] [IBM][DB2/LINUXX8664] SQL0171N The statement was not processed because the data type, length or value of the argument for the parameter in position "1" of routine "SYSIBM.HEX" is incorrect. Parameter name: "".
Query:
SELECT
CASE t.type
WHEN 'T' THEN CASE WHEN EXISTS ( SELECT 1 FROM syscat.tabdep td WHERE td.tabschema = t.tabschema AND td.tabname = t.tabname AND td.btype = 'S' )
THEN 'Staging' ELSE 'Base' END WHEN 'U' THEN 'Typed' WHEN 'G' THEN 'GlobalTemporary'
ELSE 'Query' END AS db2tabletype,
t.*,
sp.secpolicyname,
case hex(substr(st.packed_desc, 294, 1)) when '31' then 'Y' else 'N' end as NOT_LOGGED,
fo.DATAFILE, et.BADFILE, et.BOOLSTYLE, et.DATEDELIM, et.DATESTYLE,
et.DECIMALDELIM, et.ENCODING, et.ETID, et.FIELDDELIM, et.FORMAT,
et.ISCOMPRESS, et.ISCRINSTRING, et.ISCTRLCHARS, et.ISESCAPE, et.ISFILLRECORD,
et.ISIGNOREZERO, et.ISINCLUDEHEADER, et.ISINCLUDEZEROSECONDS, et.ISTIMEROUNDNANOS,
et.ISTRUNCSTRING, et.LOGFILE, et.LOGPATH, et.MAXERRORS, et.MAXROWS,
SYSIBM.RTRIM(et.NULLVALUE) as NULLVALUE, et.PACKED_DESC, et.QUOTEDVALUE,
SYSIBM.RTRIM(et.RECDELIM) as RECDELIM, et.RECORDLENGTH, et.REMOTESOURCE, et.REQUIREQUOTES,
et.SKIPROWS, et.SOCKETBUFSIZE, et.TIMEDELIM, et.TIMESTYLE, et.Y2BASE,
hi.super_schema, hi.super_name, csh.tabschema AS hierarchy_schema, csh.tabname AS hierarchy_name
FROM syscat.tables t
LEFT OUTER JOIN syscat.hierarchies hi ON hi.sub_schema = t.tabschema AND hi.sub_name = t.tabname AND hi.metatype = t.type
LEFT OUTER JOIN syscat.columns csh ON csh.source_tabschema = t.tabschema AND csh.source_tabname = t.tabname AND csh.hidden = 'S'
AND csh.colname = 'TYPE_ID'
LEFT OUTER JOIN syscat.securitypolicies sp ON sp.secpolicyid = t.secpolicyid
LEFT OUTER JOIN sysibm.systables st on st.name = t.tabname and st.creator = t.tabschema
LEFT OUTER JOIN sysibm.sysexttab et on t.TABLEID = et.ETID
LEFT OUTER JOIN sysibm.sysexttabfileobj fo on t.TABLEID = fo.ETID
WHERE t.type IN ('T', 'U', 'S', 'G')
AND (t.tabschema = 'test' AND t.tabname = 'FT_CLT_ACCT_REVN_MTH')
FOR READ ONLY WITH UR
Stack trace:
at Quest.Compare.Schema.DB2.DBModel.CNS2Connection.ExecuteReader(String& sQuery, SortedList slParameters, Int32 nTimeout, IDbCommand& iCommand)
at Quest.Compare.Schema.DB2.DBModel.CNS2Loader.DirectExtractFromDB(CNS2Database oDb, CNSPLProgress plProgress, LimitationsPack packLimitations)
Tried the same query from putty and got same error.
Database was recently restored from db2 warehouse 11.5 to 12.1 db2 database on db2u operator. After the migration users are facing this error.