Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2009
    Posts
    7

    Question Unanswered: sql plus do not show errors!

    Hi all,

    I look through all sites from google to get know how i can turn off displaying errorrs but i dident find;

    for example:

    ALTER USER asd IDENTIFIED BY asd
    *
    BŁĄD w linii 1:
    ORA-01918: użytkownik 'ASD' nie istnieje

    i do not want to see this error!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    SQL> help WHENEVER SQLERROR
    
     WHENEVER SQLERROR
     -----------------
    
     Performs the specified action (exits SQL*Plus by default) if a
     SQL command or PL/SQL block generates an error.
     In iSQL*Plus, performs the specified action (stops the current
     script by default) and returns focus to the Workspace if a SQL
     command or PL/SQL block generates an error.
    
     WHENEVER SQLERROR {EXIT [SUCCESS|FAILURE|WARNING|n|variable|:BindVariable]
                        [COMMIT|ROLLBACK] | CONTINUE [COMMIT|ROLLBACK|NONE]}
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2009
    Posts
    7
    Thanks for replay,

    but hmm it still displaying error

    Code:
    WHENEVER SQLERROR CONTINUE NONE;
    
    ALTER USER &us IDENTIFIED BY &pw;

  4. #4
    Join Date
    Nov 2009
    Posts
    7
    I will explain - i want to make scipt with sql plus and sql no with the pl/sql to change user password. script must detect if user exist. what i have done:

    Code:
    ACCEPT us PROMPT 'User:'
    ACCEPT pw PROMPT 'New pass:' hide
    
    set pages 0;
    set wrap off
    set feedback off
    set verify off
    --set term off
    set head off
    
    
    WHENEVER SQLERROR CONTINUE SQL.SQLCODE;
    
    SELECT 
    	CASE
    		WHEN COUNT(*) = 0 THEN 'User not exist'
    		ELSE 'Pass changed succes'
    	END as "res"
    FROM All_users
    WHERE username = '&us';
    
    
    ALTER USER &us IDENTIFIED BY &pw;
    
    set wrap on
    set feedback on
    set verify on
    --set term off
    set head on
    But error still apears and break all of my work, please help

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Code:
    ACCEPT us PROMPT 'User:'
    ACCEPT pw PROMPT 'New pass:' hide
    
    set pages 0;
    set wrap off
    set feedback off
    set verify off
    set term off
    set head off
    
    declare
    cnt number;
    begin
    select count(*)
    from all_users
    where username = upper('&us');
    
    if cnt = 1 then
      execute immediate 'alter user &us identified by &pw';
    end if;
    end;
    /
    Please be aware that you must run as a dba to alter other users passwords. Also
    oracle already has a utility

    password username
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  6. #6
    Join Date
    Nov 2009
    Posts
    7
    Thanks for replay,

    But is ability to that without using this all pl/sql statment, only using sql plus and sql abbility??

    Best regards,
    Adam

  7. #7
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    The password command is built into sqlplus after Oracle 8i.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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