Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Why do i get exp_1, exp_2, etc. as col headers in sql output
The last in a series of sql statements writes to a table called final. In final, my column headers are listed as exp_1, exp_2, etc. on up to 9. I don't know why the original column names are not listed. Forcing an override with, for example 'select surveyans.mintro as mintro, fixes the problem. But what is the source of the problem.
The SQL is:
lc_responseid= '00000_0BG0ZFNPS'
SELECT surhdr.csurid, surhdr.mintro, surhdr.csurdescrip, surques.csurqno, surques.csurqtxt, ;
surques.csurqmid,surques.csurqtyp, surques.csection, surques.csecqno FROM SURHDR, SURQUES ;
WHERE SURHDR.CSURID=SURQUES.CSURID INTO TABLE surveydef
SELECT surveydef.csurid,surveydef.mintro,surveydef.csurdescri,surveydef.csurqno,surveydef.csurqtxt, ;
surveydef.csurqmid,surveydef.csurqtyp,surveydef.csection,surveydef.csecqno,surans.cansid,surans.cansans, ;
surans.cansansm,surans.canstyp ;
FROM surveydef, SURANS WHERE surveydef.CSURQNO=SURANS.CSURQNO INTO TABLE surveyans
select resphdr.cresphdrid,resphdr.drespdate,resphdr.cadminid,resphdr.cagentid,resphdr.csurid, ;
resphdr.crespnamid,resphdr.crespcoid,resphdr.mnotes,resphdr.cinterid,resphdr.crespconam, ;
resphdr.crespfname,resphdr.cresplname,respdtl.cresponse,respdtl.mresponse,respdtl.csurqno, ;
respdtl.csection ;
from resphdr, respdtl ;
where resphdr.cresphdrid=respdtl.cresphdrid and resphdr.cresphdrid = lc_responseid ;
into table responses
select surveyans.mintro, surveyans.csurdescri,surveyans.csurqtxt,surveyans.csurqmid,surveyans.csurqtyp,;
surveyans.csecqno,surveyans.cansid,surveyans.cansans,surveyans.cansansm,surveyans.canstyp ;
from surveyans outer join responses on surveyans.csurqno = responses.csurqno into table final
*Please not that if i replace the sql above that creates the final table with the same statement except for: select * from surveyans ...(rest same), it works fine
TIA
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement