Information générale
Titre:
Oracle SQL Outer Join Problem : ADO version 1.5
ADO version 1.5
Oracle Version 8
ParentTable (PrimaryKey = primkey)
ChildTable
SQL= SELECT ParentTable.*, childTable.special_field
FROM ParentTable, childtable
WHERE ParentTable.primkey=childtable.primkey (+)
The childtable is not required but there can be no child orphans.
If there are childtable records, the query returns the SQL statement correctly.
If there is NO childtable records, then the ParentTable primkey is returned as a "null". Why? How can a primkey (primary key) be returned as a "null"? This only happens on this single parent\child relationship. It does not happen for any other parent\child relationship.
Thanks!!!
The actual piece of code is:
<%
' Parent Primary Key : TCLTISS.ISS_SYS_NR
' Child Foriegn Key : TCLTRSN.ISS_SYS_NR
MYDSN="DSN=xxxxxxxxxxxxxx;UID=xxxxxx;pwd=xxxxxxxx"
MYSQL="
SELECT
TCLTISS.*,
TCLTRSN.*,
TCLIPRO.CMT_TE_SYS_NR AS SUM_CMT_SYS_NR,
TCLIREC.CMT_TE_SYS_NR AS REC_CMT_SYS_NR,
TCLFSGM.*,
TDMCMNT.CMT_TE AS SUMMARY,
VRHRGML.ARC_MDL_NR
FROM TCLTISS, TCLTRSN, TCLIPRO, TCLIREC, TCLFSGM, TDMCMNT,VRHRGML
WHERE
TCLTISS.ISS_SYS_NR = TCLIPRO.ISS_SYS_NR (+) AND
TCLIPRO.CMT_TE_SYS_NR = TDMCMNT.CMT_TE_SYS_NR (+) AND
TCLTISS.ISS_SYS_NR = TCLIREC.ISS_SYS_NR (+) AND
TCLTISS.FSG_SYS_NR = TCLFSGM.FSG_SYS_NR (+) AND
TCLFSGM.ARC_RGS_NR = VRHRGML.ARC_RGS_NR (+) AND
TCLTISS.ISS_SYS_NR = TCLTRSN.ISS_SYS_NR (+) AND
TCLTISS.RPT_CWM_PES_SYS_NR = '6'"
set conntemp=server.createobject("adodb.connection")
conntemp.open mydsn
set rstemp=conntemp.execute(mysql)
%>
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