Datagrid not displaying new column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,
The problem I am having is in one of the datagrids I added a new column.
When I run the application data is not shown in the new column. I am using
VS.NET 2003 and am connecting to a sql database(Oracle 10g). Before adding
the new column the other fields show up. The other fields still show up but
not the one I had just added. I am using a sql statement to get the data.

Here is the original sql:
SQL = "Select orgn, name, case when name is null then cast(cnt
as char(4)) else ' ' end as cnt " & _
"From (Select orgn, name, count(*) cnt " & _
"From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2)
as orgn, '[' || CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' || " & _
"VLTM.LAST_NAME || ', '
|| VLTM.FIRST_NAME || ' ' || VLTM.MIDDLE_INITIAL name " & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT,
V_LEAN_TEAM_MEMBER VLTM " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
_
Session("ReportSelectionEndDate") & "' AND
VLTM.UNIVERSAL_ID IN (" & _
"Select UNIVERSAL_ID " & _
"From (Select vltm2.UNIVERSAL_ID, count(*)
" & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM
VLT, V_LEAN_TEAM_MEMBER VLTM2 " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
Session("ReportSelectionEndDate") & "' " & _
"AND VLE.EVENT_ID =
VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID " & _
"Group By vltm2.UNIVERSAL_ID Having count(*) >= 1
Order By vltm2.UNIVERSAL_ID))) " & _
"GROUP BY ROLLUP (orgn, (name))) Order By orgn, name"


Here is the new sql, I added event type field:
Select orgn, name, etype, case when name is null then cast(cnt as char(4))
else ' ' end as cnt
From (Select orgn, name, etype, count(*) cnt
From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2) as orgn, '[' ||
CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' ||
VLTM.LAST_NAME || ', ' || VLTM.FIRST_NAME || ' ' ||
VLTM.MIDDLE_INITIAL NAME,
VLE.EVENT_TYPE etype
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000' AND
'31-DEC-2099' AND VLTM.UNIVERSAL_ID IN
(Select UNIVERSAL_ID
From
(Select vltm2.UNIVERSAL_ID, count(*)
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM2
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000'
AND '31-DEC-2099' AND
VLE.EVENT_ID = VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID
Group By vltm2.UNIVERSAL_ID Having count(*) >= 1 Order By
vltm2.UNIVERSAL_ID)))
GROUP BY ROLLUP (orgn, name, etype))
Order By orgn, name

I have run the new sql statement in TOAD and the field data shows up, it
doesn't show up when I execute in my app.
 
All set, I changed the Group By Rollup to GROUP BY ROLLUP (orgn, (name,
etype)) and it works. My sql skills is still newbie-ish.

jfarias said:
Hello all,
The problem I am having is in one of the datagrids I added a new column.
When I run the application data is not shown in the new column. I am using
VS.NET 2003 and am connecting to a sql database(Oracle 10g). Before adding
the new column the other fields show up. The other fields still show up but
not the one I had just added. I am using a sql statement to get the data.

Here is the original sql:
SQL = "Select orgn, name, case when name is null then cast(cnt
as char(4)) else ' ' end as cnt " & _
"From (Select orgn, name, count(*) cnt " & _
"From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2)
as orgn, '[' || CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' || " & _
"VLTM.LAST_NAME || ', '
|| VLTM.FIRST_NAME || ' ' || VLTM.MIDDLE_INITIAL name " & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT,
V_LEAN_TEAM_MEMBER VLTM " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
_
Session("ReportSelectionEndDate") & "' AND
VLTM.UNIVERSAL_ID IN (" & _
"Select UNIVERSAL_ID " & _
"From (Select vltm2.UNIVERSAL_ID, count(*)
" & _
"FROM V_LEAN_EVENT VLE, V_LEAN_TEAM
VLT, V_LEAN_TEAM_MEMBER VLTM2 " & _
"WHERE NVL(VLE.ACTUAL_COMPLETION,
'01-JAN-2000') BETWEEN '" & Session("ReportSelectionStartDate") & "' AND '" &
Session("ReportSelectionEndDate") & "' " & _
"AND VLE.EVENT_ID =
VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID " & _
"Group By vltm2.UNIVERSAL_ID Having count(*) >= 1
Order By vltm2.UNIVERSAL_ID))) " & _
"GROUP BY ROLLUP (orgn, (name))) Order By orgn, name"


Here is the new sql, I added event type field:
Select orgn, name, etype, case when name is null then cast(cnt as char(4))
else ' ' end as cnt
From (Select orgn, name, etype, count(*) cnt
From (Select Distinct substr(VLTM.ORGN_CODE, 1, 2) as orgn, '[' ||
CAST(VLTM.ORGN_CODE AS CHAR(6)) || '] ' ||
VLTM.LAST_NAME || ', ' || VLTM.FIRST_NAME || ' ' ||
VLTM.MIDDLE_INITIAL NAME,
VLE.EVENT_TYPE etype
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000' AND
'31-DEC-2099' AND VLTM.UNIVERSAL_ID IN
(Select UNIVERSAL_ID
From
(Select vltm2.UNIVERSAL_ID, count(*)
FROM V_LEAN_EVENT VLE, V_LEAN_TEAM VLT, V_LEAN_TEAM_MEMBER VLTM2
WHERE NVL(VLE.ACTUAL_COMPLETION, '01-JAN-2000') BETWEEN '01-JAN-2000'
AND '31-DEC-2099' AND
VLE.EVENT_ID = VLT.EVENT_ID AND VLT.TEAM_ID = VLTM2.TEAM_ID
Group By vltm2.UNIVERSAL_ID Having count(*) >= 1 Order By
vltm2.UNIVERSAL_ID)))
GROUP BY ROLLUP (orgn, name, etype))
Order By orgn, name

I have run the new sql statement in TOAD and the field data shows up, it
doesn't show up when I execute in my app.
 
Back
Top