SQLplus command in a begin/end block

Hi all,
is it possible to use a SQLplus command (i.e. "@") inside a begin/end block , so in a plsql script ?
thanks in advance and regards
John

user10899797 wrote:
is it possible to use a SQLplus command (i.e. "@") inside a begin/end block , so in a plsql script ?Just a quick explanation why not.
That begin..end block is called an anonymous (nameless, unlike a procedure or function) PL/SQL block. The client (in this case, SQL*Plus) transmits the block to Oracle.
The server process servicing that client receives the block, parses it and executes it.
This server process only understands SQL and PL/SQL. Not any language.
So just as you cannot use .Net/Cobol/Visual Basic/Java/etc commands inside that PL/SQL anonymous block, you cannot use SQL*Plus commands in it.
Part of the confusion regarding SQL*Plus is using substitution variables. This enables you to create an anonymous PL/SQL block in SQL*Plus that contains substitution variables.
However, SQL*Plus itself does a very primitive parse of that block before it fires it off at the server - it detects these substitution variables and replace them with the assigned values for these variables. It then transmits this resulting block to the Oracle server for parsing and execution.
Just remember that PL/SQL is a server-side language that runs inside an Oracle server process and that should clear most confusion in this regard (including whether PL/SQL can read keyboard data or write to a client PC's harddrive, or interactively display progress status on a client monitor).

Similar Messages

  • How to start a trigger in a begin/end block ?

    Hi all, I need to start a trigger inside a block begin end in order to manage errors.
    The trigger is created inside trigger_faef_c.sql as
    CREATE OR REPLACE TRIGGER TRIGGER_FAEF
    and I would like to start the trigger in another file "create_trigger.sql" with this format:
    BEGIN
    @trigger_faef_c;
    EXCEPTION WHEN OTHERS THEN
    dbms_output.Put_Line('#255#> Error in trigger_faef_c ' || Sqlerrm );
    END;
    I have this error executing the script:
    PLS-00103: Encountered the symbol "@" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "<an identifier>" was substituted for "@" to continue
    Can anyone help me please ?
    I have to use EXCEPTION WHEN OTHERS THEN.
    Thansk
    Erik

    Hi Erik,
    I think you mean Create the trigger(?), i.e, executing the trigger_faef_c.sql script.
    SQL*Plus doesn't have exception handling (Someone please correct me if I'm wrong).
    One way to circumvent that is to rewrite the script itself to PL/SQL. Something like:
    Declare
       stmt varchar2(32767);
    Begin
       stmt := 'Create Trigger ....';
       Execute Immediate stmt;
    Exception
       When Others Then
           --Do what?
    End;
    /And then just execute that
    @trigger_faef_c.sqlDon't know if you want to go that way. I use it myself to be able to run the same deployment scripts multiple times, without causing various failures due to "Table Already Exists" and so on.
    But, for triggers, I would never do that, since this has CREATE OR REPLACE.
    For triggers, I just (This time script is plain static SQL)
    WHENEVER SQLEXCEPTION CONTINUE
    SPOOL deployment.log
    @trigger_faef_c.sql
    @other_script.sql
    SPOOL OFF
    EXITRegards
    Peter

  • Sequence of begin/end blocks.Delete only if updated.Updte only if row exist

    Here is a sequence of events I need to perform.
    1) I need to update a table with the systime for a given id.
    2) Commit (so that the systime is stored before I delete)
    3) Once updated, delete row from that table for the given id so that the row moves to the audit table with the updated systime - added in step 2.
    For this I need to keep the following things in mind:
    a) Update only if that particular id (passed as IN parameter to the SP) exists. That is validate existence before updating/deleting.
    Here are questions ralted to the above scenario:
    1) How is this kind of validation usuallty performed?
    2) Update and delete will be in 2 separate begin exception end block?
    Example
    begin
        begin
        update...
           commit
        exception
           rollback
        end;
    delete...
    commit
    exception
    rollbacl
    endHowever if update fails for some reason, I do not wish to come to the delete option.
    How can I take care of that?
    Edited by: [email protected] on Oct 20, 2008 9:47 AM
    Edited by: [email protected] on Oct 20, 2008 9:48 AM

    Mass25 wrote:
    The reason why I commit after doing the update is so that when I delete, what I have updated goes to the audit table.But that would only be necessary if it was a seperate session trying to read the data.
    If you update data on a table then your own session will see that data at existing on the table whether you have committed it or not, whilst other sessions will only see that data once it is committed.
    A commit should be issued when it logically makes sense, not just to try and ensure that the data is on the table for yourself.
    What would happen if you update some data, commit it, someone else reads it in their session and then you go and delete it? They have read your updated data whereas if they do a read before you delete then it's more logical that they should have read the pre-updated data.
    It seems like you are trying to incorporate more steps than are necessary to perform a simple task.

  • Error in Delare/Begin/End block

    Dear all
    i wrote a query to show all functions and procedures including their name,parameter,parameter type and return type
    I should say that using the structure delcare,begin,end is mandatory for me here.
    DECLARE
    BEGIN
    SELECT uo.object_name,ua.ARGUMENT_NAME,ua.DATA_TYPE FROM user_arguments ua
    join user_objects uo
    on ua.object_id=uo.object_id
    WHERE uo.OBJECT_TYPE IN ('FUNCTION','PROCEDURE');
    END;but i get this error
    Error starting at line 3 in command:
    DECLARE
    BEGIN
    SELECT uo.object_name,ua.ARGUMENT_NAME,ua.DATA_TYPE FROM user_arguments ua
    join user_objects uo
    on ua.object_id=uo.object_id
    WHERE uo.OBJECT_TYPE IN ('FUNCTION','PROCEDURE');
    END;
    Error report:
    ORA-06550: line 4, column 1:
    PLS-00428: an INTO clause is expected in this SELECT statement
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:I know that it may be mandatory to have "into" in select when we use delcare/begin/end.
    So would you please rewrite the query?
    im using oracle 11.2.0.2
    thank you in advance.
    best,david

    1003209 wrote:
    Dear all
    i wrote a query to show all functions and procedures including their name,parameter,parameter type and return type
    I should say that using the structure delcare,begin,end is mandatory for me here.
    DECLARE
    BEGIN
    SELECT uo.object_name,ua.ARGUMENT_NAME,ua.DATA_TYPE FROM user_arguments ua
    join user_objects uo
    on ua.object_id=uo.object_id
    WHERE uo.OBJECT_TYPE IN ('FUNCTION','PROCEDURE');
    END;but i get this error
    Error starting at line 3 in command:
    DECLARE
    BEGIN
    SELECT uo.object_name,ua.ARGUMENT_NAME,ua.DATA_TYPE FROM user_arguments ua
    join user_objects uo
    on ua.object_id=uo.object_id
    WHERE uo.OBJECT_TYPE IN ('FUNCTION','PROCEDURE');
    END;
    Error report:
    ORA-06550: line 4, column 1:
    PLS-00428: an INTO clause is expected in this SELECT statement
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:I know that it may be mandatory to have "into" in select when we use delcare/begin/end.
    So would you please rewrite the query?
    im using oracle 11.2.0.2
    thank you in advance.
    best,davidHi David,
    The query will throw error if the schema where you are executing has more than "1" function or procedure in the system.
    Its not clear in your requirement.
    Assuming you want to display the output
    SQL> set serveroutput on
    SQL> DECLARE
      2  CURSOR cur_obj IS
      3  SELECT uo.object_name,ua.ARGUMENT_NAME,ua.DATA_TYPE
      4  FROM user_arguments ua
      5   join user_objects uo
      6  on ua.object_id=uo.object_id
      7  WHERE uo.OBJECT_TYPE IN ('FUNCTION','PROCEDURE');
      8  BEGIN
      9  FOR rec_obj IN cur_obj LOOP
    10  dbms_output.put_line('OBJECT_NAME:'||rec_obj.object_name||' '||'ARGUMENT_NAME:'||' '||rec_obj.a
    rgument_name||' '||'OBJECT_TYPE:'||rec_obj.data_type);
    11  END LOOP;
    12  END;
    13 
    14 
    15  .
    SQL> /
    OBJECT_NAME:GETUSERORDERCOUNT ARGUMENT_NAME:  OBJECT_TYPE:NUMBER
    OBJECT_NAME:GETUSERORDERCOUNT ARGUMENT_NAME: REGKEY OBJECT_TYPE:NUMBER
    OBJECT_NAME:GETUSERORDERCOUNT ARGUMENT_NAME: PARTNERKEY OBJECT_TYPE:NUMBER
    OBJECT_NAME:GSK_ACCOUNT_FIRSTADDRESS ARGUMENT_NAME:  OBJECT_TYPE:NUMBER
    OBJECT_NAME:GSK_ACCOUNT_FIRSTADDRESS ARGUMENT_NAME: ACCOUNT_KEY
    OBJECT_TYPE:NUMBER
    OBJECT_NAME:SUMCONCAT ARGUMENT_NAME:  OBJECT_TYPE:VARCHAR2
    OBJECT_NAME:SUMCONCAT ARGUMENT_NAME: INPUT OBJECT_TYPE:VARCHAR2
    OBJECT_NAME:GSK_PB_SHOW ARGUMENT_NAME:  OBJECT_TYPE:NUMBER
    ...........Regards,
    Achyut K

  • Want to ignore exception in a begin-end block

    Hi,
    For a given plsql block (inside a procedure or function for example) I want to ignore a certain oracle exception. Ignore as in, it should not be raised at all.
    What I want to do is something like this -
    begin (tell somehow to NOT raise NO Data Found (NDF) )
    bq. select &lt;something&gt; \\ into  &lt;some Variable&gt; \\ from &lt;somewhere&gt;; \\ if sql%rowcount = 0 \\ then \\ +&lt;take action meant for NDF&gt;;+ \\ end if;
    end;
    Any Ideas ?
    cheers
    raghav..

    Justin,
    If you have queries that can properly return 0 or more rows, that is the natural way to implement that. It won't raise an exception if no data is found, it won't raise an exception if multiple rows are found.How can I write a query that would not raise an exception when 0 rows are returned ?
    I'm not clear on how a design can "not like the NDF as such". Why would you have to convert that to a business exception and pass it along to the caller? Why wouldn't you just handle the exception in your code if you expect that the NO_DATA_FOUND exception is valid.
    The design doesnt like NDF just because the end user has to receive a better response than "No Data was found". We want to include lots of contextual info about the error and the location etc. Even though the NDF is valid, I wont pass it along as such, I would probably convert it to a business exception which would probably say something like "no entities found for end client <ID>" etc..
    cheers
    raghav..

  • Performance: Cursor declaration versus explicit query in BEGIN/END block

    Hi guys!
    Anyone knows if declare an explicit cursor inside a pl/sql block is faster than using a cursor declaration, and how fast it its?
    Which block runs faster? And how fast? ( once, twice, once and a half ? )
    Block1:
    DECLARE
    CURSOR cur_test (p1 NUMBER) IS
    SELECT field1, field2 FROM table WHERE field0 = p1;
    vf1 VARCHAR2(1)
    vf2 NUMBER;
    n NUMBER := 0;
    BEGIN
    OPEN cur_test ( n );
    FETCH cur_test INTO vf1, vf2;
    CLOSE cur_test;
    END;
    Block2:
    DECLARE
    vf1 VARCHAR2(1)
    vf2 NUMBER;
    n NUMBER := 0;
    BEGIN
    BEGIN
    SELECT field1, field2
    INTO vf1, vf2
    FROM table WHERE field0 = n;
    EXCEPTION
    WHEN others THEN
    null;
    END;
    END;
    I have LOOP in a cursor and may open/fetch/closes in this loop. I´m wondering how fast would it be if I change the open/fetch/closes to explicit query blocks...
    Thanks!
    Murilo

    If you expect your qurey to return a single row, you would generally want to use a SELECT ... INTO. You'd only want to use a cursor if you expect to return multiple rows of data.
    If you are doing this in a loop, I would strongly suspect that you should be letting Oracle join the tables in SQL rather than doing your own pseudo-join logic in PL/SQL. Letting SQL do the work of joining tables is going to generally be a sustantial performance difference. The difference between the two blocks you posted will be marginal at best.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Exec SQLPLUS command from PL/SQL Block

    Good Morning:
    How I can execute a SQLPLUS command (like SPOOL or DESCRIBE) from PL/SQL Block Procedure?:
    DECLARE
    BEGIN
    ls_command = 'DESCRIBE '||ls_table_name;
    EXECUTE SQLPLUS(ls_command);
    END;
    Thanks a lot for any idea.

    That's correct.
    However, in the case of the given example we can use DBMS_DESCRIBE package to get table descriptions. And we can use UTL_FILE to spool PL/SQL stuff to a file.
    Cheers, APC

  • Using nested BEGIN..END Block....

    Hi,
    I am unable to use nested BEGIN..ENF Block.See error defined below
    BEGIN
            BEGIN
                    SELECT xcod_code INTO v_cmpy_xcod_code
                    FROM   ext_code_type
                    WHERE  xcod_code = sdiStruct.cmpy_xcod_code
                    AND    inst_borg_ind = 'B';
            EXCEPTION WHEN NO_DATA_FOUND
            THEN
                 erm := 'CMPY XCOD CODE not found with indicator of B';
                 RAISE err;
            END;
            BEGIN
                    SELECT  borg_num,borg_code INTO v_borg_num,v_borg_code
                    FROM    borg_code
                    WHERE   borg_code  = sdiStruct.cmpy_id
                    AND     xcod_code  = sdiStruct.cmpy_xcod_code;
            EXCEPTION WHEN NO_DATA_FOUND
            THEN
                    erm:= 'No borg num or borg code found for CMPY ID and CMPY XCODE CODE entered.';
                    RAISE err;
            END;
         EXCEPTION
         WHEN err THEN
         RAISE_APPLICATION_ERROR(-20001,erm);
    END;The ERROR I get is this
    LINE/COL ERROR
    113/3    PLS-00103: Encountered the symbol "RAISE" when expecting one of
             the following:
             . ( * @ % & = - + ; < / > at in is mod not rem
             <an exponent (**)> <> or != or ~= >= <= <> and or like
             between ||If I remove the 2nd nested BEGIN..END BLOCK,It works fine.
    Cant I write multiple BEGIN..END BLOCK??

    The error that you are receiving indicates that it happened on line 113 of your code, so you have obviously left out a whole lot. The portion of the code that you posted works fine, as long as you have all of the correspoinding pieces. I don't know if sdistruct is a package or a row of a cursor or what and I don't know your table structure, so I have just made something up, in order to demonstrate below. In the future, it helps if you include things like complete code and table structure and Oracle version.
    scott@ORA92> CREATE TABLE ext_code_type
      2    (xcod_code     NUMBER,
      3       inst_borg_ind VARCHAR2(1))
      4  /
    Table created.
    scott@ORA92> CREATE TABLE borg_code
      2    (borg_num      NUMBER,
      3       borg_code     NUMBER,
      4       xcod_code     NUMBER)
      5  /
    Table created.
    scott@ORA92> CREATE OR REPLACE PACKAGE sdiStruct
      2  AS
      3    cmpy_xcod_code NUMBER := 1;
      4    cmpy_id           NUMBER := 1;
      5  END;
      6  /
    Package created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> CREATE OR REPLACE PROCEDURE your_proc
      2  AS
      3    v_cmpy_xcod_code ext_code_type.xcod_code%TYPE;
      4    v_borg_num     borg_code.borg_num%TYPE;
      5    v_borg_code     borg_code.borg_code%TYPE;
      6    erm          VARCHAR2(80);
      7    err          EXCEPTION;
      8  BEGIN
      9    BEGIN
    10        SELECT xcod_code
    11        INTO     v_cmpy_xcod_code
    12        FROM     ext_code_type
    13        WHERE     xcod_code = sdiStruct.cmpy_xcod_code
    14        AND     inst_borg_ind = 'B';
    15    EXCEPTION
    16        WHEN NO_DATA_FOUND THEN
    17          erm := 'CMPY XCOD CODE not found with indicator of B';
    18          RAISE err;
    19    END;
    20    --
    21    BEGIN
    22        SELECT  borg_num,borg_code
    23        INTO      v_borg_num,v_borg_code
    24        FROM      borg_code
    25        WHERE      borg_code  = sdiStruct.cmpy_id
    26        AND      xcod_code  = sdiStruct.cmpy_xcod_code;
    27    EXCEPTION
    28        WHEN NO_DATA_FOUND THEN
    29          erm:= 'No borg num or borg code found for CMPY ID and CMPY XCODE CODE entered.';
    30          RAISE err;
    31    END;
    32  EXCEPTION
    33    WHEN err THEN
    34        RAISE_APPLICATION_ERROR(-20001, erm);
    35  END your_proc;
    36  /
    Procedure created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> EXECUTE your_proc
    BEGIN your_proc; END;
    ERROR at line 1:
    ORA-20001: CMPY XCOD CODE not found with indicator of B
    ORA-06512: at "SCOTT.YOUR_PROC", line 34
    ORA-06512: at line 1
    scott@ORA92> INSERT INTO ext_code_type VALUES (1, 'B')
      2  /
    1 row created.
    scott@ORA92> EXECUTE your_proc
    BEGIN your_proc; END;
    ERROR at line 1:
    ORA-20001: No borg num or borg code found for CMPY ID and CMPY XCODE CODE entered.
    ORA-06512: at "SCOTT.YOUR_PROC", line 34
    ORA-06512: at line 1
    scott@ORA92> INSERT INTO borg_code VALUES (1, 1, 1)
      2  /
    1 row created.
    scott@ORA92> EXECUTE your_proc
    PL/SQL procedure successfully completed.

  • SQLPLUS commands in SQL Developer

    We are using 11g with Sql Developer. We have some script such as healthcheck etc provided by oracle support, which has SQLPLUS commands in it.
    We are not able to run those in SQL Developer. We are getting errors.
    Are there any way, we could invoke SQLPLUS shell within SQL Developer?
    Thanks in helping.

    Hi qwe16235
    SQLPLUS command failed - not enough arguments
    line 36: SQLPLUS Command Skipped: set lines 300
    line 37: SQLPLUS Command Skipped: set pages 999
    These are formatting commands we do not do yet.
    The other command seems like an error in the middle of a PL/SQL block which we should have covered, just the start of it is not enough to know what the error is.
    An example of bad pl/sql error reporting:
    input:
    show parameter error <-------------- Dummy command so the plsql block does not begin at 1
    begin <----------------starting at line 3
    broken plsql; <------------- bad plsql at line (start)3+(from ora error)2 = 5 (should be 4 - must be one off)
    end;
    output:
    NAME TYPE VALUE
    sec_protocol_error_further_action string CONTINUE
    sec_protocol_error_trace_action string TRACE
    Error starting at line 3 in command:
    begin
    broken plsql;
    end;
    Error report:
    ORA-06550: line 2, column 8:
    PLS-00103: Encountered the symbol "PLSQL" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "PLSQL" to continue.
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    -Turloch
    SQLDeveloper team

  • Executing SQLPLUS command from Stored Procedure

    Hi,
    I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
    It is throwing below error message.
    Stored Procedure:
    SQL> select user from dual
    2 ;
    USER
    SYS
    SQL> create or replace
    2 PROCEDURE PROCEDURE1 AS
    3 BEGIN
    4 sqlplus sys/sys@D as sysdba;
    5 --execute immediate 'create user 'kkk' identified by 'kkk';
    6 END PROCEDURE1;
    7 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE PROCEDURE1:
    LINE/COL ERROR
    3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYS" to continue.
    3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol ". was inserted before "AS" to continue.
    Please let me know whether it is possible to do or not.
    If there is possiblility how can does this be done?
    Edited by: NGK246 on Aug 28, 2012 2:21 AM

    NGK246 wrote:
    Hi,
    I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
    It is throwing below error message.
    It would not. It will always throw an error. SQLPLUS is a Utility and not a Command/Construct, that it would be available for a Stored Procedure
    >
    SQL> select user from dual
    2 ;
    USER
    SYSWhich Database are you onto? Is it DMIP?
    SQL> create or replace
    2 PROCEDURE PROCEDURE1 AS
    3 BEGIN
    4 sqlplus sys/sys@DMIP as sysdba;
    5 --execute immediate 'create user 'kkk' identified by 'kkk';
    6 END PROCEDURE1;
    7 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE PROCEDURE1:
    LINE/COL ERROR
    3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYS" to continue.
    3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol ". was inserted before "AS" to continue.
    Please let me know whether it is possible to do or not.
    If there is possiblility how can does this be done?If you are at DMIP, you need not Login again. You can Login Manually to the Database and Execute the Procedure (in which you intend to create a User 'kkk').
    However, if you are trying to Create a User in a Different Database, You will first require a DB Link to exist to connect to the Remote Database. You will also require Explicit privileges to create any user (Although I am not sure if you can create User onto a different Database.)
    I would like to ask you, why are you creating a User on a Remote database? Can you not execute the same procedure on the Remote database and create User? Also, you are using SYS login to perform the activity. Ideally it should not be allowed. You must create a user and grant DBA rights to perform such activities.

  • How to hide the selection-screen Begin of Block

    Hi,
    I copied the standard program into my new 'Z' prog.
    But i dont need a selection-screen begin of block and end of block i.e. I have to hide the entire block from the output screen.
    I can delete the selction-screen block , but the field which is present inside the block is used in several places of program
    and i dont know the purpose of the fields.
    Can any one help me to hide the block.
    Thanks in advanced
    Regards,
    Darshana

    Hi
    Use keyword NO-DISPLAY with the select options or parameter which u want to hide in the selection screen.
    No need to comment statements Begin of block or end of block.
    SELECTION-SCREEN BEGIN OF BLOCK ss_01 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_month FOR isellist-month no-display .
    PARAMETERS: p_email LIKE somlreci1-receiver no-display.
    SELECTION-SCREEN END OF BLOCK ss_01.
    It will work this way.
    Thanks

  • (OEL 4.7) -bash: sqlplus: command not found after install of 10g R2

    Hi all
    I'm new to Linux and I would like your help and directions on a few things:
    After 2 days of battle with RPM's (i386 vs x86_64) i was finally able to install 10g R2 on OEL 4.7 x86_64 system without any errors.
    please check if all these settings are correct and help me how to start sqlplus? or create a database with dbca
    I followed all the directions in Doc ID: 339510.1.
    During installation i choose this path as the ORACLE_HOME
    /u01/app/oracle/product/10.2.0/
    I did not however installed the default database.
    I then ran the two scripts at the end of the installation as root.
    Here are my settings:
    oracle bash_profile:
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin
    export PATH
    unset USERNAME
    :q
    ORACLE_BASE=/u01/app/oracle
    export ORACLE_BASE
    ORACLE_HOME=/product/10.2.0/db_1;
    export ORACLE_HOME
    export PATH=$ORACLE_HOME/bin:$PATH
    here is my oracle env result
    [oracle@nycoralp01 /]$ env | grep -i ORACLE
    OLDPWD=/home/oracle/oraInventory
    USER=oracle
    ORACLE_BASE=/u01/app/oracle
    MAIL=/var/spool/mail/oracle
    PATH=/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin
    HOME=/home/oracle
    LOGNAME=oracle
    ORACLE_HOME=/product/10.2.0/db_1
    here is my echo $ORACLE_HOME result:
    [oracle@nycoralp01 /]$ echo $ORACLE_HOME
    /product/10.2.0/db_1
    Can someone please tell me what did i miss or did not set?
    When i try to run sqlplus i get this error
    [oracle@nycoralp01 /]$ sqlplus
    -bash: sqlplus: command not found
    Any help appreciated

    I change it in my bash_profile
    $ vi ~oracle/.bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin
    export PATH
    unset USERNAME
    :q
    ORACLE_BASE=/u01/app/oracle
    export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;
    export ORACLE_HOME
    export PATH=$ORACLE_HOME/bin:$PATH
    and i'm still getting the same error
    -bash: sqlplus: command not found
    Is there anything else i'm missing? do i have to restart anything?

  • LOV Select List How to create query with begin & End in LOV

    Dear All,
    i am using Apex 3.2 ver
    i want to use below code in LOV select list
    BEGIN
    IF  UPPER(:P23_SERVICE_TYPE) like 'GUIDE%' THEN
    SELECT NAME D, CODE R FROM SPECIAL_SERV_MAS
    WHERE NVL(ACTIVE_FLG,'N') = 'Y'
    AND NVL(GUIDE_FLAG,'N') = 'Y'
    and CITY_CODE LIKE NVL (:P23_CITY_CODE, '%')
    ORDER BY 2
    ELSIF
    UPPER(:P23_SERVICE_TYPE) LIKE 'ACCOM%' THEN
    SELECT   NAME D, CODE R
        FROM   HOTEL_MAS
       WHERE   NVL (ACTIVE_FLG, 'N') = 'Y'
               AND CITY_CODE LIKE NVL(:P23_CITY_CODE,'%')
    ORDER BY   PRIORITY
    END IF;
    END;When i put this code in my LOV Select list Section then display me Error
    Not Found
    The requested URL /pls/apex/f was not found on this server.
    Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at tidevserv1 Port 7777
    How to Resolve it.

    Hi Vedant,
    you dont need to use begin ...end block
    Try the Below code
    IF  UPPER(:P23_SERVICE_TYPE) like 'GUIDE%' THEN
    RETURN
    'SELECT NAME D, CODE R FROM SPECIAL_SERV_MAS
    WHERE NVL(ACTIVE_FLG,''N'') = ''Y''
    AND NVL(GUIDE_FLAG,''N'') = ''Y''
    and CITY_CODE LIKE NVL (:P23_CITY_CODE, ''%'')
    ORDER BY 2' ;
    ELSIF  UPPER(:P23_SERVICE_TYPE) LIKE 'ACCOM%' THEN
    RETURN
    'SELECT   NAME D, CODE R
        FROM   HOTEL_MAS
       WHERE   NVL (ACTIVE_FLG, ''N'') = ''Y''
               AND CITY_CODE LIKE NVL(:P23_CITY_CODE,''%'')
    ORDER BY   PRIORITY' ;
    END IF;In this way you can create conditional LOVs ,
    Hope this will helps you.
    Regards,
    Jitendra

  • AA6 - Move To Beginning/Ending Of A Selection And Deselect

    Hello...
    In AA3- you could make a selection, then click at the beginning/ending of the selection.  It would deselect the selection and move the play head to that position.
    In AA5.5 you had to use the left/right arrows to do the same task.
    In AA6, neither work.  If you left/right arrow, the play head moves but it moves down/up the timeline (not to the beginning/ending) and it doesn't deselect.  Ctrl+left/right arrow does move the play head to the appropriate places (as well as other places) but it doesn't deselect.
    Is there a way to do this with AA6?
    I used it a lot when doing track breaks for cd (home, shift+click at 5:00, f8, right arrow, shift+click at 10:00, f8, etc...).  I also used it where I wanted to have only 0.5 seconds of extra silence at the beginning/ending of some audio (click at the beginning of the audio, drag backwards 0.5 seconds, left arrow, shift+home, delete).
    JJ

    Since you're doing this for CD, I think I have a method that would be faster for you.
    1. Home, Shift+M (This sets the playhead to the start and places a CD Track Marker at the playhead).
    2. Click where you want this track to end and the next to start and again press Shift+M.
    3. Continue placing single point CD Track Markers at each location where you want the last track to end and the new one to start (including adding one to the very end).
    4. When all markers have been added, open the Markers Panel and select all the markers.
    5. Press the icon in the Markers Panel for "Merge selected markers".
    Now if you want to burn the CD, just go to "File > Export > Burn Audio to CD..." and we will burn a CD with track markers where you hae defined them.
    --Ron

  • ORACLE_HOME disappeared, SQLPLUS - bash: sqlplus: command not found

    OK, I am a newbie but am having real difficulty with my 10G DB which I had set up on Unix Solaris box but someone was messing around with it and now I can't see ORACLE_HOME, ORACLE_BASE and ORACLE_SID, they all return blank when I try to "echo" each.
    I realise I should have originally set it in Bash_profile, but is now too late.
    So how do I set them back up, I cannot get SQLPLUS / AS SYSDBA.........bash: sqlplus: command not found
    I have tried to reset and export but still doesn't work.
    I got the ORACLE_BASE as:
    training:/export/home/training/product/10.2.0/Db_1:N
    but can't seem to set the three variables to run SQLPLUS, any ideas what I am doing wrong?
    Tried messing around to reset but nothing works, this is the present state of affairs:
    env
    SSH_TTY=/dev/pts/3
    USER=training
    ORACLE_SID=training
    ORACLE_BASE=/oracle/app
    PATH=/usr/sbin:/usr/bin
    PWD=/export/home/training/product/10.2.0/Db_1/bin
    TZ=Eire
    PS1=\e[33m\h\e[31m-\u-\e[33m\W/\e[31m-$\e[32m
    SHLVL=3
    HOME=/export/home/training
    LOGNAME=training
    ORACLE_HOME=/oracle/app/product/10.2.0
    Can someone help me, really need a step by step guide to set these back up properly.
    Thanks

    just retyped the last one correctly:
    find / -name sqlplus -ls
    find: cannot read dir /var/lib/gdm: Permission denied
    find: cannot read dir /var/lib/log/gdm: Permission denied
    find: cannot read dir /var/mysql: Permission denied
    find: cannot read dir /var/dt/sdtlogin: Permission denied
    find: cannot read dir /var/core: Permission denied
    find: cannot read dir /var/run/smc898: Permission denied
    find: cannot read dir /var/spool/clientmqueue: Permission denied
    find: cannot read dir /var/spool/mqueue: Permission denied
    find: cannot read dir /var/fm/fmd/rsrc: Permission denied
    find: cannot read dir /var/fm/fmd/ckpt: Permission denied
    find: cannot read dir /var/fm/fmd/xprt: Permission denied
    find: cannot read dir /var/postgres/8.2/data: Permission denied
    find: cannot read dir /var/postgres/8.2/backups: Permission denied
    find: cannot read dir /var/sma_snmp: Permission denied
    find: cannot read dir /var/tmp/gconfd-root: Permission denied
    find: cannot read dir /var/tmp/orbit-root: Permission denied
    find: cannot read dir /var/krb5/rcache/root: Permission denied
    find: cannot read dir /var/opt/SUNWjass/run/20091012152456: Permission denied
    find: cannot read dir /.gconf: Permission denied
    find: cannot read dir /opt/SUNWlwact/misc/: Permission denied
    find: cannot read dir /opt/SUNWlwact/sdk/: Permission denied
    find: cannot read dir /opt/SUNWlwact/xsl/: Permission denied
    find: cannot read dir /opt/SUNWlwact/svc/: Permission denied
    find: cannot read dir /opt/SUNWlwact/man/: Permission denied
    find: cannot read dir /.sunw: Permission denied
    199411 1 -rw-r--r-- 1 training other 0 Jan 14 23:12 /export/home/training/sqlplus
    172460 2 drwxr-x--- 9 training other 9 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/sqlplus
    188055 10 -rwxr-x--x 1 training other 8776 Oct 27 18:00 /export/home/training/product/10.2.0/Db_1/bin/sqlplus
    184787 2 drwxr-x--- 3 training other 3 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/inventory/Templates/sqlplus
    184842 2 drwxr-x--- 3 training other 3 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/oc4j/j2ee/oc4j_applications/applications/isqlplus/isqlplus/WEB-INF/classes/oracle/sqlplus
    find: cannot read dir /root: Permission denied
    find: cannot read dir /proc/227: Permission denied
    find: cannot read dir /proc/832: Permission denied
    find: cannot read dir /proc/835: Permission denied
    find: cannot read dir /proc/458: Permission denied
    find: cannot read dir /proc/381: Permission denied
    find: cannot read dir /proc/624: Permission denied
    find: cannot read dir /proc/818: Permission denied
    find: cannot read dir /proc/2221: Permission denied
    find: cannot read dir /proc/290: Permission denied
    find: cannot read dir /proc/1166: Permission denied
    find: cannot read dir /proc/273: Permission denied
    find: cannot read dir /proc/229: Permission denied
    find: cannot read dir /proc/225: Permission denied
    find: cannot read dir /proc/478: Permission denied
    find: cannot read dir /proc/445: Permission denied
    find: cannot read dir /proc/815: Permission denied
    find: cannot read dir /proc/410: Permission denied
    find: cannot read dir /proc/432: Permission denied
    find: cannot read dir /proc/440: Permission denied
    find: cannot read dir /proc/427: Permission denied
    find: cannot read dir /proc/352: Permission denied
    find: cannot read dir /proc/443: Permission denied
    find: cannot read dir /proc/1352: Permission denied
    find: cannot read dir /proc/406: Permission denied
    find: cannot read dir /proc/2353: Permission denied
    find: cannot read dir /proc/670: Permission denied
    find: cannot read dir /proc/667: Permission denied
    find: cannot read dir /proc/405: Permission denied
    find: cannot read dir /proc/213: Permission denied
    find: cannot read dir /proc/16953: Permission denied
    find: cannot read dir /proc/1146: Permission denied
    find: cannot read dir /proc/2580: Permission denied
    find: cannot read dir /proc/27831: Permission denied
    find: cannot read dir /proc/444: Permission denied
    find: cannot read dir /proc/1338: Permission denied
    find: cannot read dir /proc/1350: Permission denied
    find: cannot read dir /usr/lib/cc-cfw: Permission denied
    find: cannot read dir /usr/aset: Permission denied
    find: cannot read dir /.gconfd: Permission denied
    find: cannot read dir /etc/flash/precreation: Permission denied
    find: cannot read dir /etc/flash/preexit: Permission denied
    find: cannot read dir /etc/flash/postcreation: Permission denied
    find: cannot read dir /etc/inet/secret: Permission denied
    find: cannot read dir /etc/apache/ssl.key: Permission denied
    find: cannot read dir /etc/sfw/openssl/private: Permission denied
    find: cannot read dir /etc/sfw/private: Permission denied
    find: cannot read dir /etc/webmin: Permission denied
    Looks a bit better:
    199411 1 -rw-r--r-- 1 training other 0 Jan 14 23:12 /export/home/training/sqlplus
    172460 2 drwxr-x--- 9 training other 9 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/sqlplus
    188055 10 -rwxr-x--x 1 training other 8776 Oct 27 18:00 /export/home/training/product/10.2.0/Db_1/bin/sqlplus
    184787 2 drwxr-x--- 3 training other 3 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/inventory/Templates/sqlplus
    184842 2 drwxr-x--- 3 training other 3 Oct 27 17:58 /export/home/training/product/10.2.0/Db_1/oc4j/j2ee/oc4j_applications/applications/isqlplus
    How to I run the sqlplus?

Maybe you are looking for

  • No warning for 'name clash' of static methods

    The background is that I am trying to design a package which allows conversion methods to be 'plugged-in' to a class within a class hierarchy so that users can choose how objects are converted to double values. (For example, a 'city-block' conversion

  • Internal error opening file with cs3

    Hi all, I can't open .png file created with fireworks cs3 :( I have error message (internal error...). I delete preferences, uninstall and reinstall software, but no solution. If someone can open it, thank you very much !! I spent lot of hours. http:

  • ClassCastException with Local Interfaces

    Hi, My environment is WLS6.1SP3 (JDK131) DB2 7.1 Windows 2000 I am trying to access an entity bean through it's local interface from a stateless session bean. I can see the jndi tree contains both remote and local names. I get the correct local home

  • Webdynpro ABAP Performance: SearchHelp

    Hi when we select a search help in wda it takes up to 4 seconds to show it and up to 4 seconds to go back to main screen again this slows down the maintenance server cpu usage is very low Webas700 SP15 what can we do to increase speed here? who is ex

  • Renaming the files present inside a war file.

    Hi, I am using the java.util.zip API for reading a war file(a zip file). I wanted to know whether its possible to rename a particular file present in the zip using this API. Thanks in advance.