SET VAR1 =
'INSERT INTO MENTIS_SQLDB_METADATA '
||'(DB_NAME,TABLE_NAME,COLUMN_NAME,S_COLUMN_TYPE,MAX_ LENGTH,IS_NULLABLE) '
||'(select '''||DBNAME||''' as DB_NAME,TAB.NAME as TABLE_NAME,COL.NAME as '
||'COLUMN_NAME,COL.COLTYPE as S_COLUMN_TYPE,COL.LENGTH as MAX_LENGTH, '
||'COL.NULLS as IS_NULLABLE from SYSIBM.SYSTABLES TAB,SYSIBM.SYSCOLUMNS COL '
||'where TAB.CREATOR = '''||DBNAME||''' and TAB.NAME not like ''SYS%'' '
||'and TAB.CREATOR not like ''SYS%'' and '
||'TAB.type = ''T'' and COL.TBCREATOR=TAB.CREATOR)';