Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Stored Procedure Help - Private tickets

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-08, 10:49
sivaram2006 sivaram2006 is offline
Registered User
 
Join Date: Oct 2008
Posts: 7
Question Stored Procedure Help - Private tickets

Hi all,

I have a complex Query for all.

I have an existing stored procedure developed in Oracle 9i.
This will return a set of rows using a Ref Cursor to the front end (asp.net page). That ref cursor uses some complex query.

Now my problem is,

That ref cursor returns a set of records to the front end.
Now my requirement is that, based on a condition (Some flag called private) a record in that set of records should display all the columns as "Private".

For example, if that refcursor gives five tickets t1,t2,t3,t4,t5 and
if t3 is private, then all the columns in that ticket t3 should show as private.

How can this be done ?

Thanks....
Reply With Quote
  #2 (permalink)  
Old 10-16-08, 13:34
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 847
Code:
select (case when t3 = 'PRIVATE' then 'PRIVATE' else t1 end) as f1, (case when t3 = 'PRIVATE' then 'PRIVATE' else t2 end) as f2, t3, ... from table or select t1,t2,t3,t4,t5 from table where t3 != 'PRIVATE' union all select 'PRIVATE','PRIVATE','PRIVATE','PRIVATE','PRIVATE' from table where t3 = 'PRIVATE'

--=cf
Reply With Quote
  #3 (permalink)  
Old 10-17-08, 05:06
sivaram2006 sivaram2006 is offline
Registered User
 
Join Date: Oct 2008
Posts: 7
Thanks for the reply... Its working..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On