CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle ENVIRONMENT VARIABLES
Version 11.1
 
Product Homes
Query to identify home directories for Oracle products
set linesize 131
set pagesize 20
col host_name format a30
col home_name format a20
col home_location format a50

SELECT *
FROM sysman.mgmt$software_homes;
 
Release Number
Release Number Demo
SELECT &_O_RELEASE FROM dual;
 
SQL%ROWCOUNT

Update Demo
CREATE TABLE t (
testcol VARCHAR2(10));

INSERT INTO t (testcol) VALUES ('ABCDEFG');
INSERT INTO t (testcol) VALUES ('ABCXEFG');
INSERT INTO t (testcol) VALUES ('ABCYEFG');
INSERT INTO t (testcol) VALUES ('ABCDEFG');
INSERT INTO t (testcol) VALUES ('ABCZEFG');
COMMIT;

BEGIN
  UPDATE t
  SET testcol = 'UPDATED'
  WHERE testcol LIKE '%D%';

  IF SQL%ROWCOUNT = 0 THEN
    INSERT INTO t
    (testcol)
    VALUES
    ('12345567');
  END IF;
END;
/

BEGIN
  UPDATE t
  SET testcol = 'UPDATED'
  WHERE testcol LIKE '%S%';

  IF SQL%ROWCOUNT = 0 THEN
    INSERT INTO t
    (testcol)
    VALUES
    ('0000000');
  END IF;
END;
/
 
Related Topics
DBMS_SYSTEM.GET_ENV
Exception Handling
System Events
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [82 users online]    © 2010 psoug.org