how to join tables in a cursor [message #543320] |
Tue, 14 February 2012 02:32 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/9d3a737834daa8c057331fef1633aed5?s=64&d=mm&r=g) |
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 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13926 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;
|
|
|
|