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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no tablenames: db2 on win_nt via odbc

Status
Not open for further replies.

gbach

Programmer
Jun 22, 2000
2
DE
I am using the DB2 on Window NT accessing via ODBC.<br>When I am doing a query on one or more tables, I only get as resultset the column-names, not the fully qualified names (table.column).<br>This is bad, because I can't access the columns via index in the recordset.<br><br>Any suggestions?<br><br>EXAMPLE:<br>select person.name, state.name from person, state where person.home=state.name<br><br>results:<br>NAME ¦ NAME<br>-----+------<br>lisa ¦ NRW<br>john ¦ SLS<br>...&nbsp;&nbsp;&nbsp;&nbsp;...<br><br>&nbsp;
 
Try Naming the result as ( Ithink this is the syntax but look it up)<br><br>Select Person.name as person.name, state.name as state.name<br>from person, state ....<br><br>again it goes something like this but check the manual fro the exact syntax.<br><br>Hope this helps<br>&nbsp;&nbsp;Greg <p>Greg Amos<br><a href=mailto:amosgreg@ix(dot)netcom(dot)com replace(dot)>amosgreg@ix(dot)netcom(dot)com replace(dot)</a><br><a href= > </a><br>
 
Thanks for the answer!<br>But unfortunaltely this does not solve my problem:<br><br>I should have mentioned that I can not change the sql-statements (migration job) and that there are also wildcard querys:<br><br>select * from from person, state where person.home=state.name<br><br>So I can not use your trick :-(<br><br>Is there no db2, odbc, jdbc, ... option (there are so many) where I can change this behaviour?<br><br>thanks!<br> gunter<br>
 
I don't think you have an option. You say you cannot change the migration job SQL and since this is the case you have no way of associating the Table name with the column.<br><br>If the migration job &quot;MUST&quot; be used as is there is nothing that I am aware of that will solve your problem.<br><br>Is there the avaliability of copying the migration job into your job and making only the naming substitutions or are you recieving this from another area as is?<br>Is there the posibility of having them create the TableName.ColumnName format changes for you?<br><br>The only other option is to use your load to assign each column to the appropriate table (Not really an option as far as data intergity goes)<br><br>Good Luck !<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Greg <p>Greg Amos<br><a href=mailto:amosgreg@ix(dot)netcom(dot)com replace(dot)>amosgreg@ix(dot)netcom(dot)com replace(dot)</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top