Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT FROM TWO TABLES WORKS, THREE DOESN'T

Status
Not open for further replies.

posty2k

Programmer
Nov 3, 2005
3
US
This is my first post so bear with me. It is directed to k5tm but, of course, anyone can reply.

RMCOBOL V9, installed the Instant SQL package with appropriate Oracle drivers under Linux.

Using the SQL CONNECT, SQL PREPARE, SQL BIND COLUMN, SQL BIND PARAMETERS, etc. I was able to get queries on two tables to work but not three.

For example "SELECT a,b,c,d,e FROM x, y WHERE ....." works
whereas "SELECT a,b,c,d,e,f FROM x, y, z WHERE ...... " doesn't. With this and several variations of the 3-table query, the SQL BIND COLUMN fails in RMCOBOL.

Using MS-ACCESS and SQL-PLUS the same 3-table select statements work.

Are there RMCOBOL examples of querying multi-tables that are available? Maybe need another SQL statement?

Thanks in advance.

 
Can you show the appropriate segments of the COBOL code including the data descriptions? What is the output of SQL DESCRIBE COLUMN after your have prepared the query? Which SQL BIND COLUMN is failing? What is SQL DESCRIBE ERROR returning on the column that fails?

Since this is on Linux, I presume you must be using iodbc. The iodbc package includes an executable called odbctest.

Using odbctest, does the identical query work correctly? If so, what are the differences in the result sets returned by the two queries? (One obvious difference is 6 columns vs. 5.)

What symptoms is the second query producing? Have you enabled ODBC tracing in the iodbc configuration file? If so, what are the results?

As you might be able to determine from my questions, I don't think there is any problem that cannot be reasonably diagnosed.

Tom Morrison
 
Tom,

Thanks for giving us a good direction. Upon further analyzing our setup, we found that the schema needed to be identified in our FROM portion.

The statement should have been set up: "SELECT .... FROM schema1.x, schema1.y, schema1.z WHERE ...."

Yes, this begs the question why this wasn't necessary for two tables; we are currently trying to figure that out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top