jmac13
Member
Hi All,
I'm using 10.2b. I'm taking my first steps into prodata sets. after looking at the online course I came up with the following code using the tables we've got in our database. On the course it shows how to query top level query and a child query. This is done by doing two queries which point to their respective tables but in the second query in the query string it references to order table which the query has no knowledge of so I have no idea how this is suppose to work. I've basically followed that example with the two tables we have.. but of course it doesn't work.. so what Do I need to do to get this working?
Thanks
I'm using 10.2b. I'm taking my first steps into prodata sets. after looking at the online course I came up with the following code using the tables we've got in our database. On the course it shows how to query top level query and a child query. This is done by doing two queries which point to their respective tables but in the second query in the query string it references to order table which the query has no knowledge of so I have no idea how this is suppose to work. I've basically followed that example with the two tables we have.. but of course it doesn't work.. so what Do I need to do to get this working?
Thanks
Code:
define temp-table ttGrades like grades.
define temp-table ttPltgrade like pltgrade.
define dataset dsGradesPltgrade for ttGrades,ttPltgrade
data-relation drGradesPltgrade for ttGrades,ttPltgrade
relation-fields (grade-code,grade-code).
define query qGrades for grades.
define query qPltgrade for pltgrade.
define data-source srcGrades for query qGrades.
define data-source srcPltgrade for query qPltgrade.
query qGrades:handle:query-prepare
("for each grades").
query qPltgrade:handle:query-prepare
("for each pltgrade where pltgrade.grade-code = grades.grade-code and pltgrade.preInActive = true").
buffer ttGrades:attach-data-source (data-source srcGrades:handle).
buffer ttpltGrade:attach-data-source (data-source srcPltgrade:handle).
dataset dsGradesPltgrade:fill ().
for each ttGrades:
display ttGrades.grd-desc ttgrades.grade-code.
pause.
end.
for each ttPltgrade:
display ttPltgrade.grade-code.
pause.
end.