• oorexxpert

    Does anybody know how SQLCOLUMNS is supposed to work?  I have been trying every combination I could think of and all I ever get back is zero columns.  When I use SQLTABLES, I get back the table information which I use in the SQLCOLUMNS at the appropiate positions.  However, I still get back zero columns. 

    I am using two Oracle connections at the same time.  One is version 11 and the other is 10.2;

    Any guidance would be greatly appreciated.  An example would be even better.

    • This is the snippet of code that I use successfully using SQLColumns with one open MySQL connection:
      /* Obtain info for all columns */   
      call sayfile 'Obtain list of all columns for table 'tabellen.TABLE_NAME.i
      kolommen. = ''
      rc = SQLColumns('kolommen', t_q, t_o, tabellen.TABLE_NAME.i, t_t)
      call listsqlca
      if rc < 0
      then call terminate 'Failed to obtain list of columns for table "'tabellen.TABLE_NAME.i'" (rc = 'rc')'
      call sayfile 'List of columns obtained for table "'tabellen.TABLE_NAME.i'"'

      I have opned the connection and used SQLTables to obtain the list of tables which is parsed into tabellen.

      I have struggled with the statement as well and what helped in my case was:
      - t_q (table qualifier) and t_o (table_owner) set to '*'
      - t_t (table type) set to 'TABLE'
      - MySQL requires the table name to be specified and ny wildcards allowed. The documentation does not specify restrictions for Oracle.....
      - do NOT specify a dot for the stem name! So 'kolommen' is correct but 'kolommen.' is not

      Hope this helps. Ynze