how to join tables in a cursor [message #543320] |
Tue, 14 February 2012 02:32 |
|
baliberde
Messages: 201 Registered: January 2012 Location: outer space
|
Senior Member |
|
|
hi, i'd like to join tables in a cursor.
I tried coding this way...
CURSOR studgrade_cur IS
SELECT g.stud_id, g.grade, subj_code, s.description
FROM studgrades g JOIN subjects s
ON(g.subj_code = s.subj_code)
WHERE stud_id = :Studentprofile.student_id;
but i got an error, saying:
Quote:encountered the symbol JOIN when expecting one of the following:
,; for group having intersect minus order start union where
connect
Is it not allowed to use JOIN statement in a cursor?
|
|
|
|
|
Re: how to join tables in a cursor [message #543342 is a reply to message #543337] |
Tue, 14 February 2012 04:55 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
That should work in 10g forms. Are you sure it's not an older version?
Just use the non-ansi syntax:
CURSOR studgrade_cur IS
SELECT g.stud_id, g.grade, subj_code, s.description
FROM studgrades g , subjects s
WHERE g.subj_code = s.subj_code
AND stud_id = :Studentprofile.student_id;
|
|
|
|