You can have a if ..then...else condition loop. When
first condition is satisfied the first query can run
and in the else part second query can run. No need to
create procedure for simple queries.

-Saumyajit



--- [EMAIL PROTECTED] wrote:
> 
> 
> I have a database, with some table relationed to
> each other, I would like to have 2 scenarious,
> 
> Case 1: I have 4 tables, table1, table 2, table 3
> and table4 included in a join, this query should run
> in the most common query.
> In table 1 and in table 2 exist a relation, id_nr in
> table1 and id_nt in table2, when they match each
> other, then this query should run.  So if  id_nr in
> table1 also exists in table2, then the query should
> run
> .
> But if it isnt so then case2 should run instead.
> 
> Case 2: If the first condition is not valid (which
> means that id_nr in table1 and id_nr doesnt match
> each other) then another query would run, which
> include the same tables also includes another table
> .
> 
> How can I handle these case? Should I first create 2
> views  of the tables joined inthe queries and then
> one procedure which runs query1 and another
> procedure which runs query 2.
> Please give me a pl/SQL example on how to handle
> this. Also include the matching condition between
> table1 and table 2 in case1.
> Would appreciate if someone could give  me some good
> example.
> 
> 
> Roland Sköldblom
> 
> 
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author:
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- (858) 538-5051  FAX:
> (858) 538-5051
> San Diego, California        -- Public Internet
> access / Mailing Lists
>
--------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from).  You may
> also send the HELP command for other information
> (like subscribing).


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Saumyajit Mandal
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to