Procedure with variable number of columns


Posted on 16th Feb 2014 07:03 pm by admin

Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcursor)

And in the procedure, I build up QUERY dynamically and the number of columns varies at runtime.

At the end I do

OPEN p_cursor for QUERY
Then to call this, I'm doing

call PROC(?)

My question is, how would I go about running the query from this procedure, then adding rows or modifying the existing results, then returning the modified data?

What I want to do is add a new row based on some condition, so I still need to return a variable number of columns, but I need to modify the results before I return them.

Is there any way of doing this? I need to do some calculations on the columns (the variable columns), create a new row, insert into result set, and return this new result set.

No comments posted yet

Your Answer:

Login to answer
221 Like 12 Dislike
Previous forums Next forums
Other forums

If a form submits back to same page do you need to use $get
IM trying to pass page number and year that was selected back to the same page.

i have this c

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

PHP Session Issue
I'm having an issue with one section on my website dealing with sessions. Now I know that myself and

News script
Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am

Converting from one format to another
"I have got a date in DD/MM/YYYY but I need it in MM-DD-YYYY. Help!"

Restricted access to sub-folder in iis6 doesn't work?
Basically I'm trying to add restriction to sub-folder (which contains pdf) in web.config for iis6 as

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash