return values of PL/SQL Script Linux

Hi gurus,

I have a big problem...

The following script contains two parts: a PL/SQL and Linux shell script statements.

The PL/SQL computed value (day_id_day) and passes it to the instructions in Linux shell script (: v_salida: = day_id_day;) OUTPUT: v_salida).

The instructions in Linux shell script to get the value (NUM_PARTICION = $?), but the value of the var day_id_day differs from the value of $NUM_PARTICION... There is no errors in the code...

can someone help me?

Kind regards.

SCRIPT
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ORACLE_HOME/bin/sqlplus $ORAUSER / $ORAPASS < < eof

Set serveroutput on;

Number of v_salida VARIABLE;

DECLARE
v_error VARCHAR2 (1000);
number of day_id_day;
Start
Select (sysdate + 7) sp_general_func.get_day_id
in day_id_day
Double;

: v_salida: = day_id_day;

dbms_output.put_line(:v_salida);

end;

/
OUTPUT: v_salida
expressions of folklore

NUM_PARTICION = $?

echo $NUM_PARTICION

Better try this:

ORAENV_ASK='NO'
ORACLE_SID='ORCL'
. oraenv
ORAUSER='myUserid'
ORAPASS='myPasswd'
NUM_PARTICION=`
$ORACLE_HOME/bin/sqlplus -s $ORAUSER/$ORAPASS <

: p

Tags: Database

Similar Questions

  • BPEL does not receive "return value" of MS SQL, stored procedure

    Hello

    We are facing this problem citing a MS SQL stored procedure the BPEL (jdbc 1.2 driver). We have created the wsdl for the stored procedure correctly using a command line utility tool provided with Oracle SOA Suite.
    But the question is THAT BPEL is not able to get the data present in the statement of "return" of the procedure. We receive null output. But it is able to extract the data from the output variable, if any. Case 1 below is for the return statement. Case 2 is for the output variable


    Case 1: in the following, the output is returned using the return statement. The BPEL that calls this procedure is to obtain a NULL value as an answer to this.


    ALTER PROCEDURE [dbo]. [AddNumbersRet]
    -Add the parameters for the procedure
    @Number1 int,
    @Number2 int
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    Return (@Number1 + @Number2);
    END

    Case 2: in the following, the output is returned using the SumOfNums output variable. The BPEL that calls this procedure is to obtain a correct answer.


    ALTER PROCEDURE [dbo]. [AddNumbers]
    @Number1 int,
    @Number2 int,
    @SumOfNums int output
    AS
    BEGIN

    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    Set @SumOfNums = (@Number1 + @Number2);

    END



    Case 1 is a failure and case 2 is successful. We cannot change our procedures similar to case 1 to use variables of output because of dependencies on other applications.

    All the world is facing this problem? This looks like a bug in BPEL. Please, share your experiences.


    Thanks and greetings

    Mohan

    Published by: user10980910 on December 8, 2009 05:16

    There is a gap in the command line utility that was addressed in the adapter configuration (AS11gR1) Wizard. The API is a procedure, not a function, so does not return the query for the parameters that the utility made anything for the RETURN statement.

    The adapter configuration wizard is unable to say if there is a RETURN statement either, but it provides the user with a check box that can be used to indicate the presence of the declaration. In the wizard, if you check the checkbox, a parameter is added to the XSD to the RETURN statement. In essence, the adapter will process the procedure as a function and you will get the value of the PERFORMANCE.

    Usually, I wish to indicate that you certainly should NOT change the generated XSD. But you might be able to do it, by adding the necessary element to the OutputParameters for your RETURN statement. Add the following immediately AFTER the element of 'Lines', which occurs first in the XSD and BEFORE all items for the other none.

    Use a value for the "" that is meaningful to you. The wizard uses the name of the stored procedure with the name of the element. We could call this "RETURN_VALUE" or else if is more to your liking. Add the item after you generate the XSD using the command line utility, and then use the XSD when you model your BPEL processes. The WSDL should already have the content for this element handling.

  • How to return the value of the SQL in the text element

    Hi friends

    I need you to guide me how I can print the return value of the SQL in a text element

    Suppose it's your function
    create or replace function get_value
    return number
    is
    begin
    return 3*2;
    end;
    /
    any help that I enjoyed

    Thank you

    >

    http://i46.Tinypic.com/11l0s5h.jpg

    This is ORA-06502: PL/SQL: digital error or value.

    Check the data type and size for items of text or any other variables or fields in the service.

  • Call of from.mxl under linux .sql script file

    Hello Experts,

    I have a requirement to call the sql script in the maxl file in the linux server. I get EOF file error.

    Could you please say how to achieve this requirement.

    MAXL Script:

    Reel to ' / / essbase02//MaxL//Test_MR.log ';

    the value of message level.

    Set timestamp

    echo 'start logging ';

    login "admin", "password" on 'server '.

    echo "beginning of sh execution."

    MSH ' / / essbase02//MaxL//Test_MR.sh';

    / * Create label * /.

    echo "Completed";

    disconnection;

    spool off;

    Contents of the Test_MR.sh file:

    sqlplus-s user@orcl/password @"' / / essbase02//MaxL//TEST.sql '"


    Journal for the maxl:

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    'Start of logging.

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > login "admin" "admin" on "server1.hq.emirates.com";

    OK/INFO - 1051034 - [admin@Native Directory] user connection.

    OK/INFO - 1241001 - connected to Essbase.

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    "Beginning of HS performance."

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > sqlplus-s user@orcl/password @ "/ essbase02/MaxL/TEST." SQL ".

    2 >

    3 >

    4 >

    essmsh error: end of file breaks the statement

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    "Completed".

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > disconnect;

    The user admin is offline

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    Thank you

    RM

    If you want to execute operating system commands you use Shell, not "msh". MSH is to call an additional MaxL script with MaxL orders only.

    Optionally, there should be no need to store the command shell in a separate file, that is, it should be possible to place the command sqlplus directly inside the MaxL script when you use the Shell.

  • vmrun return value? How to tell a script execution vmrun host-side errors?

    Host: MacBookPro, OSX 10.4.11, core 2 duo, 2 GB ram

    Client: Windows XP with service pack 3 installed

    Apart from something like this:

    if vmrun -T fusion -gu Administrator -gp pass copyFileFromGuestToHost /Users/me/Documents/Virtual\ Machines.localized/Windows\ XP\ Professional.vmwarevm/Windows\ XP\ Professional.vmx "c:\CyberExtruder\Flixor\dst\im_mesh.obj" /Users/me/fromVMWareWin32/im_mesh.obj &> /dev/null; then returnValue=0; else returnValue=1; fi
    

    Where I create a return value for vmrun of the existence of an exit error message... Another way to know if a call to vmrun succeeded?

    Although I am simply called copyFileFromGuestToHost in this example, I'm working on a side script host running several programs on the client that may fail. I can tell if they fail for lack of output files, so if a fails to CopyFileFromGuestToHost I know that just called comments executable failed.

    Advice?

    The standard * NIX is to return error codes via the variable $ shell? Thus, for example:

    etung$ /Library/Application\ Support/VMware\ Fusion/vmrun list
    (output omitted)
    etung$ echo $?
    0
    etung$ /Library/Application\ Support/VMware\ Fusion/vmrun something-that-doesnt-exist
    Error: Unrecognized command: something-that-doesnt-exist
    etung$ echo $?
    255
    
  • Impossible to retrieve the return value of function from pl/sql using the DB adapter

    Dear Experts,

    I use the DB adapter in my BPEL process. Using the DB adapter I invoke a PL / SQL function. I am able to send two input parameters for the pl/sql function. But I do not know how to retrieve the return value of the function. Please suggest me.

    Thank you
    Rajesh

    Can you tell how pl/sql function looks like you? you return the value of the function, right?

  • PL/SQL exception handling and return values

    Hi all

    I use Oracle 10.2.0

    I have a problem in the return values of the procedures if there is no exception.

    For example:

    procedure a.
    (
    P_in number,
    p_out on varhar2
    )
    as
    p_valid varchar2 (10);
    number of p_no1;
    Select 1 in double p_no1;
    B (p_valid, p_no);
    exception when others then
    c (errmsg);
    end;
    put an end to;
    procedure B
    (
    p_in number,
    p_valid out varchar2
    )
    as
    fake number;
    Select 1 in double dummy;
    dummy cases = 1
    then
    p_valid = "OK".
    C (MSG);
    end;
    exception when others then
    p_valid = "OK".
    C (errmsg);
    end;

    end b;
    In the example if theres no exceptions or dummy = 1 in procedure B, then I need to return the value as 'OK' in the setting out of the parent procedure "A".

    I could not this value, returning null. How to get this...

    Please advice...

    TIA,

    ORCLDB wrote:
    Hi all

    I use Oracle 10.2.0

    I have a problem in the return values of the procedures if there is no exception.

    Ok

    The code you have posted is not valid code if you have forgotten some important things. However, we will make it simple...

    If you have a set OUT that will not be filled if an exception is thrown, unless it is set to NOCOPY.

    Example of...

    Here, we regularly parameter output and when an exception occurs in procedure B it REVIVAL of the exception to the procedure a...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8    raise;
      9* end b;
    SQL> /
    
    Procedure created.
    
    SQL> create or replace procedure A (p_in in number) as
      2    v_valid varchar2(10);
      3  begin
      4    B(p_in, v_valid);
      5    dbms_output.put_line('Returned without exception: '||v_valid);
      6  exception when others then
      7    dbms_output.put_line('Returned with exception: '||v_valid);
      8    raise;
      9  end A;
     10  /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned with exception:
    BEGIN a(2); END;
    
    *
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.A", line 8
    ORA-06512: at line 1
    

    Obviously, when the procedure B raised an exception it went directly to the procedure exceptions A manager that indicates that an exception has happened and the value returned in the OUT parameter was NULL.

    Now, if procedure B just handles the exception rather than erect in...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8* end b;
    SQL> /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned without exception: EXCEPTION
    
    PL/SQL procedure successfully completed.
    

    Here, procedure B fills the output parameter and just returns execution to the block to execute procedure A, so A procedure isn't aware of no exception, but the output parameter does not contain the value B populated with.

    But if you want the procedure B to throw the exception and pass out a value in the output parameter, you must set the out parameter as NOCOPY...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure B (p_in in number, p_valid out NOCOPY varchar2) as
      2    dummy number;
      3  begin
      4    select 1 into dummy from dual where p_in = 1;
      5    p_valid := 'OK';
      6  exception when others then
      7    p_valid := 'EXCEPTION';
      8    raise;
      9* end b;
    SQL> /
    
    Procedure created.
    
    SQL> exec a(1);
    Returned without exception: OK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec a(2);
    Returned with exception: EXCEPTION
    BEGIN a(2); END;
    
    *
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.A", line 8
    ORA-06512: at line 1
    
    SQL>
    

    Now, as in the first example, procedure B defines the output parameter and throws the exception, causing execution to go directly to the procedure A exception handler, but this time, A procedure return parameter value out.

    To understand the execution of blocks and managing exceptions take a look at this article...

    [PL/SQL 101: exception handling | http://forums.oracle.com/forums/thread.jspa?threadID=697262&tstart=50]

    ;)

  • How to run multiple parallel sql scripts?

    I try to execute multiple sql scripts parallel to the short run of the process via sqlplus. Are there opportunities to do? LINUX ORACLE 5. XX

    I do it too via Scheduler, but now I need to do this via sqlplus or shell + sqlplus?

    How do I start using shell script several xterminals and ech session begins all the sql scripts?

    nohup./SQL1.sh &

    nohup./sql2.sh &

    nohup./SQL3.sh &

    The '&' causes the script1.sh to run in the background so that the command prompt is returned immediately.  This means that sql2.sh can start immediately and at the same time as sql1.sh.  It doesn't have to wait for sql1.sh.   This assumes that there are no dependencies between scripts!  This meets your need to run scripts in parallel.

    The nohup untie your shell script.  So, even if you disconnect, the script continues to run.  Without the nohup, if you were to close your session before the end of the scripts running, they would get fired.

    Hemant K Collette

  • question about pl/sql script

    Hi all
    I need to manage other tables that will contain as follows:
    whenever the user query it will be an insert in this table called mng_rishui_session that contain
    track:
    NUM of user's session id,
    Date and time of execution of the request,
    type of query
    every 15 minutes, I need to delete the data of the user of some the various tables according to the type of the query.
    the tables that contain the data:
    mng_rishui_session / / DESC
    session_id_num NOT NULL VARCHAR2 (30)
    type_query not null number (2)
    date of time_query
    I want to write a pl/sql script like this:
     
    declare cursor c1 as 
    select session_id_num,type_query 
    from mng_rishui_session 
    where time_query (/*here i need to do the condition that 15 minutes has passed from the time query 
     i don't know how to do this */
    begin 
    for e in c1 loop 
    
    case e.type_query 
    when 1 
    delete query1_table where session_id_num :=e.session_id_num;
    when 3 
    delete query3_table where session_id_num :=e.session_id_num;
    end
    end loop;
    end;
    issues related to the:
    1. how to check if 15 minutes where the past
    2. it is good to do with loop for writing valid deletion in the loop
    or do I have to do it another way to write this.
    Thanks in advance
    Naama

    Hi, Naama,

    Naama wrote:
    ... now my script looks like this:
    mng_session. SQL

    
    declare cursor c1 as
    select session_id_num,type_query
    from mng_rishui_session
    where  (sysdate - t_query) * 24 * 60 >= 15;  
    
    begin
    for e in c1 loop
    case e.type_query
    when 1 then
    delete query1_table where session_id_num = e.session_id_num;
    when 3 then
    delete query3_table where session_id_num  =e.session_id_num;
    end case;
    end loop;
    end;
    

    first of all, I want to know where I'm going to do the validation, if I need to do.

    In the PL/SQL code (so we won't do it in case of error) but after the LOOP is finished.
    In other words, assuming you are using a LOOP. It will be much more effective if you just do a DELETE statement on each table. Think about it: If your mng_rishui_session has 1,000 rows where t_query (or time_query, if the column is always so called) is fortunate to have one of the type_queries you want at least 15 minutes, and 100 of these lines, then you must fetch the 1,000 rows (if not all of the table) , and separate 100 DELETE queries. It is more effective to extract 100 lines (assuming that there is an index composed of type_query and t_query) and to only 2 DELETE statements. See below.

    Second:
    I run this script through linux system, in order to head to sleep.
    My problem is that I am trying to append the output of script;
    but it won't let me

    People on this site will try to help you. Why not try to help them do it?
    Do not say "he won't let me": show all that you know the problem. What exactly have you tried? That's happened? If you got an error, display the full error message, including the line number. If you got the wrong results, describe what happened.

    My goal is:

    a script running the sql scripy called:
    CS-mng-session:

    #!bin/bash
    sqlplus user/passwd@dbname @mng_session /*mng_session is the script were i declare the cursor etc.*/
    in the command line i want to write :
    (sleep 600; sh cs-mng-session)& 
    

    the problem is that if I do not exit. He recorded in sql and the script does not return to the command line.
    How do I overcome this problem?

    Make an EXIT.

    Try something like this:

    DECLARE
         cutoff_date     DATE     := SYSDATE - (15 / (24 * 60));
    BEGIN
         DELETE     query1_table
         WHERE     session_id_num  IN (
                             SELECT  session_id_num
                             FROM     mng_rishui_session
                             WHERE     type_query     = 1
                             AND     t_query          <= cutoff_date
                           );
    
         DELETE     query3_table
         WHERE     session_id_num  IN (
                             SELECT  session_id_num
                             FROM     mng_rishui_session
                             WHERE     type_query     = 3
                             AND     t_query          <= cutoff_date
                           );
    
         COMMIT;          -- If desired
    END;
    /
    
    EXIT;
    

    Is there a reason why query1_table should be different from query3_table? Why can't you have just a query_table, with a column of type_query?

    What happens if there is an error? You won't want to know? You must add an EXCEPTION section to write the details about the error in a log table and someone send an email on this subject.

    Published by: Frank Kulash, August 31, 2010 09:07
    Added / issue;

  • How to get the return value in sqlplus to index?

    Hello

    I am a PL/SQL Developer, and I have a problem with an existing batch.

    Here's the situation:
    I have a lot of unix, calling a first script sql with sqlplus (call script0.sql )
    script0. SQL call other scripts sql with the command @ (script1.sql, script2.sql,... = > scriptx.sql )
    My version of sqlplus is 9.2.

    ScriptX.SQL modifies the data in table with insert or update and not commit or rollback anything (it is in charge of script0.sql ).
    If there is an error produced in a clue all changes must be rollbacked.
    Unfortunately when something fails, it returns only to script0.sql without any information on his breaks down, so continuous script0.sql and when he arrivals all changes are committed because the State of script0.sql is successful when the exit is made.

    Is there an equivalent of the $? UNIX in sqlplus to obtain the return of a status @scriptx.sql?

    -----
    Here is the general syntax of the script0.sql :

    WHENEVER SQLERROR EXIT 99;
    WHENEVER OSERROR EXIT 98;

    @script1.sql
    @script2.sql

    "exit";
    -----

    Here's a simple scriptx.sql file:

    Insert into table values (x) (y);

    -----

    Published by: user10713865 on October 30, 2009 06:51

    Hello

    You can use 'Whenever SQLERROR WHAT' options to build the logic.
    Use: 'every time THAT SQLERROR EXIT DISMANTLING', if you want to there are a whole script error
    OR "WHEN SQLERROR CONTINUE ROLLBACK", if you want to restore and continue to the next.
    You might explore other options 'whenever SQLERROR WHAT' to suit your logic and add "COMMIT / ROLLBACK" to not relevant.

    See sample tests below:

    SQL> create table t1 (col1 number primary key);
    Table created.
    

    * 1. In script1 case fails, then restore and exit *.

    kallo:f632736> cat 1.sql
    WHENEVER SQLERROR EXIT ROLLBACK
    insert into t1 values(1);
    insert into t1 values(1);
    kallo:f632736> cat 2.sql
    insert into t1 values(2);
    kallo:f632736> cat main.sql
    @1
    @2
    
    SQL> @main
    
    1 row created.
    
    insert into t1 values(1)
    *
    ERROR at line 1:
    ORA-00001: unique constraint (ADMLHMGM.SYS_C0013874) violated
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select * from t1;
    
    no rows selected
    

    * 2. When script1 fails, then restore and continue to script2 *.

    kallo:f632736> cat 1.sql
    WHENEVER SQLERROR CONTINUE ROLLBACK
    insert into t1 values(1);
    insert into t1 values(1);
    
    SQL> @main
    
    1 row created.
    
    insert into t1 values(1)
    *
    ERROR at line 1:
    ORA-00001: unique constraint (ADMLHMGM.SYS_C0013874) violated
    
    Rollback complete.
    
    1 row created.
    
    SQL> select * from t1;
    
          COL1
    ----------
             2
    
  • How to use the return value of TestComplete (using COM) as a variable in the conditional statement (for example loops) TestStand

    Hello

    I have setup a COM interface for TestStand (TS) to run some scripts in TestComplete (TC).  Normally, when TestComplete has finished executing the script, it returns a 0 or 1 to designate the success/failure during the TestStand step (step test for example String value).  It worked well.

    However, now I need TestComplete to regain a vaule (e.g. 32) TS and TS need to assess this value in a while statement. So if the TC value is 32, I would have some statement in TS ike:

    While (return value! = 30)

    Do something...

    Thank you

    Jigg,

    No, the program does not have a new thread.  It's just a single sequential thread. She called other sequential files, and that's all.

    I think I'll have some luck with the StationGlobal.  It seems to work (for example by setting the StationGlobal a single sequence file automatically updates the Stationglobal in another movie file, sort of like passing the reference value)

    Thank you!

  • Executed as user: domain\username. The return value is unknown. The process exit code was 128. The step failed.

    I have a job with 20 steps. This error occurs for any stage of perticular. It produces randomally at any stage.

    "The return value is unknown.  The process exit code was 128.  The step failed. »

    This is not the right forum for SQL database issues.

    Please repost your question in the MSDN SQL forum
    http://social.msdn.Microsoft.com/forums/en-us/sqldatabaseengine/threads

    Sincerely,

    Marilyn

  • Update SQL script

    Hi friends,

    I started this thread yesterday, but for some reason that I'm not able to answer/continue on this old thread. Here are the details from the old thread

    I need help with a sql script to update sid_no_new column with values based on sid_no for about 6000 + records.

    Here is an example below...

    SQL > select * from test1;

    SID_NO SID_NO_NEW UNIT_NO

    --------------------         --------------------           --------------------

    2000                                                          unit1

    2000                                                          unit3

    2000                                                          unit4

    2002                                                          unit16

    4500                                                          unit22

    In the example above, there are 3 sid_no consecutive '2000'. Sid_no_new must be 2000_1, 2000_2, 2000_3, respectively.

    It should be like:

    SQL > select * from test1;

    SID_NO SID_NO_NEW UNIT_NO

    --------------------      --------------------           --------------------

    2000 2000_1 unit1

    2000 2000_2 unit3

    unit4 2000_3 2000

    2002 2002 unit16

    4500 4500 unit22

    I ran the script (thanks to the experts who have contributed to) below, it works very well for the above documents, but I get ORA-30926 error when I run on the table with 6000 records...

    Fusion IN test1 tgt USING

    (SELECT sid_no,

    sid_no_new,

    unit_no,

    Count (sid_no) over (partition BY sid_no) cnt,

    ROW_NUMBER() over (partition BY order of sid_no to unit_no) rn

    OF test1

    ) CBC ON(tgt.sid_no=src.sid_no AND tgt.unit_no=src.unit_no)

    WHEN matched THEN

    UPDATE SET Sid_no_new = CASE WHEN cnt > 1 THEN sid_no |' _'. RN ELSE sid_no END;

    ERROR on line 1:

    ORA-30926: failed to get a stable set of rows in the source tables

    Please give your suggestions... Thank you very much

    In fact, this could be done easier:

    SQL > select *.

    test1 2

    3.

    SID_ SID_NO UNIT_N

    ---- ------ ------

    2000 2000_1 unit1

    2000 2000_2 unit3

    unit4 2000_3 2000

    2002 2002 unit16

    4500 4500 unit22

    SQL > select *.

    2 of test4

    3.

    UID_NO TYP RULE_DUE

    ---------- --- ----------

    RAF 2000 90

    3140 TH 100

    6712 JUL 21

    233 12 H6

    SQL > fusion

    2 in d of test4

    3 use)

    4 with as t4)

    5. Select uid_no,

    6                               type,

    7                               rule_due,

    8 rowid RID,

      9                               uid_no || '_' || ROW_NUMBER() over (partition by uid_no by 1 order) sid_no_new

    10 of test4

    11                      )

    12. Select t1.sid_no_new,

    T4.type 13,

    T4.rule_due 14,

    15 cases

    16 when t1.sid_no = t1.sid_no_new then t4.rid

    17 when t4.sid_no_new = t1.sid_no_new then t4.rid

    18 end rid

    19 of t4,

    Test1 20 t1

    21 where t1.sid_no = t4.uid_no

    22          ) s

    23 on)

    24 d.rowid = s.rid

    25       )

    26 when matched

    27 then

    Update 28

    29 set d.uid_no = s.sid_no_new

    30 when no match

    31 then

    32 insert

    33 values)

    s.sid_no_new 34,

    s.type 35,

    36 s.rule_due

    37                )

    38.

    3 lines merged.

    SQL > select *.

    2 of test4

    3.

    UID_NO TYP RULE_DUE

    ---------- --- ----------

    2000_1 RAF 90

    3140 TH 100

    6712 JUL 21

    233 12 H6

    2000_3 RAF 90

    2000_2 RAF 90

    6 selected lines.

    SQL >

    SY.

  • The list of values - return value identical to the display value

    I fill a selection list with the names of the members with a lov sql like the following

    < tt > select memberName d, r FROM whateverTable < /tt > memberId

    The problem is that in the database, the stored value is the Member ID. I really want the real memberName stored in the database instead I want to use this name of Member elsewhere in my application.

    When the integrated trigger executes its code

    < tt >

       if NVL (:old. CONTACT_PERSON,'0') ! = NVL (:new. CONTACT_PERSON,'0'( ) then

    Insert into eba_ca_history ()table_name component_rowkey COMPONENT_ID column_name old_value new_value) values

           ('EVENTS', :new.row_key, :new.event_id, 'EVENT_OWNER',:old. CONTACT_PERSON,:new. CONTACT_PERSON()

       end if ;

    < /tt >


    I get the following text shows on my apps update page-"owner of an event has changed from 457879885611315631565 to 2546454654546546546546..."

    lov.PNG

    I want the value of the actual display to display for an update instead of the return value.


    I tried to convert the value to help

    lov2.PNG


    But which causes the following error


    lov3.PNG


    How can I make sure that the return value of the lov being stored in the database matches the display value for the lov?

    Hi Richie,

    If I understand your request, simply set your LOV query with the same column like screen and return:

    select memberName as display_value, memberName as return_value FROM whateverTable
    

    If this isn't what you're asking, I apologize for the misunderstanding.

    Thank you

    Erick

  • passage OEM "SQL Script" job name in lowercase as proxy database

    Hello

    I have a SQL script that requires the name of the database in lower case to be passed when running - she uses it as a substitution variable to create database directories that point to the UNIX file system (which is why they are case sensitive). I want to be able to configure this script as work in OEM (12 c version 3) so that I can run on several databases (11.2.0.3), but at the creation of employment, the % DBName parameter returns only the name of the database uppercase. I tried to change the % DBName parameter and run the script in a PL/SQL block, but the variable I spend it is interpreted as a literal string. I also tried to run in a shell script, but because of the way the user operating system is set up that I can't get that to work either.

    Does anyone have any ideas how this can be done? Ideally, I wish I could just run @script lower (%DBName%) or something similar.

    Thanks in advance,

    Robin

    In case anyone else has trouble with this, I worked on that I was able to use a PL/SQL block to convert the variable substitution for lower case, then create the directory with the variable:

    DECLARE

    v_lowerSID varchar2;

    BEGIN

    Select lower ('& 1') in the double v_lowerSID;

    run immediately ' create the db_dir as directory "/ [path] /' | v_lowerSID | '/' || v_lowerSID | ' _directory1 "';

    END;

    /

Maybe you are looking for

  • Since upgrading to firefox 26, I get a lot of pop-up windows

    Good so I was using Firefox as my main browser for years. I have little to NO problems with it, but lately the problem of the shock wave. But this isn't a big deal. My problem is with Firefox 26, I was informed of an update for it this morning and I'

  • Pavilion g6: HP Pavilion g series system disabled

    When I start the system all of a sudden he asks me a password for administrator. I tried to guess the password and then it just says: System disabled with the following error code: 76207065 Please help, I need to solve this problem in all away today.

  • EOS 50 d, Flash problems

    I tried to take a picture that required the use of a flash. Him build-in flash "should have" popped up, but it did not. I couldn't, electronically via the flash button, do come. After going to the 'Flash' settings, under '' integrated '' I got the me

  • Computer doesn't turn off not from the Start button on the desktop?

    office up I push the Start button, and then select shut down, and then select farm in the menu drop down and he goes as far as "shutting down" display on the desktop, but will not proceed from there and stop.  Everything continues to display "shuttin

  • What should I do MANUALLY (photos) files in a folder?

    How do I MANUALLY organize files (photos) in a folder and KEEP this particular order so that when I run the 'Slide show' option, it will go through the photos in the order that I want to, and not in the alphanumeric sort by file name order?  Even if