Update a record questioned using the parameter

Hi all

Have someone to help me to update an interviewed record of forms. It's like that when I use ID to search for the details, I want to update the record you are searching.

Arif

Hi Arif,
Here you're doing something complicated with you.

1 UCID_PARAM and USERCREATION are 2 revenge in the same form
2 UCID_PARAM contain column UCID which is the primary key of the table usercreation. I used this block to pass

The blockk UCID_PARAM here is the database block and why you must pass the value as a parameter because as you say it is primary key and foreign key in the block. Then why do you use search mechanism Assembly. I mean just create relationship between UCID_PARAM and USERCREATION block or if he joins then just use the method ENTER_QUERY and EXECUTE_QUERY. I understand because if you enter a value in the UCID_PARAM block and goes to the block of detail and do EXECUTE_QUERY by selecting a WHERE CLAUSE.

So, what's going to happen here. System takes into account that you are inserting record in UCID_PARAM. So, there is a field that is not null, then the error is coming.

Just use the default behavior of your forms. Or if you really want to use this method. Next, create a block of data non-base to pass the parameter. Do not use UCID_PARAM as the database block.

And one more thing, I noticed in your this clause

set_block_property ('USERCREATION', onetime_where, 'UCID =' |) ': UCID_PARAM. UCID');

It should be

set_block_property('USERCREATION',onetime_where,'UCID='||:FORM_FIELD_NAME);

I hope it is clear now.

-Clément

Tags: Oracle Development

Similar Questions

  • Can I get the contacts and email from an old record without using the Migration Wizard?

    Can I recover Contacts and messaging of an old record without using the Migration Wizard? Disc of the user in question has been very corrupted with several programs having a weird behavior. Migration wizard migrated corrupt files, so, even a clean install with only migrated users gave rise to an unusable installation.

    I have now all own installed now, but need old email files and contacts. How can I transfer this information a copy of the old/bad drive and only this info?

    Yes. With the old drive mounted and available, open Mail and choose import mailboxes... from the file menu of mail. In the dialog box import data from , choose Apple Mail.

    Navigate to the Mail folder to the user of the old library drive. According to the version of courier used, you might see folders named V2 and / or V3. Choose the applicable folder, and then click Choose.

  • How to use the parameter B-BIS in a factory of connections

    How to use the parameter B-BIS in a factory of connections (OS 5.0)?

    I have found no no API for it.

    Maybe http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/io/transport/options/BisBOptio... ?

  • DPS: Judge to use the parameter Raster or vector in the States of the objects when the majority of the page is a photo. What is the best setting for the overall performance?

    I am trying to decide whether to use the parameter Raster or vector in the States of the object when the majority of the screen is a picture (with a modest but important legend for children to read). The legend certainly makes it look more net as vector. But does the photo! The raster setting seems to make the lower-res images in comparison. In my first edition of my application, I thought that raster would be the best setting when the photo was the subject dominating the page. But now, after seeing how strong he looks like vector, (but with almost a refresh of the unacceptable time. Perhaps better on the latest iPad. Most of my readers/students in class will use iPad 2 s, which has a slower processor). I wonder if I should go through the trouble of changing States of photo objects that have the type as well to the vector. It doesn't seem to be as sensitive to a re - draw on the iPad 2 (non-retine)

    Is Filesize hit if I make about 1200 on these objects range from Raster to vector? (It is a huge, highly interactive history book, so I'm curious if acutally go to vector on these photos would reduce the size of the file) What is the best setting for the overall performance?

    I see the freeks screen outside for a bit if you try to pinch and zoom in a vector object (photo) vs raster. Which is disappointing. Does slow down load time/refreshment in frame, which is a little less. I also found that the drop shadows really bad that redraws effect in vector, almost vibrating in a slide show, for example. Thus, in cases where I need shadows, I'm sticking with Raster.

    All tips go ahead?

    Brian

    Does that help? http://boblevine.us/Digital-Publishing-Suite-101-keep-text-sharp-in-raster-slideshows/

  • I'm trying to update my applications by using the desktop creative cloud application. I see not all the apps in the app tab, the wheel just spins in circles and nothing happens. Someone at - it ideas? I tried to uninstall the application and reinstall it

    Hello

    I'm trying to update my applications by using the desktop creative cloud application. I see not all the apps in the app tab, the wheel just spins in circles and nothing happens. Someone at - it ideas? I tried to uninstall office and reinstall, but it still has the same problem.

    See you soon

    Rachel

    Hi Rachel,

    You can follow the article: App does not open. Wheel of progress turn continuously to get your landline number.

    Let us know if the problem persists or not.

    Kind regards

    Yann Arora

  • By using the parameter as a column in a select statement inside the stored procedure.

    I'm doing a variation of what follows. Can someone tell me how to use the parameter passed in the IN clause correctly? Thank you
    drop table test1;
    drop table test2;
    
    CREATE TABLE TEST1
    (
      COL1  NUMBER
    );
    
    CREATE TABLE TEST2
    (
      COL2  NUMBER
    );
    
    insert into test1 values (1);
    insert into test2 values (1);
    
    commit;
    
    create or replace  procedure test_sp (col_name varchar2)
    as
    
    var1 number;
    begin
    
    select col1 into  var1 from test1 where col1 in (select col_name from test2);
    
    end;
    
    exec test_sp ('COL2');
    Deleted table.
    Deleted table.
    Table created.
    Table created.
    1 line of creation.
    1 line of creation.
    Validation complete.
    Created procedure.
    BEGIN test_sp ("COL2"); END;
    Error on line 29
    ORA-01722: invalid number
    ORA-06512: on-site ".» TEST_SP', line 7
    ORA-06512: at line 1

    You must use dynamic sql statements:

    SQL> drop table test1;
    
    Table dropped.
    
    SQL> drop table test2;
    
    Table dropped.
    
    SQL> CREATE TABLE TEST1
      2  (
      3    COL1  NUMBER
      4  );
    
    Table created.
    
    SQL> CREATE TABLE TEST2
      2  (
      3    COL2  NUMBER
      4  );
    
    Table created.
    
    SQL> insert into test1 values (1);
    
    1 row created.
    
    SQL> insert into test2 values (1);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> create or replace  procedure test_sp (col_name varchar2)
      2  as
      3  var1 number;
      4  begin
      5  execute immediate 'select col1 from test1 where col1 in (select ' || col_name || ' from test2)' into var1;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> exec test_sp ('COL2');
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • How to insert a new record or update existing record by using a view complex?

    Currently, I created this screen, there is no problem on display data, on the update feature (average TI insert / update / delete on the table for which the view is based on).

    I have a table and a view complex in order to display the information in the table in a form of tabellar (IE up to 70 record in same "record" in the form, one for each article)

    The view is like this



    Select a.f1, a.f2, get_value(a.pk1,1) a1, a2 get_value(a.pk1,2), get_value(a.pk1,3) a3...

    from my_table a

    where a.proj_id = user





    and I want to allow the update of the field a1, a2, a3 in a multiplace (tabellar) canvas.

    I created a TRIGGER INSTEAD.

    But it works not only in the form. I get FRM-40654 error when I try to change the existing value in the form running based on this point of view.

    The view is woking and editable using sql-plus.

    If I have question
    Select * from ALL_UPDATABLE_COLUMNS where table_name = 'SPV_BOQ_BOM_POS_ACTIVITIES ';

    where "SPV_BOQ_BOM_POS_ACTIVITIES" is the name of my point of view.

    The question is: why if the view is updatable using SQL * Plus, is not editable using the Oracle 10 g 2 form?

    Could someone help me ASAP?

    Thank you

    Forms to lock the record when you start editing. It is is by a statement of the type

    SELECT 
      FROM 
     WHERE =
       FOR UPDATE NOWAIT;
    

    If this attempt fails, the error you are getting is displayed. As solution to create a trigger-LOCK-ON on the block and with which replace standard logic.

  • by using the parameter entry is as column names

    Hi all

    I have a stored proc in which I get the column names as parameter with string delimited by commas. For example, if I get

    Address, city, name, zip_code as a varchar2 in my stored proc is the name of the parameter

    p_param

    I can do


    Select p_param from

    VW_Personal

    or is their any simple way, I can use these list of parameters by commas as the column names in my stored proc.

    Any help will be appreciated.


    Thank you

    I copy - paste the same answer I gave to another question this morning:

    You can use ref Cursor, anyway when you retrieve the values you need to know the number and the type of data in the columns.

    SQL> create or replace procedure print_enames(in_col in varchar, in_val in varchar2) is
      2  c sys_refcursor;
      3  v_name emp.ename%type;
      4  begin
      5    open c for 'select ename from emp where '||DBMS_ASSERT.SIMPLE_SQL_NAME(in_col)||'= :1 ' using in_val;
      6    loop
      7     fetch c into v_name;
      8     exit when c%notfound;
      9     dbms_output.put_line('ename='||v_name);
     10    end loop;
     11  end;
     12  / 
    
    Procedure created.
    
    SQL> select * from emp;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    
    14 rows selected.
    
    SQL> set serverout on
    SQL> exec print_enames('mgr','7839')
    ename=JONES
    ename=BLAKE
    ename=CLARK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec print_enames('sal','1250')
    ename=WARD
    ename=MARTIN
    
    PL/SQL procedure successfully completed.
    
    SQL> exec print_enames('deptno','30')
    ename=ALLEN
    ename=WARD
    ename=MARTIN
    ename=BLAKE
    ename=TURNER
    ename=JAMES
    
    PL/SQL procedure successfully completed.
    

    Max

    Published by: Massimo Ruocchio, June 23, 2011 17:02
    As well stressed Centinul this approach is prone to sql injection.
    Usage of DBMS_ASSERT function. SIMPLE_SQL_NAME can avoid this problem, but there are onliy on Oracle 10.2 and later.

  • Record without using the audio microphone

    I want to record from a file without using themicraphone on my laptop Inspiron 15 7537.  He had instlled software Realtek but no option to use the IDT internal microphone or Audio CODEC so he picks up background noise which is not good.  When I try to save the only option it is the Realtek microphone.

    Can someone season solution

    Thank you

    dlb21a
    He had instlled software Realtek but no option to use the IDT internal microphone

    Hello. As you say, your laptop has audio Realtek so it is unclear what you mean by "Microphone internal IDT. Dell doesn't use audio Realtek so IDT in the same model of laptop.

    Here are some other ways to save in addition to using the built-in microphone.

    > External mic. Because the Inspiron 7537 only has a headphone jack, you can't use a regular computer microphone which would have a TRS plug, but instead, you must use a headset with a plug from SOCKET that looks like this:

    "Headphones" is the headphones with a microphone. You can also use a regular mic which has a TRS plug if you get an adapter to convert it to a plug from SOCKET. The adapter is called a "helmet buddy."

    > A usb microphone.

    > If you want to record a stereo signal, you can do that through your headphone socket because its entry is mono only. To save the stereo, you need an adapter usb audio with a "line-in" socket Don't get one that has only a mic jack because it will be only mono too.

    dlb21a
    I want to record from a file

    > If the file is already in your computer, you can internally record in the computer by selecting 'stereo mix' as default device in the recording of the sound Properties tab. If you do not see the stereo mix, right-click in the empty area of the tab to open the context menu and select "Show disabled devices". (You must have your installed Realtek audio driver).

  • Is it possible to update msvad example to use the point audio format covered 32-bit?

    Hello

    Successfully, I built the msvad vadsimpl and used on windows 7 driver. When I tried to use 32-bit floating point instead of the integer pcm format to the pines, recoding and playback devices are not displayed in Control Panel. Although the driver is correctly installed and the device is started.

    Can any body give me a clear answer that is - it possible with windows or not?

    Thank you

    Zubin.

    Hey Zubin,

    Thanks for posting that ask you about Microsoft Community.

    As you said, you want to know this msvad vadsimpl is compatible with Windows 7 is not on.

    This question is better suited in the MSDN forum, because we have experts working on these issues. I suggest you post your question on the MSDN forum.

    See the link below.

    http://social.msdn.Microsoft.com/forums/vstudio/en-us/home

    Hope this information helps. Please let us know if you face the future with other problems with Windows. We will be happy to help you.

  • BlackBerry software update failed Smartphone, cannot use the phone, but can attach to the computer access to the Internet.

    How to fix the phone. Software of office says "cannot communicate with the device.

    Hi and welcome to the Forums!

    Good job on the recovery! But all is not lost for your data. If you did the update via your PC, then in the early stages of the process should have been a backup of your data (assuming you do not defeat this feature). If you're on a PC, then look for in your entire hard drive to a file with the extension of the IPD (*.) IPD)... check the date and time of the results... created more recently is your best candidate and if all goes well, it was created at the time you did the update. Use this procedure to restore this file:

    • KB10339 How to use BlackBerry Desktop Manager to restore the data to a BlackBerry smartphone from a backup file

    If you use a MAC, I don't know how he does things, but maybe this KB is useful:

    • KB18776 Back up and restore BlackBerry smartphone data on a Mac using BlackBerry Desktop Software 2.0

    If you performed the update OTA or otherwise circumvented the backup data, then you are indeed no chance.

    Good luck!

  • Channels for the identification of the records by using the syntax for Connect By

    Hello

    Can someone help with the following problem please?

    Our database records evaluations of the child for families in difficulty. When get us in touch with them, ideallu:
    A child receives a preliminary assessment (evaluation).
    If they are deemed to have need for additional support, they are given a second assessment (B) that is triggered by the assessment and an ID of the trigger to identify what assessment he comes.
    If they are deemed to need further support, they are given a third evaluation (C) that is triggered by the 2 assessment and an ID of the trigger to show that it comes from the b. assessment
    This is also true for a fourth assessment (assessment) report that is triggered by the evaluation C.

    However, due to the poor implementation of this concept by our provider database and the lack of knowledge by the workers, we have 2 problems:

    (1) analysis has isn't always the starting point as a worker can start any assessment at any time, i.e. from c assessment.

    (2) in view of this, a child can have several evaluations of the same type, i.e. a x 3 C, 2 x B assessment assessment in no particular order.

    The problem:

    I need to identify the separate strings (desired_output) of intervention using the relationship between the registration ID and the ID of the trigger, as shown in the table below:
    CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT         
    -------- --------- ---------- -------- ------------------------- ------------------------- ---------------------- 
    A00001   R297931              B        18-JUN-10                 18-JUN-10                 1                      
    A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1                      
    A00001   R133219              A        12-AUG-08                 12-AUG-08                 2                      
    A00001   R240118              A        30-OCT-09                 30-OCT-09                 3                      
    A00001   R604913              A        17-AUG-12                 17-AUG-12                 4                      
    A00001   R604943   R604913    B        17-AUG-12                 17-AUG-12                 4                      
    A00001   R604961   R604943    C        17-AUG-12                 03-SEP-12                 4                      
    A00001   R605195              B        25-AUG-12                 25-AUG-12                 5                      
    A00001   R605214              A        28-AUG-12                 28-AUG-12                 6                      
    A00001   R609999   R604961    D        03-SEP-12                 05-SEP-12                 4                     
     
    Data:
    select * from
    (select * from
     
    (select 'A00001' as child_id, 'R297931' as record_id, null  as trigger_id, 'B' as asm_name, to_date('18-06-2010','dd/mm/yyyy') as rec_start_date, to_date('18-06-2010','dd/mm/yyyy') as rec_end_date, 1 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R299381' as record_id, 'R297931' as trigger_id, 'C' as asm_name, to_date('23-06-2008','dd/mm/yyyy') as rec_start_date, to_date('23-06-2008','dd/mm/yyyy') as rec_end_date, 1 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R133219' as record_id, null as trigger_id, 'A' as asm_name, to_date('12-08-2008','dd/mm/yyyy') as rec_start_date, to_date('12-08-2008','dd/mm/yyyy') as rec_end_date, 2 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R240118' as record_id, null as trigger_id, 'A' as asm_name, to_date('30-10-2009','dd/mm/yyyy') as rec_start_date, to_date('30-10-2009','dd/mm/yyyy') as rec_end_date, 3 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R604913' as record_id, null as trigger_id, 'A' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('17-08-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R604943' as record_id, 'R604913' as trigger_id, 'B' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('17-08-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R604961' as record_id, 'R604943' as trigger_id, 'C' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('03-09-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R605195' as record_id, null as trigger_id, 'B' as asm_name, to_date('25-08-2012','dd/mm/yyyy') as rec_start_date, to_date('25-08-2012','dd/mm/yyyy') as rec_end_date, 5 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R605214' as record_id, null as trigger_id, 'A' as asm_name, to_date('28-08-2012','dd/mm/yyyy') as rec_start_date, to_date('28-08-2012','dd/mm/yyyy') as rec_end_date, 6 as desired_output from dual) union all
    (select 'A00001' as child_id, 'R609999' as record_id, 'R604961' as trigger_id, 'D' as asm_name, to_date('03-09-2012','dd/mm/yyyy') as rec_start_date, to_date('05-09-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual)) child_records
    Originally, I thought to use Oracle Connect By syntax, but it does not (as far as I can work on!) because I have no start condition (the string of assessments can start A or B or C or D) which leads to duplication of lines.

    I thought I could use connect_by_root to group common assessments, but I am not convinced that this will give consistent results.

    -------------------------
    select
    child_records.*, 
    connect_by_root(nvl(trigger_id,record_id)) chain_id
    from child_records
    connect by trigger_id = prior record_id
    --------------------

    Is an alternative, possibly using trigger_id = above lag(record_id,1,null) (child_id order partition of...) but the assessments are in no particular order, I don't think I can specify a command clause...?

    Can anyone help to generate the desired output please?

    Thank you

    TP

    Hello

    Little Penguin says:
    ... However, due to the poor implementation of this concept by our provider database and the lack of knowledge by the workers, we have 2 problems:

    (1) analysis has isn't always the starting point as a worker can start any assessment at any time, i.e. from c assessment.

    (2) in view of this, a child can have several evaluations of the same type, i.e. a x 3 C, 2 x B assessment assessment in no particular order.

    This isn't necessarily a bad design. If it really fits your business rules is another matter. But as a means to represent events from cause to effect, to be used to CONNECT BY queries, it makes sense.

    The problem:

    I need to identify the separate strings (desired_output) of intervention using the relationship between the registration ID and the ID of the trigger, as shown in the table below:

    Let me assure you that I understand. You don't really have an desired_output column; you will need to that derived from other columns. Right?

    CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT
    -------- --------- ---------- -------- ------------------------- ------------------------- ----------------------
    A00001   R297931              B        18-JUN-10                 18-JUN-10                 1
    A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1
    A00001   R133219              A        12-AUG-08                 12-AUG-08                 2
    A00001   R240118              A        30-OCT-09                 30-OCT-09                 3
    A00001   R604913              A        17-AUG-12                 17-AUG-12                 4
    A00001   R604943   R604913    B        17-AUG-12                 17-AUG-12                 4
    A00001   R604961   R604943    C        17-AUG-12                 03-SEP-12                 4
    A00001   R605195              B        25-AUG-12                 25-AUG-12                 5
    A00001   R605214              A        28-AUG-12                 28-AUG-12                 6
    A00001   R609999   R604961    D        03-SEP-12                 05-SEP-12                 4                     
    

    Data:...

    Thanks for the display of the data of the sample; that really helps.

    Originally, I thought to use Oracle Connect By syntax, but it does not (as far as I can work on!) because I have no start condition (the string of assessments can start A or B or C or D) which leads to duplication of lines.

    Is not

    START WITH  trigger_id  IS NULL
    

    identify a starting point? If something has not been triggered by something else, it is not a starting point? It is actually quite common in the hierarchical tables.

    I thought I could use connect_by_root to group common assessments, but I am not convinced that this will give consistent results.

    I'm not sure that you understand the problem. What do you mean by "consistent results? The doubt that you are worried, what exactly?

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

    select
    child_records.*,
    connect_by_root(nvl(trigger_id,record_id)) chain_id
    from child_records
    connect by trigger_id = prior record_id
    

    You got right. If I understand what you mean by consistent results, it will bring them. You want to START to condition, of course, and as the starting lines will never have a trigger_id, there is no need to tell

    CONNECT_BY_ROOT  NVL (trigger_id, record_id)   AS chain_id
    

    You can simply say

    CONNECT_BY_ROOT  record_id   AS chain_id
    

    This will be particularly well idnetify the strings of their record_ids. Looks like you want to assign new sequence numbers (1, 2, 3,...) to identify the channels. Which takes an extra step.

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

    Is an alternative, possibly using trigger_id = above lag(record_id,1,null) (child_id order partition of...) but the assessments are in no particular order, I don't think I can specify a command clause...?

    Right; LAG depends on the order and order tells us nothing to this problem.
    In fact, feeds means so little to this problem that an event can come before the event that triggered it.
    For example, if I understand the first two lines of your output

    CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT
    -------- --------- ---------- -------- ------------------------- ------------------------- ----------------------
    A00001   R297931              B        18-JUN-10                 18-JUN-10                 1
    A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1                      
    

    C event was triggered by the event B, even if C took place two years before B.
    (Not that it is important for the SQL problem, but can you explain the logic of how events can come before or after the events that triggered them?) "I'm just curious.)

    Here's a way you can assign sequential numbers to identify the channels:

    WITH     got_d_num     AS
    (
         SELECT     c.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  child_id     -- Just guessing
                                   ORDER BY          NVL2 ( trigger_id
                                                  , 2     -- rows with trigger_ids come 2nd
                                       , 1     -- rows without come 1st
                                       )
                             ,             rec_start_date
                             ,             asm_name
                           )      AS d_num
         FROM    child_records  c
    )
    SELECT     child_id, record_id, trigger_id, asm_name, rec_start_date, rec_end_date
    ,     desired_output               -- if needed
    ,     CONNECT_BY_ROOT d_num     AS chain_num
    FROM     got_d_num
    START WITH     trigger_id     IS NULL
    CONNECT BY     trigger_id     = PRIOR record_id
    ORDER BY  child_id
    ,            rec_start_date
    ,       asm_name
    ;
    

    Output:

    `                                              DESIRED
    CHILD_ RECORD_ TRIGGER A REC_START REC_END_D   _OUTPUT  CHAIN_NUM
    ------ ------- ------- - --------- --------- --------- ----------
    A00001 R299381 R297931 C 23-JUN-08 23-JUN-08         1          3
    A00001 R133219         A 12-AUG-08 12-AUG-08         2          1
    A00001 R240118         A 30-OCT-09 30-OCT-09         3          2
    A00001 R297931         B 18-JUN-10 18-JUN-10         1          3
    A00001 R604913         A 17-AUG-12 17-AUG-12         4          4
    A00001 R604943 R604913 B 17-AUG-12 17-AUG-12         4          4
    A00001 R604961 R604943 C 17-AUG-12 03-SEP-12         4          4
    A00001 R605195         B 25-AUG-12 25-AUG-12         5          5
    A00001 R605214         A 28-AUG-12 28-AUG-12         6          6
    A00001 R609999 R604961 D 03-SEP-12 05-SEP-12         4          4
    

    This example uses rec_start to affect chain_num and also sort the output, but not to determine wht in a string. The first 3 events untrigered (in rec_start order) have been in August 2008, October 2009 and June 2010, while they were assigned chain_nums 1, 2 and 3, in that order. Antyhting that was triggered by them, directly or indirectly, gets the same chain_num if it happened before or after the starting point of the chain. Thus, the first line of the output, in June 2008, gets chain_num = 3. You have assigned desired_output = 1 on this line. If you can explain how you got the number 1, we can probably find a way to code, so that the calculated chain_num is identical to desired_num. In the above query, they are not the same, but they are related. Everywhere you specified desired_output = 1, the above query produces chain_num = 3. If the numbers are the same (for example desired_output = 4 = chain_num) it's just a coincidence.

    Note that when I used ROW_NUMBER, I did in a subquery, not in the main query where the CONNECT BY were made. Never use the analytical functions (for example, ROW_NUMBER) in the same query with CONNECT BY. The analytical functions are often the cause CONNECT BY conditions to be incorrectly evuated. I have never seen any literature on this subject and it doesn't always happen, but I suggest that you avoid to mix everything well.

    Published by: Frank Kulash, Sep 15, 2012 10:00

    Published by: Frank Kulash, Sep 15, 2012 10:44

    I just read the answer from John, who has a nice illustration of my last point: use of the separate petitions for both analytical and CONNECT BY. You can use the analytic function first, and then CONNECT BY, as I did, or you can do the first CONNECT BY and then use the analytic function (in a solution of John DENSE_RANK) later. Whatever it is, you must separate them.

  • If I buy the update, can I still use the previous version?

    I'm sure that this question is answered on the Adobe site or in the forums somewhere, but I can't find the answer.  I hope someone can point me to the official policy of Adobe.

    I think the upgrade of CS4 CS5 versions, and one of the considerations that would affect my decision would be able to use the old version on my 2nd computer (a laptop).  Is this allowed?   Currently I have to disable Photoshop on my desktop PC and activate it on my laptop so for use during a trip, and I always forget to do, so I find myself not not using Photoshop on my laptop at all.

    You can do what you want.*

    The license covers use on both computers.

    * I always advise people to keep the old version in any case up to are completely happy with the news.

  • By selecting certain records by using the check box

    Hello

    I have a similar problem mentioned in this thread Re: select specific records using the checkbox I got if I have only one primary key value in the work table. I don't know how to handle it when I have several primary keys of the table I want to use for filtering?

    Thank you.

    Hello

    You can use rowid
    First report

    SELECT APEX_ITEM.CHECKBOX(1,e.rowid) chk,
    e.*
    FROM emp e
    

    Use even submit after processes.
    And target page report

    SELECT e.*
    FROM emp e
    WHERE EXISTS(
    SELECT 1
    FROM apex_collections c
    WHERE c.collection_name = 'P46COL'
    AND c.c001 = e.rowid)
    

    Kind regards
    Jari

    Published by: jarola on October 14, 2010 10:50

  • Using the parameter nls_length_semantics

    What is the use of nls_length_semantics pratamter?

    And what is the difference if the parameter nls_length_semantics = 'CHAR' rather than 'BYTE '.

    Thanks in advance

    NLS_LENGTH_SEMANTICS allows you to create CHAR and VARCHAR2 columns by using the semantics of length in bytes or characters. The existing columns are not affected.

    NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always based on characters. You may need to you use the semantics of bytes in order to maintain compatibility with existing applications.

    NLS_LENGTH_SEMANTICS does not apply to tables in the SYS and SYSTEM. The data dictionary always use byte semantics.

    http://www.oratransplant.nl/2005/11/

Maybe you are looking for