Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    7

    Question Unanswered: 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....

  2. #2
    Join Date
    Dec 2003
    Posts
    1,074
    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

  3. #3
    Join Date
    Oct 2008
    Posts
    7
    Thanks for the reply... Its working..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •