Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#20 SQLCOLUMNS Returns no columns

open
nobody
None
5
2008-09-10
2008-09-10
oorexxpert
No

Using REXXSQL 2.5 on Orcale 10. SQLCOLUMNS does not return any columns. All of the stem variables set have zero columns. In Oracle, we have a schema and a table name which should be all that is needed to access the columns. We have tried the schema name in the SQLCOLUMNS but it didn't work.

TESTCASE:

say "Loading REXXSQL";
call RXFuncAdd 'SQLLoadFuncs','rexxsql','SQLLoadFuncs';
Call SqlLoadFuncs;

say "Connecting.";
rc = sqlconnect(,"PINN_CUSTOM","iwise",,"ORCL-NEW");
say "Return code from SQLCONNECT =" rc;
if rc <> 0 then
exit;

say "";
say "Getting tables.";
rc = sqltables("T",,,"REQUEST");
say "Return code from SQLTABLES =" rc;
if rc <> 0 then
exit;
say "There are" t.~items "table items returned.";
do tx over t.;
say tx "is" t.tx;
end;

say "";
say "Getting columns.";
rc = sqlcolumns("C",,,"REQUEST");
say "Return code from SQLCOLUMNS =" rc;
if rc <> 0 then
say "Return code" rc "from SQLCOLUMNS";
say "There are" c.~items "column items returned.";
do cx over c.;
say cx "is" c.cx;
end;

RESULTS:

Loading REXXSQL
Connecting.
Return code from SQLCONNECT = 0

Getting tables.
Return code from SQLTABLES = 0
There are 15 table items returned.
TABLE_NAME.0 is 2
TABLE_TYPE.0 is 2
TABLE_NAME.2 is REQUEST
TABLE_NAME.1 is REQUEST
TABLE_OWNER.0 is 2
TABLE_TYPE.2 is TABLE
TABLE_CATALOG.0 is 2
TABLE_OWNER.2 is PINN_CUSTOM
TABLE_OWNER.1 is PINN_CUSTOM
TABLE_TYPE.1 is TRIGGER
TABLE_DESCRIPTION.0 is 2
TABLE_CATALOG.2 is
TABLE_DESCRIPTION.2 is
TABLE_DESCRIPTION.1 is
TABLE_CATALOG.1 is

Getting columns.
Return code from SQLCOLUMNS = 0
There are 10 column items returned.
TABLE_NAME.0 is 0
COLUMN_SIZE.0 is 0
COLUMN_TYPE.0 is 0
COLUMN_NAME.0 is 0
COLUMN_SCALE.0 is 0
COLUMN_NULLABLE.0 is 0
COLUMN_DESCRIPTION.0 is 0
COLUMN_PRECISION.0 is 0
TABLE_CATALOG.0 is 0
TABLE_OWNER.0 is 0

Discussion