This forum is currently locked. You can't register or post questions at this time. (read more)

Stored Prcedure

All posts relating to Oracle PL/SQL development.

Moderator: Tim...

Guest

Stored Prcedure

Postby Guest » Mon Nov 01, 2004 6:09 pm

Hi,

I have to write stored procedure which returns resultset.I have two tables Student and StudentAttendance. In studentAttendance table weekwise ,each students data like actualattendedsession, absence and other details are stored.

To the stored procedure i would be passing input as No.ofweeks, recordstofetch and schoolid. Maximum no. of weeks will be 15.

I have declared object of TYPE with fields as studentId, Field1, Field2...Field15.(Field1 correspond to week1..)
My problem is how do i return For one studentId, for all weeks differentData.
How do I declare TYPE OBJEct ?

regards,
Smita

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

RE:Stored Prcedure

Postby Tim... » Mon Nov 01, 2004 6:09 pm

Hi.

You don't need an objects type. Simply define a REF CURSOR and open it with the appropriate select. See:

http://www.oracle-base.com/articles/8i/ ... rdsets.php

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle SQL and PL/SQL Development”

Who is online

Users browsing this forum: No registered users and 4 guests

cron