RE: Interesting PL/SQL Puzzle

2003-11-10 Thread Chelur, Jayadas {PBSG}
 pleased the way native compilation works.


Does anybody have a clue why?

I tried to include the proc in a package and pin it but there was no
difference.


Thanks

Waleed

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Khedr, Waleed
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Khedr, Waleed
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: interesting sql question

2003-09-29 Thread Chelur, Jayadas {PBSG}
This would eliminate duplicate bids on the same boat by the same person

SELECT  p.*
FROMPERSON p,
(
SELECT  COUNT(*) boat_count
FROMBOAT
) c,
(
SELECT  sid, COUNT(DISTINCT boat_id) bid_count 
FROMBIDS 
GROUP   BY sid
) b
WHERE   p.sid   = b.sid
AND b.bid_count = c.boat_count;


-Original Message-
Sent: Monday, September 29, 2003 9:20 AM
To: Multiple recipients of list ORACLE-L


Im taking a database theory class(no I dont need help with my homework).
There is an interesting query in the book that I have never seen posed
before. The solution would be hideously slow if there was even a moderate
amount of data in the tables. How would you write it? 

Given 3 tables: and columns in the tables:

TABLE: Person
Primary Key: SID
COLUMN: NAME

TABLE: BIDS
Primary Key: BID
Foreign Key: SID
FOREIGN KEYT: BOAT_ID
Column: Date

Boat:
Primary Key: BOAT_ID
Column: Color

Find any person who has reserved all the boats. The 

I dont have the solution with me, but there is a 'NOT EXISTS', then in the
subquery there is a minus and a correlated 'where' clause.'. That query
wouldnt move.

How would you solve this? 

Also, according to the 'SQL Standard', SQL is supposed to support op codes
such as 'ALL' or 'ANY' So you can say:

Find all people who are older than any person with blue eyes. Or find all
the people who are older than 'ALL' the people with blue eyes.

