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)

Did you know?Explore Trending and Topic pages for more stories like this.
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

Help If user voted, block them
On my Prayer request site, i let users Click a button to Pray for somone that has posted a pray, i g

UDP server recvfrom() always returns -1? :(
Hello all,
I am getting a very strange error in my code :( I am writing a server application in C

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

Need to write a cookie with a url var
Not sure if its possible, but I need to write a cookie with a url.

So this would write 2232 a

mysql UPDATE request not working and driving me crazy!!!
Hi,

I have been stuck on this for ages.

Quite simply I am trying to update my database

Website Direction...
I recently used this code to try and make it so the page loads as http://www.domain.com/ when you ty

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:

I am calling this javascript:
<script language="javascript">

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