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

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

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

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f

how to export excel file in same server
My first post - php newbie, so appreciate your support.

I'm currently using headers to save w

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Simple AND question
Hello,

I've got following code:

Code: if(strpos($row[13],"http://")

cookie problem
I hv a website url
In this site main menu functionality based on cookie when user click on parti

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

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