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

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

cURL and Sessions
Ohai.

So, I'm trying to cURL a bunch of things off of a page, and put them into a session. I'

How to refresh a parent page from a modal popup
Hi,I have a modal popup in which I need to upload a file and store in the database should give a mes

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :

<form id="f

my login script page is not working on remote computers
hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they

IS Retail & Manufacturing
Hi

Can IS Retail and Manufacturing activities be done in same instance ie. in same client

Error with Font and imagettfbbox
I keep getting an error that says "Warning: imagettfbbox() [function.imagettfbbox]: Could not f

How do I get the row number from from an sql table query
Hi all

I have a table that I query and it returns a number of rows.
mysql_num_rows($query)

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