Just to reiterate. Not looking for help with my homework. My professor isnt
an Oracle guy so he doesnt know.  

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: [EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: EXECUTE IMMEDIATE and PL/SQL variables???

2003-09-04 Thread Chelur, Jayadas {PBSG}
This can be done using a Package Variable.

Here are the steps :-

(1) Package Specification
=

CREATE OR REPLACE PACKAGE DSQL AS
n_TestValue NUMBER;
FUNCTIONGetValue RETURN NUMBER;
END;

(2) Package Body

CREATE OR REPLACE PACKAGE BODY DSQL AS
FUNCTIONGetValue RETURN NUMBER
IS
BEGIN
RETURN (n_TestValue);
END;

END;

(3) Execute the PL/SQL Block 

BEGIN
EXECUTE IMMEDIATE 'SELECT COUNT(*) AS RECORD_COUNT FROM SOMETABLE '
INTO DSQL.n_TestValue  ;
END;
/

(4) Get the value of the package variable
=

SELECT DSQL.GetValue FROM DUAL;

HTH ...

-Original Message-
Sent: Thursday, September 04, 2003 2:39 AM
To: Multiple recipients of list ORACLE-L



Hi List,

I know someone will have a good answer to this question:

I have a large PL/SQL program to convert some data.  Some tables are
created dynamically during the PL/SQL procedure using EXECUTE IMMEDIATE.  I
need to query values from some of these tables (only a couple of rows, so
performance is a non-issue currently).  Since the tables don't exist at
compilation time I thought about putting them into EXECUTE IMMEDIATE
statements to enable the PL/SQL to compile.  My problem, therefore, is how
do I get a figure from such a statement back into a normal variable?

I really don't want to break the conversion process into several PL/SQL
blocks if there is a way to avoid this.  Does anyone know of a tidy way to
accomplish this?  I'm willing to accept any ideas currently.

Thanks in advance,

Mark.

What, for example, is the equivalent of:

DECLARE
  n_count NUMBER;
BEGIN
  EXECUTE IMMEDIATE 'SELECT COUNT(*) INTO n_count FROM DUAL';
  dbms_output.put_line('Number is '||n_count);
END;
/



   Privileged/Confidential information may be contained in this message.
  If you are not the addressee indicated in this message
   (or responsible for delivery of the message to such person),
you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender
   by reply e-mail or by telephone on (61 3) 9612-6999.
   Please advise immediately if you or your employer does not consent to
Internet e-mail for messages of this kind.
Opinions, conclusions and other information in this message
  that do not relate to the official business of
 Transurban City Link Ltd
 shall be understood as neither given nor endorsed by it.








Privileged/Confidential information may be contained in this message.
If you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone.
In such a case, you should destroy this message and kindly notify the sender
by reply e-mail or by telephone on (03) 9612-6999 or (61) 3 9612-6999.
Please advise immediately if you or your employer does not consent to
Internet e-mail for messages of this kind.
Opinions, conclusions and other information in this message that do not
relate to the official business of Transurban Infrastructure Developments
Limited and CityLink Melbourne Limited shall be understood as neither given
nor endorsed by them.



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mark Richard
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: how to do a variable in-list of numbers?

2003-08-29 Thread Chelur, Jayadas {PBSG}
SELECT   columns
FROM sometable
WHEREINSTR(','||list_of_comma_separated_codes||',' ,
   ','||code_column||',' )  0;


(1). Concatenate Commas at BOTH ENDS of the string containing
 different code values. e.g. If the string is 
 '101,102,554,336,678,301,201,199' , the concatenate commas
 on both ends to make it ',101,102,554,336,678,301,201,199,'

 this is to make sure that EVERY code ( including the first
 and the LAST ) confirms to the pattern ,value,

(2)  For each row in the table, use INSTR() function to see whether
 the pattern ,value of columna, is CONTAINED in the string

 INSTR() is used so that pattern matching can be used instead of
 any range checking etc on the string. The actual code values in
 the string can be IN ANY ORDER.

-Original Message-
Sent: Friday, August 29, 2003 10:32 AM
To: Multiple recipients of list ORACLE-L


I need to do an insert select of the form

insert into tab2
select col1
from tab1
where col2 in (inlist of numbers);

I do not know how many values will be in my inlist at runtime. With strings
I just build a big string. How do I build an 'inlist' of numbers at runtime?


Im using a cursor to determine which values need to be added to my inlist. I
think I can do some kind of cast, but im not familiar with it.

Im on 8i. I do not want to j ust run this inside my cursor. It could then
execute 300-400 times and will run all day. 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: [EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: Query results to .csv

2003-08-25 Thread Chelur, Jayadas {PBSG}
This is probably the easiest way, if you are
doing it from SQL*Plus :-

SET COLSEP ,



-Original Message-
Sent: Monday, August 25, 2003 8:39 AM
To: Multiple recipients of list ORACLE-L


Hi,

Whats the best way to write the results of a SQL query to a CSV file?

Thanks.

_
Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Imran Ashraf
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: SQL Navigator

2003-08-18 Thread Chelur, Jayadas {PBSG}
Hi,

I have been using SQL Navigator since 2000 and I am quite
happy with it. I am still using version 3.1 but version 4
has been out for a long time. It is not difficult at all,
but if you are converting from SQL*Plus it seems to be a
huge obstacle initially. If your objective is server side
development ( not DBA related activities ) this is quite
good. There is no steep learning curve involved, but all you
have to do is play around with it for a while ( preferably
connected as SCOTT ;-) until you are familiar with what
each menu option does ...

Its great for PL/SQL ( has its own debugger ), extracting
DDLs, saving results as CSV, INSERT STATEMENTs etc. Schema
browser gives you a tree interface to all the schema objects.
It can be linked to different version control systems, ( I
have linked it Visual Sourcesafe ). Provides a good EXPLAIN
PLAN screen in which you can collapse and expand certain
operations, search text in all source code etc. The help
option is good enough to get you started.

HTH ...




-Original Message-
Sent: Monday, August 18, 2003 12:05 PM
To: Multiple recipients of list ORACLE-L


I'm considering SQL Navigator (Quest)for web app dev and am looking for some
feedback from you, the experts.

I can't seem to find any training being offered on this product.  There
seems to be no technical books for it. I'm wondering, is there a steep
learning curve with it?  Did anyone find it too complex to use?  ...or
relatively easy?

All input will be welcome.
Thanks in advance.

Pat Gorden-Ozgul
[EMAIL PROTECTED]

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Gorden-Ozgul, Patricia E
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: OT -- Boston Globe job listings

2003-08-14 Thread Chelur, Jayadas {PBSG}
 to see eight or more per
  week, now I tend
  to
see one or two, or none.
   
For a while they also announced big IT job fairs, I don't
  know if they
   still
do that or how successful they now are.
   
The market has really shrunk in two years!
   
There can't be a huge glut of DBAs out there looking for
  work...  It
  must
   be
a reduction in demand because companies are not making big
  infrastructure
changes anymore.
   
Patrice.
 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
 -- 
 Author: Jesse, Rich
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 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).
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: KENNETH JANUSZ
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Orr, Steve
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: update statement ???

2003-07-30 Thread Chelur, Jayadas {PBSG}
UPDATE cli_branches
SETbrch_name = REPLACE(UPPER(brch_name),'(NO PHONE #S)','')
upper(brch_name) like '%PHONE%';

-Original Message-
Sent: Wednesday, July 30, 2003 5:24 PM
To: Multiple recipients of list ORACLE-L


Hi all,
I need to update a column (brch_name) to be without
(NO PHONE #S) string.  So 3954 will be Denver, 3955
will be Golden, and 3963 will be LOVELAND 29TH, etc. 
How to write this update statement???  Thank you!

  1* select brch_id, brch_name from cli_branches where
upper(brch_name) like '%PHONE%'
SQL /

   BRCH_ID BRCH_NAME
-- --
  3954 DENVER (NO PHONE #S)
  3955 GOLDEN (NO PHONE #S)
  3956 ENGLEWOOD (NO PHONE #S)
  3957 LITTLETON (NO PHONE #S)
  3958 CHARLOTTE (NO PHONE #S)
  3959 S LEMAY (NO PHONE #S)
  3960 HARMONY ROAD (NO PHONE #S)
  3961 ENGLEWOOD (NO PHONE #S)
  3962 LOVELAND (NO PHONE #S)
  3963 LOVELAND 29TH (NO PHONE #S)
  3964 DENVER (NO PHONE #S)

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Janet Linsy
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: CASE in PL/SQL

2003-07-07 Thread Chelur, Jayadas {PBSG}
 
--- -- -- -- --- 
01-JAN-2003 1 2 2 3 
01-APR-2003 2 3 3 4 
01-JUL-2003 3 4 0 1 
01-OCT-2003 4 5 1 2 
01-JAN-2004 1 2 2 3 
01-APR-2004 2 3 3 4 
01-JUL-2004 3 4 0 1 
01-OCT-2004 4 5 1 2 

8 rows selected. 

SQL 

The last column there follows your organization's fiscal quarter schedule. 

Hope this helps, Surendra. 

T. 





 
 

 

-Original Message-
Sent: Thursday, July 03, 2003 9:11 AM
To: Multiple recipients of list ORACLE-L


Can you at-least _show_ us what you are doing, what you want to do and where
the code is failing? We are shooting in the dark here ..
 
Like I mentioned before, you can _always_ use SQL to assign values to pl/sql
variables.
Raj

 
Rajendra dot Jamadagni at nospamespn dot com 
All Views expressed in this email are strictly personal. 
QOTD: Any clod can have facts, having an opinion is an art ! 

-Original Message-
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 6:11 PM
To: Multiple recipients of list ORACLE-L


I am already using it that way, but giving that condition in cursor is not
possible.
Thanks for your help.
Surendra

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: CASE in PL/SQL

2003-07-03 Thread Chelur, Jayadas {PBSG}
 Tirumala 
 Database Administrator 
 Cabinet for Workforce Development 
 Commonwealth of Kentucky 
 -- 
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
http://www.orafaq.net  
 -- 
 Author: 
   INET: [EMAIL PROTECTED] 
 
 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
http://www.fatcity.com  
 San Diego, California-- Mailing list and web hosting services 
 - 
 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). 
 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
http://www.orafaq.net  
-- 
Author: George Oneata 
  INET: [EMAIL PROTECTED] 

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
http://www.fatcity.com  
San Diego, California-- Mailing list and web hosting services 
- 
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). 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
http://www.orafaq.net  
-- 
Author: 
  INET: [EMAIL PROTECTED] 

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
http://www.fatcity.com  
San Diego, California-- Mailing list and web hosting services 
- 
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). 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: Automate an update

2003-07-02 Thread Chelur, Jayadas {PBSG}
why not create a view like this ...
 
SELECT  'Y' AS FLAG
FROMDUAL
WHERE   TO_CHAR(SYSDATE,'HH24MI') BETWEEN '0800' AND '1600'
UNION   ALL
SELECT  'N' AS FLAG
FROMDUAL
WHERE   TO_CHAR(SYSDATE,'HH24MI') NOT BETWEEN '0800' AND '1600';
 
that would have the flag on and off without an update ... and you can other
tables with
this view to implement the actual logic ...
 
HTH

-Original Message-
Sent: Wednesday, July 02, 2003 5:41 AM
To: Multiple recipients of list ORACLE-L


Hi all,
 
I need help in order to create a following mechanism.
 
I have a table where is a column called window_open and it has two values
'Y' and 'N'
 
Now I need to automate the update a single row based on following rules:
 
If time is between 08:00-16:00 the value on that window_open column should
be 'Y' during other period the value should be 'N'. How can I do this and
automate the task...
 
Thanks in advance,
 
Joshua

Gå före i kön och få din sajt värderad på nolltid med Yahoo!
http://se.docs.yahoo.com/info/express/help/index.html Express

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: Oracle Clinical

2003-06-24 Thread Chelur, Jayadas {PBSG}
Unfortunately, thats an acronym for DBA too !

-Original Message-
Sent: Tuesday, June 24, 2003 11:29 AM
To: Multiple recipients of list ORACLE-L


Ins't that a synonym for a duhveloper, you know a Dumb A__ B__

Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA 

-Original Message-
Sent: Tuesday, June 24, 2003 11:20 AM
To: Multiple recipients of list ORACLE-L


Must have something to do with Brill Cream.  You know, just put a DAB of it
in your hair and you're an instant babe magnet.

Dave

-Original Message-
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 10:04 AM
To: Multiple recipients of list ORACLE-L


What's a DAB?

v/r

Stephen S. Wolfe, GS-11, DAFC
Data Services Manager
[EMAIL PROTECTED]
(813) 827-9974  DSN 651-9974



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 24, 2003 10:20 AM
 To: Multiple recipients of list ORACLE-L
 Subject: Oracle Clinical
 
 
 Hi all, 
  what is Oracle Clinical.
  I saw some job advertisement Oracle Clinical DAB or programmer.
  
 -- 
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
 -- 
 Author: [EMAIL PROTECTED]
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 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).
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Wolfe Stephen S GS-11 6 MDSS/SGSI
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Farnsworth, Dave
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Goulet, Dick
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: How to pass string with a ' to PL/SQL

2003-06-10 Thread Chelur, Jayadas {PBSG}
change this
 
:b :='and sub_account_no=''864240103'''; 
 
into this :-
 
:b := ' and sub_account_no = '||||'864240103'||;
 

-Original Message-
Sent: Tuesday, June 10, 2003 1:25 PM
To: Multiple recipients of list ORACLE-L


I have procedure that needs to pass a string with a ' .
Anyone have any idea how to do this in PL/SQL
 
Here is my example:
 
var a refcursor
var b varchar2(100);
begin
   :b :='and sub_account_no=''864240103''';
   execute :a := pkg_reports_Dynamiccti.fu_sales_analysis('2003-05-21
00:00:00','2003-06-02 00:00:00','20','864240103','order by calldate
desc',:b);
end;
/

This is giving me an error.
ERROR at line 3:
ORA-06550: line 3, column 12:
PLS-00103: Encountered the symbol  when expecting one of the following:
:= . ( @ % ; immediate
The symbol ; was substituted for  to continue.
 
Thanks in advance.
 
-Lizz



  _  

Do you Yahoo!?
Free online  http://us.rd.yahoo.com/mail_us/tag/*http://calendar.yahoo.com
calendar with sync to Outlook(TM).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: How to put a TOP 1 in a select

2003-06-10 Thread Chelur, Jayadas {PBSG}
This query would give you the total quantity sold in the
past two weeks and the date on which maximum number was
sold, for each item ...
 
SELECT a.item,
   a.tras_date AS max_sale_date,
   b.tot_qty   AS tot_sale_qty
FROM   ICTRANS a,
   ( 
   SELECT item, SUM(qty) tot_qty, MAX(qty) max_qty
   FROM   ICTRANS
   WHERE  company  = 2000 
   ANDtrans_date BETWEEN TRUNC(SYSDATE-14) AND SYSDATE 
   ANDdoc_type = 'IS'
   ANDreason_code  = 'VTCL'
   ANDSUBSTR(item,2,2) = '57'
   GROUP  BY item 
   ) b
WHERE  a.item = b.item
ANDa.qty  = b.max_qty
ANDtrans_date BETWEEN TRUNC(SYSDATE-14) AND SYSDATE;

 -Original Message-
Sent: Tuesday, June 10, 2003 5:50 PM
To: Multiple recipients of list ORACLE-L



Thanks!!
First let me explain more about the query I have a table ICTRANS that have
all the inventary movements.  
 
I need to  made a query that give each item from the guide 57, the
information that I need is how much of each item we sell in the last two
week ( from today), and what was the day that we sell more. 
The way I can know if it was a sell is because this condition must be true
:reason_code = 'VTCL' and doc_type = 'IS'. IS means exit of inventary, that
way the field Quantity have quantity with a negative sign ( ej: -30). If
substr(item, 2,2) = '57' that mean that item is from the guide 57 ( patent
medicine), company=2000 means that are from the same company we have one
company per city.

This is what I have on mind in :
 
select ITEM , 
sum(QUANTITY), 
( select top 1 t2.TRANS_DATE 
  from ICTRANS t2 where t2.ITEM = t.ITEM 
  where COMPANY = 2000 and TRANS_DATE between (sysdate-14) and sysdate
and DOC_TYPE = 'IS'
and REASON_CODE = 'VTCL'
and substr(ITEM, 2,2) = '57'
  order by t2.QUANTITY desc
) 
from ICTRANS t 
where COMPANY = 2000 and TRANS_DATE between (sysdate-14) and sysdate 
and DOC_TYPE = 'IS'
and REASON_CODE = 'VTCL'
and substr(ITEM, 2,2) = '57'
group by ITEM 
 
 
Thanks for your help I feel lost using Oracle. 
 
 

*

This electronic transmission is strictly confidential and intended solely

for the addressee. It may contain information which is covered by legal,

professional or other privilege. If you are not the intended addressee,

you must not disclose, copy or take any action in reliance of this

transmission. If you have received this transmission in error, 

please notify the sender as soon as possible.


This footnote also confirms that this message has been swept

for computer viruses.

**


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: procedure/function error

2003-06-06 Thread Chelur, Jayadas {PBSG}
Functions CAN be called from SQL*Plus like this ...
 
create the function
---
 
create or replace function emp_sel(e IN VARCHAR2) RETURN VARCHAR2 IS
cName VARCHAR2(32);
BEGIN
SELECT INITCAP(ename) INTO cName FROM EMP WHERE ename = e;
RETURN (cName);
END;
/
 
in SQL*Plus do the following
-
 
SQLvariable x varchar2(32);
SQL:x := emp_sel('SCOTT');
 
PL/SQL procedure successfully completed.
 
SQLprint X;
 
X

Scott
 
HTH ...
 
 

-Original Message-
Sent: Friday, June 06, 2003 9:55 AM
To: Multiple recipients of list ORACLE-L


 declare 
   a varchar2(20);
   b:=varchar2(20):='gali';
 begin
   a:=EMP_SEL(b);
   dbms_output.put_line(a);
   end;
You cannot call the functions like this, only procedures can be.
Venkat

- Original Message -

DATE: Fri, 06 Jun 2003 03:35:11 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Cc: 

hi all,
this is purushottam hegde from Bangalore(IND)
i am relatively new to oracle and so to this group.
iam having a problem with function...
it goes like this.
 
 
 
SQL CREATE OR REPLACE FUNCTION EMP_SEL(ename IN Varchar2) return varchar2
is
  2  resex varchar2(3);
  3  Begin 
  4  SELECT sex into resex from emp where name=ename;
  5  return(resex);
  6  END;
  7  /
Function created.
 
SQL EXECUTE EMP_SEL('gali');
BEGIN EMP_SEL('gali'); END;
  *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'EMP_SEL' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
 
 
 
pl help me in this regard
 
thanking all of u
 
purushottam hegde
 
 



  _  

Do you Yahoo!?
Free online  http://us.rd.yahoo.com/mail_us/tag/*http://calendar.yahoo.com
calendar with sync to Outlook(TM).




Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
Login To Lycos  http://login.mail.lycos.com/r/referral?aid=27005 Mail

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: procedure/function error

2003-06-06 Thread Chelur, Jayadas {PBSG}
slight correction
 
SQL:x := emp_sel('SCOTT'); 
 
has to be changed to :-
 
SQL exec :x := emp_sel('SCOTT');
 
sorry ... cutpaste problem from sqlplus output !!!

-Original Message-
Sent: Friday, June 06, 2003 9:51 AM
To: '[EMAIL PROTECTED]'


Functions CAN be called from SQL*Plus like this ...
 
create the function
---
 
create or replace function emp_sel(e IN VARCHAR2) RETURN VARCHAR2 IS
cName VARCHAR2(32);
BEGIN
SELECT INITCAP(ename) INTO cName FROM EMP WHERE ename = e;
RETURN (cName);
END;
/
 
in SQL*Plus do the following
-
 
SQLvariable x varchar2(32);
SQL exec :x := emp_sel('SCOTT');
 
PL/SQL procedure successfully completed.
 
SQLprint X;
 
X

Scott
 
HTH ...
 
 

-Original Message-
Sent: Friday, June 06, 2003 9:55 AM
To: Multiple recipients of list ORACLE-L


 declare 
   a varchar2(20);
   b:=varchar2(20):='gali';
 begin
   a:=EMP_SEL(b);
   dbms_output.put_line(a);
   end;
You cannot call the functions like this, only procedures can be.
Venkat

- Original Message -

DATE: Fri, 06 Jun 2003 03:35:11 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Cc: 

hi all,
this is purushottam hegde from Bangalore(IND)
i am relatively new to oracle and so to this group.
iam having a problem with function...
it goes like this.
 
 
 
SQL CREATE OR REPLACE FUNCTION EMP_SEL(ename IN Varchar2) return varchar2
is
  2  resex varchar2(3);
  3  Begin 
  4  SELECT sex into resex from emp where name=ename;
  5  return(resex);
  6  END;
  7  /
Function created.
 
SQL EXECUTE EMP_SEL('gali');
BEGIN EMP_SEL('gali'); END;
  *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'EMP_SEL' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
 
 
 
pl help me in this regard
 
thanking all of u
 
purushottam hegde
 
 



  _  

Do you Yahoo!?
Free online  http://us.rd.yahoo.com/mail_us/tag/*http://calendar.yahoo.com
calendar with sync to Outlook(TM).




Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
Login To Lycos  http://login.mail.lycos.com/r/referral?aid=27005 Mail

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


RE: Alternative way to write delete query

2003-05-29 Thread Chelur, Jayadas {PBSG}
 the official ORACLE-L FAQ:  http://www.orafaq.net
http://www.orafaq.net 

--

Author: STEVE OLLIG

  INET:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



Fat City Network Services-- 858-538-5051  http://www.fatcity.com
http://www.fatcity.com 

San Diego, California-- Mailing list and web hosting services

-

To REMOVE yourself from this mailing list, send an E-Mail message

to:  [EMAIL PROTECTED] mailto:[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).







--

Please see the official ORACLE-L FAQ:  http://www.orafaq.net
http://www.orafaq.net 

--

Author: Igor Neyman

  INET:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



Fat City Network Services-- 858-538-5051  http://www.fatcity.com
http://www.fatcity.com 

San Diego, California-- Mailing list and web hosting services

-

To REMOVE yourself from this mailing list, send an E-Mail message

to:  [EMAIL PROTECTED] mailto:[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).












   Privileged/Confidential information may be contained in this message.

  If you are not the addressee indicated in this message

   (or responsible for delivery of the message to such person),

you may not copy or deliver this message to anyone.

In such case, you should destroy this message and kindly notify the sender

   by reply e-mail or by telephone on (61 3) 9612-6999.

   Please advise immediately if you or your employer does not consent to

Internet e-mail for messages of this kind.

Opinions, conclusions and other information in this message

  that do not relate to the official business of

 Transurban City Link Ltd

 shall be understood as neither given nor endorsed by it.








  


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).



RE: SQL Question

2003-04-04 Thread Chelur, Jayadas {PBSG}
Hi Madhavan,

You are always welcome. I had to write a similiar one
some time back and I remember it was quite a task then.
Thankfully I had a head start this time !. Hope you get
the stuff sorted out. Glad to be of help ...

Regards,
Jayadas

-Original Message-
Sent: Thursday, April 03, 2003 4:34 PM
To: Multiple recipients of list ORACLE-L


Hi Jaydas,
Thanks for the reply.
It gives me a good starting point to go with. The query handles cases
where there are multiple rows.
For eg: U=2006 has G=1010 and S=1013. If there were another U=2010 with
same G=1010, then a rum through
the query would generate a S=1012 for this combination also as the min
checks for group_id in () and that will
evaluate any U belonging to a single group that is part of the multiple
groups that a U belongs to.

But I will take this query as a starting point and will work on getting
that resolved.
Thanks for your time and appreciate your help
Regards,
Madhavan
http://www.dpapps.com

On Thu, 03 Apr 2003 12:28:42 -0800, Chelur, Jayadas {PBSG}
[EMAIL PROTECTED] said:
 Madhavan,
 
 I have created a similiar table and inserted the data
 as follows :-
 
 =
 
 CREATE TABLE UT
 (
 U   NUMBER(4),
 S   NUMBER(4),
 G   NUMBER(4)
 );
 
 INSERT INTO UT VALUES(2005,1012,1010);
 INSERT INTO UT VALUES(2005,1012,1011);
 INSERT INTO UT VALUES(2006,1013,1010);
 INSERT INTO UT VALUES(2007,1017,1016);
 INSERT INTO UT VALUES(2008,1018,1010);
 INSERT INTO UT VALUES(2008,1018,1011);
 
 INSERT INTO UT VALUES(2009,1019,1016);
 INSERT INTO UT VALUES(2001,1020,1010);
 INSERT INTO UT VALUES(2001,1020,1011);
 
 COMMIT;
 
 ===
 
 this query will identify all the security groups and the
 minimum security group id of the identical one ...
 
 
 SELECT  DISTINCT
 S2.SORIGINAL_SG,/* original security group  */
 S3.SEQUIV_SG/* equivalent security group*/
 FROM(
 SELECT  S, COUNT(*) RECS
 FROMUT
 GROUP   BY S
 ) S1,   /* security groups and their group counts - table1 */
 (
 SELECT  S, COUNT(*) RECS
 FROMUT
 GROUP   BY S
 ) S2,   /* security groups and their group counts - table2 */
 (
 SELECT  DISTINCT S
 FROMUT
 ) S3/* just the unique security groups  */
 WHERE   S1.RECS = S2.RECS   /* match the sec. groups with the same record
 counts */
 AND S1.S S2.S /* make sure they are NOT the same security
 group*/
 AND NOT EXISTS  /* make sure they include identical group ids
 */
 (
 SELECT  G FROM UT WHERE S = S1.S 
 MINUS
 SELECT  G FROM UT WHERE S = S2.S
 )
 AND S3.S = ( /* see note */
SELECT MIN(S)
FROM   UT
WHERE  G IN
   (
   SELECT  G
   FROMUT
   WHERE   S = S1.S
   )
)
 
 /* note :
 this is to find the minimum value of the security id which has the same
 group
 id records as that any of the matching security groups. this minimum
 value
 can
 be used to update the security group ids of all other identical security
 groups
 at a later point of time
 */
 


 
 
 you can either change the query to update all the eligible security id to
 their corresponding minimum values or generate equivalent update
 statements
 using this query and run them as a batch ...
 
 HTH ...
 
-- 
Madhavan Amruthur
DecisionPoint Applications

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Madhavan Amruthur
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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

RE: SQL Question

2003-04-03 Thread Chelur, Jayadas {PBSG}
 and update the user_id 1006 to cgid 1012. But
I am not for some reason able
to apply this solution to the existing rows. I have a feeling that I am
missing something simple

The requirement that I am grappling with is to update the values in the
existing table. I can get the table b_hier_user_groups created from the
a_user_groups.

Please let me know if you need more information
The table structures are as below

a_user_groups

Name  Null?Type
 - 
 
 USER_ID   NOT NULL NUMBER
 SECURITY_GROUP_ID NOT NULL NUMBER
 GROUP_ID  NOT NULL NUMBER


Table b_hier_user_groups

Name  Null?Type
 - 
 
 USER_IDNUMBER
 CGID  --- same as security_Group_id from above)   NUMBER
 PARENT_VALUE   NUMBER
 CHILD_VALUENUMBER

Thanks for your time and help in advance.
Regards,
Madhavan
http://www.dpapps.com



-- 
Madhavan Amruthur
DecisionPoint Applications

-- 
http://www.fastmail.fm - I mean, what is it about a decent email service?
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Madhavan Amruthur
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chelur, Jayadas {PBSG}
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).