Avoid duplication of record Insertion

I'm trying to get something like that, but I think instruction Insert is not allowed in the case or Select expects something in return is why it continues to give me missing Expression. Y at - it another way to prevent duplicate insertion. I know that we can do it by running another query and then based on recoundcount or County of this distinct query, you insert records, but I don't want to do.


SELECT THE CHECK BOX
WHEN (SELECT COUNT (*) FROM THACARA WHERE ORG_CNY_CD = 'US' AND ORG_REG_NR = '02' AND ORG_DIS_NR = '51') > 0
THEN ("EXSIST IN DOUBLE")
OTHER (INSERT INTO THACARA (USR_NR, ORG_FAC_LOC_NR)
values ('Mary', 'FLIMI'))
TEST END AS FROM DUAL;

any ideas?

As long as you reference to DOUBLE guess is your Oracle database and DUAL is a table of 1 row.

Tags: ColdFusion

Similar Questions

  • How to avoid creating a record?

    How to avoid creating a record?

    Khanna,

    We can set the property INSERT_ALLOWED to a block using SET_BLOCK_PROPERTYrunning.

    SET_BLOCK_PROPERTY('', INSERT_ALLOWED, PROPERTY_FALSE);
    

    And to set it to insertable, write,

    SET_BLOCK_PROPERTY('', INSERT_ALLOWED, PROPERTY_TRUE);
    

    Kind regards

    Manu.

  • duplication of records on screen bi publisher on IE8

    Hi all

    I'm having a problem of duplication of records for BI (obiee 11.1.1.5.0) publisher reports display in IE 8. The report display looks good on firefox and chrome browser. When I open the report file RTF on IE view, similarly, there is no duplication of records. Missing add on or need to update flash player on IE? Most of the clients use IE for reporting.

    Thank you

    Vishal

    In the model, try to put all the fields in a table.

  • record insert question

    problems with the record insert on dwmx2004. I have a number of large database tables and I want to get all the information in the database with several inserts Records and a post on a single page. I did the multipe recordsets in a POSITION with smaller files in the past, but for some reason any dw doesn't let me do it now with a more complex page. is there something I'm missing or should be done differently?

    specifically, the record insert Panel won't save the connections between the name of the form and the fields of database, with the exception of the first. weird. suggestions?

    figured it out. I removed the table in the form and put it in another file and try again. Fortunately, he worked half, and so I had the chance to see what was wrong. ATTENTION: Make sure that your form names have no space after them before clicking on enter. mine has unique spaces - which you could see in the code view - guarding them to link to the db via the recording fields to insert the tool. at least this is what I think... just an amateur.

  • Record insertion form wizard

    'Record insertion form wizard' Dreamweaver creates this code on my page add_products.php

    1 <? php require_once('.. / Connections/connStore1.php');? >
    2 <? PHP

    4 //Alternative for PHAkt functions.inc.php
    5 require_once('.. / includes/tNG_functions.inc.php');

    7 //load the classes of tNG
    8 require_once('.. / tNG/KT_tNG.inc.php');

    Which causes this error message:

    Warning: main (.. / includes/tNG_functions.inc.php): failed to open stream: no such file or directory in /home/herm1/public_html/admin/add_product.php on line 5

    Fatal error: main(): failed to achieve "... / includes/tNG_functions." Inc.php' (include_path ='.: / usr/lib/php: / usr/local/lib/php ') in /home/herm1/public_html/admin/add_product.php on line 5


    Dreamweaver is indicative of the add_products.php to access a folder that does not exist.
    I'm stuck.

    Hi Yes,

    You must download includes it the folder that is created when you use the
    InterAKT extensions.

    "Herman2468" wrote in message
    News:e7mmi0$IC3$1@forums. Macromedia.com...
    > 'Record insertion form wizard' Dreamweaver creates this code in my
    > add_products.php page
    >
    1 >
    2 ><>
    >
    4 > //Alternative for PHAkt functions.inc.php
    require_once('.. > 5 / includes/tNG_functions.inc.php');
    >
    load > 7 classes of tNG
    require_once('.. > 8 / tNG/KT_tNG.inc.php');
    >
    > Which causes this error message:
    >
    > Warning: main (.. / includes/tNG_functions.inc.php): failed to open stream:
    > NO.
    > file or directory in /home/herm1/public_html/admin/add_product.php on
    > line
    5 >
    >
    > Fatal error: main(): failed to realize
    > '.. / includes/tNG_functions. Inc.php'
    > (include_path ='.: / usr/lib/php: / usr/local/lib/php ') in
    > /home/herm1/public_html/admin/add_product.php on line 5
    >
    >
    > Dreamweaver says add_products.php to access a folder that is not
    > exist.
    > I'm stuck.
    >
    >
    >

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • records inserted duplicates and not inserted values

    Hi all

    create the table XXC_ORDERS (inventory_item_id customer_id number, number, budget_entity varchar2 (10), number of EXCHANGE_RATE, CURRENCY_CODE varchar2 (10));

    create table XXC_SALES1 (inventory_item_id customer_id number, number, budget_entity varchar2 (10), number of EXCHANGE_RATE, CURRENCY_CODE varchar2 (10));

    create table XXC_BUDGET (inventory_item_id customer_id number, number, budget_entity varchar2 (10), number of EXCHANGE_RATE, CURRENCY_CODE varchar2 (10));

    create table XXC_SALES_BUDGET (inventory_item_id customer_id number, number, budget_entity varchar2 (10), number of EXCHANGE_RATE, CURRENCY_CODE varchar2 (10));

    -drop table XXC_SALES_BUDGET

    insert into XXC_ORDERS

    SELECT 27962, 68329, 0.82082, 'US', '93'

    DOUBLE;

    CREATE VIEW Orders_V1 AS

    SELECT *.

    OF XXC_ORDERS;

    insert into XXC_SALES1

    SELECT 68329, 27962, '93', NULL, 'EUR '.

    DOUBLE;

    CREATE VIEW Sales_V1 AS

    SELECT *.

    OF XXC_SALES1;

    insert into XXC_BUDGET

    SELECT 68329, 27962, 'CZK', NULL, NULL

    DOUBLE;

    CREATE VIEW Budget_V1 AS

    SELECT *.

    OF XXC_BUDGET;

    DECLARE

    V_ITEM_ID number;

    number of v_cust_id;

    v_Entity varchar2 (10);

    number of v_rate;

    v_curr varchar2 (10);

    CURSOR c_1

    IS

    SELECT INVENTORY_ITEM_ID,

    CUSTOMER_ID,

    BUDGET_ENTITY,

    EXCHANGE_RATE,

    CURRENCY_CODE

    OF XXC_ORDERS

    UNION

    SELECT INVENTORY_ITEM_ID,

    CUSTOMER_ID,

    BUDGET_ENTITY,

    EXCHANGE_RATE,

    CURRENCY_CODE

    OF XXC_SALES1

    UNION

    SELECT INVENTORY_ITEM_ID,

    CUSTOMER_ID,

    BUDGET_ENTITY,

    EXCHANGE_RATE,

    CURRENCY_CODE

    OF XXC_BUDGET;

    BEGIN

    FOR c_rec IN c_1

    LOOP

    BEGIN

    SELECT INVENTORY_ITEM_ID,

    CUSTOMER_ID,

    BUDGET_ENTITY,

    EXCHANGE_RATE,

    CURRENCY_CODE

    IN v_item_id,.

    v_cust_id,

    v_Entity,

    v_rate,

    v_curr

    OF XXC_ORDERS

    WHERE INVENTORY_ITEM_ID is c_rec. INVENTORY_ITEM_ID

    AND CUSTOMER_ID = c_rec CUSTOMER_ID.

    AND BUDGET_ENTITY = c_rec. BUDGET_ENTITY;

    -AND EXCHANGE_RATE is c_rec. EXCHANGE_RATE

    -AND CURRENCY_CODE is c_rec. CURRENCY_CODE;

    EXCEPTION

    WHILE OTHERS THEN

    V_ITEM_ID: = 0;

    v_cust_id: = 0;

    v_Entity: = null;

    -v_rate: = 0;

    -v_curr: = null;

    End;

    Begin

    INSERT INTO XXC_SALES_BUDGET

    SELECT

    V_ITEM_ID,

    v_cust_id,

    v_Entity,

    v_rate,

    v_curr

    of the double

    WHERE THERE IS NO

    (SELECT 1 OF XXC_SALES_BUDGET y)

    WHERE y.budget_entity = c_rec. BUDGET_ENTITY

    AND y.customer_id = c_rec.customer_id

    AND y.inventory_item_id = c_rec.inventory_item_id

    - AND y.EXCHANGE_RATE = c_rec EXCHANGE_RATE.

    - AND y.CURRENCY_CODE = c_rec. CURRENCY_CODE

    );

    End;

    commit;

    End loop;

    End;

    (1) implementation of duplicates in the table XXC_SALES_BUDGET for the 2nd time

    (2) in my original query in the table XXC_SALES_BUDGET EXCHANGE_RATE, CURRENCY_CODE is NULL, but the test case above, it is punishable by fine

    Post edited by: added test cases 994122

    994122 wrote:

    How to avoid duplicates?

    Thanks John

    "Ostensibly you insert records with null for the column values. When you do this, it is query will be FALSE when you try to compare NULL with the NULL value because NULL = NULL is unknown (it is not true). NULL <> NULL is also unknown. You compare nulls using "IS NULL" "the #1 post


    I made a mistake in this conditions to not exist in INTO clause block where conditions and I added NVL on two blocks, now works well.

    AND nvl (y.currency_code, 'CCC') = nvl(c_rec.currency_code,'CCC')

    AND nvl(y.exchange_rate,1) = nvl(c_rec.exchange_rate,1)

    Question:

    in Zapex ( post #3 )

    MERGE INTO xxc_budget_history one

    USING (SELECT item_id,

    cust_id,

    DECODE (UPPER (BUDGET_ENTITY), 'ABC', '12', BUDGET_ENTITY)

    budget_entity,

    exchange_rate,

    currency_code

    OF xxc_cur_table

    WHERE item_id = 116) b

    WE (a.cust_id = b.cust_id

    AND a.BUDGET_ENTITY = b.BUDGET_ENTITY

    AND a.item_id = b.item_id)

    WHEN MATCHED

    THEN

    GAME UPDATE

    a.EXCHANGE_RATE = b.EXCHANGE_RATE, a.CURRENCY_CODE = b.CURRENCY_CODE

    WHEN NOT MATCHED

    THEN

    INSERT (EXCHANGE_RATE, CURRENCY_CODE)

    VALUES (b.EXCHANGE_RATE, b.CURRENCY_CODE);

    I tried with the above code when my table was below the values but getting even (the values are already validated)

    ITEM_ID CUST_ID UNITS_MONTH1 AMOUNT_MONTH1 EXCHANGE_RATE CURRENCY_CODE BUDGET_ENTITY
    116 836 0 0 12

    But I need to update as below with the existing values

    ITEM_ID CUST_ID UNITS_MONTH1 AMOUNT_MONTH1 EXCHANGE_RATE CURRENCY_CODE BUDGET_ENTITY
    116 836 100 110 12

    Thank you

    you do not see UNITS_MONTH1 and AMOUNT_MONTH1. How do you want to get the update? These two columns should be included in the SELECT, UPDATE and INSERT statements. Then only it will update

  • find the most recent record inserted by using rowid

    Yes, I suspect that it is a bad idea!

    I work with an application that has been modelled incorrectly. a historical table of the status had been modeled with a primary key on a key of the company and the entry into force instead of the date of the end of the recording of the State. There is one status as possible at the same time.

    logic has been developed to insert new records of status with the dates of null terminator and then a trigger was provided that populated end dates except the one with the MAX (ROWID). so the hope is that ROWID will always get bigger.

    now, the database has been moved in environments of promotion using data pump. in our development environments, it always seems to work. but not in promotional customers environments.

    My question is: is there a setting associated with data pump that the client has used that does not respect the ROWID as it has in our development environment?

    I'm trying to determine if there is a way to continue to use the old code without immediately re-development.

    Thanks in advance for your comments.

    so the hope is that ROWID will always get bigger.

    It is an expectation that has no guarantee of being correct. He has a very good chance that a new line will have a lower value of the ROWID.

    My question is: is there a setting associated with data pump that the client has used that does not respect the ROWID as it has in our development environment?

    There is not this setting. Data pump just inserts rows into a table. Because we cannot guarantee that the next row will have a higher ROWID, then what you are looking for there is no.

    It is time to rethink this misguided approach.

    See you soon,.
    Brian

  • Limit the records inserted with FUSION

    I created a procedure for updating a table date of termination when the user enters a date of term.  Username and ID (PK) comes from t_users and the endings are in t_terms with t_terms.user_id = t_users.id as key.  There are about 2,500 users and curently nothing in the picture of the word.

    This procedure lights are part of a dynamic of action when the page is sent on an Apex application:

    create or replace Procedure "TERM_UPDATE"

    ()p_user_id IN NUMBER

    p_term_eff_date IN DATE )

    is

    Start

    fusion en t_terms t

        using t_users u

        on (t.user_id=u.id)

    when matched then

    to update the value TERM_EFF_DATE=p_term_eff_date where useridentifier=p_user_id

    when not equal then

    integration ()user_id term_eff_date) values ()p_user_id p_term_eff_date)

    end ;

    I tried just the merge statement in SQL Workshop.  The result is an insertion of 2500 all records user to the table of endings each time that it fires.  If I run again, I get 5000 inserts.  If I understand this process, t.users_id = u.id must return nothing, triggering the insert without match.  Even when there is a match, I always get the insert.  What the hell is happening?

    The p_user_id and the p_term_eff_date are power from bind on page variables.  I put those to be bind variables when I tested the query.

    I'm under apex 4.2 on 11g.

    Thank you!

    Hello

    Thanks for posting the instructions CREATE TABLE.

    Don't forget to display instructions INSERT for you samples, a few calls to the procedure (with specific values for the arguments) and content of t_term after each call.

    What t_users role in this problem?  You get all the information to t_users; you already know the user_id to the time wherever you call the procedure.  I guess the only reason why you have to t_users to this problem is to guard against inserting a user_id not valid in t_term.  (The foreign key constraint would guard against that, too, but it would trigger an error.  You might find a little more elegant to just merge 0 line when an invalid user_id is passed to the procedure.)

    Here's a way to do it:

    create or replace procedure 'TERM_UPDATE '.

    (p_user_id in NUMBERS

    p_term_eff_date IN DATE

    )

    is

    Start

    merge into dst t_terms

    a_l'_aide_de)

    Select id as user_id

    of t_users

    where id = p_user_id

    )              src

    on (dst.user_id = src.user_id)

    When matched then

    update set TERM_EFF_DATE = p_term_eff_date

    where DECODE (TERM_EFF_DATE - if wanted

    p_term_eff_date, 1

    0

    ) = 0

    When not matched then

    Insert (dst.id, dst.user_id, dst.term_eff_date)

    values (term_id_seq. NEXTVAL, src.user_id, p_term_eff_date);

    end;

    /

    DISPLAY ERRORS

    Because t_terms.id is forced to be NON NULL, you must provide a value for the id before you can insert a new line in t_terms.  In the above procedure, I guess you have a sequence called term_id_seq for this purpose.

  • How to insulate the record insertion on a block of other blocks

    Hi all

    I am facing a problem in inserting record on several blocks. Let suppose that there are three blocks A, B and C user is inserting record in the block in the user Meanwhile jumped to block B and inserting record start here and then commit those changes. Inserting record on block B is failed due to validation on block A, where user left between the two and jumped to block B and application form for incomplete registrations. However, on the block B, all elements are validated but still ask to enter data block has.

    It is possible that if the user enter the record in the current block and forms insert record in that block and validate any changes on other blocks. I tried insert_record; integrated into the insert record but did not work. An idea to get out of this situation that I would be grateful.

    Thank you.

    A form module is treated as a single unit of work or of a single transaction. Either you save all data in it or anything. If you have a logic which must be stored separately from each other, so you should design your modules accordingly, in your case, create different form-Modules for different blocks. Everything else will only cause problems and is not the way to form of work.

    Message geändert durch AndreasWeiden

  • Mail after record insertion

    Hi guys, I always interim relief forms in process.php, which seizes the form fields and email, then redirects to thanks.php. I started to work with dreamweaver PHP functions and if I insert a record into MySQL, the form action becomes echo $editFormAction; and the code for process.php points, but no e-mail passes through. It ends at thanks.php so it's still going through process.php. Anyone know why it does not work? Should I send the email after the insertion of all on the same page? Thank you

    Self-confidence, insert file will present itself and DW will place of own form on the form action. The embed code is encapsulated in an IF statement that basically checks if the page loads for the first time, or if the action of the form is set to true andnthen run the embed code and redirect. You should be able to take the E-mail of the process script. PHP and place it after the code insertion and before the redirection. The form variables will be available at the time the script of the insert and the e-mail script.

  • Several record insert through PROCEDURE - Urgent

    All,

    My requirement is, I need to call a procedure that accepts two inputs and 1 output variable. The operation of the procedure is to insert the data in two tables (head_tab and line_tab - accepts several recording). I used % rowtype to two entries i.e procedure proc (head_var head_tab % rowtype, line_var line_tab % rowtype, out_var number). The incoming doc comes from 3 application of part which sends a header record and multiple line record for the same header.
    I used the processing activity, insert row record I used for each loop for multiple record. But % rowtype is a scalar data type, it does not accept table of record to him! I'm stuck here. Can achieve us this scenario with the help of the procedure? or do I have to configure DBAdapter to insert the data directly on the table rather the procedure for this? If we can reach it through the procedure, how are we going?

    Thank you
    Sen

    You can mark it as Correct if it worked?

  • Windows Media, duplication of records center

    Why, sources multiple WMC insists on making back to back recordings of the same tuner?  I'm pretty well guaranteed that I'll have to watch all my records in order, since the first two minutes of the second record are still back in the last minutes of the first record.

    You are right - it is not a hardware problem.  It's rather a long (read: it has been like this for years and between several versions of Media Center) default logic assigning tuner that many of us over at thegreenbutton have complained ad nauseum.

    There is one thing that fixes it (sometimes):
    When you have two records, back to back, on the same channel, change the option "stop after ' for the first record a hard value (for example" 10 minutes"), rather than normal"xx minutes, when possible."  Who (sometimes, but not always) requires the first record to go long enough that it force MC to use a second tuner for the second record.

    You think it's boring?  I have 14 tuners (analog 4, 6 Clear-QAM and 4 CableCARD tuners in my main system (via 2 DualTV MCEB, 3 HDHRs and an InfiniTV4)) and still I get this.  Although there are several available tuners, it always does.  : evil: and ((shrug))

    Maybe he'll be fixed in the next version...

    HTH,
    Chris

    MS - MVP (Media Center) [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • BlackBerry Java Sqlite many record insert


    Hello

    I did something similar and my approach is to store all of the lines of sql in a sql file and

    read the lines of the file.

    Step 1 declare a file with all your sql queries.

    Step 2 read the file and insert it into the DB

    When inserting, it is always better to display a dialog box please wait...

    Rabi

  • How to avoid unnecessary data to insert one to another table?

    Hi all

    I have data in the target table let say called xxc_target and insert data into the target table Temp table.

    In the target table column values like that

    create table xxc_target

    (

    Description varchar2 (100);

    );

    create table xxc_temp

    (

    Item1 varchar2 (10),

    VARCHAR2 (10) to Item2.

    Item3 varchar2 (10),

    Item4 varchar2 (10),

    );

    Insert into xxc_values targets ("A100". ' ABC'. 'BB'. ' SS');

    Insert into xxc_target values (' A101'. ' ") ABC1'. 'BB1'. ' SS1') ;

    Insert into xxc_target values ('A1002'.') ABC2'. 'BB2'. ' SS2') ;

    Insert into xxc_target values ('Oracleabc12345beconmendos');  -> these types of values

    Insert into xxc_target values ('Oracle1234', null, null, 'American1234BR'); -> these types of values

    I don't want these types of values into the temporary table and I want to use simple insertion of...

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production


    Thank you

    Hi Renon,

    I have only one command old substr-instr:

    insert into xxc_temp
    select substr(description, 1,                               instr(description,'.', 1, 1) -1),
           substr(description, instr(description,'.', 1, 1 )+1, instr(description,'.', 1, 2) -instr(description,'.', 1, 1 ) -1),
           substr(description, instr(description,'.', 1, 2 )+1, instr(description,'.', 1, 3) -instr(description,'.', 1, 2 ) -1),
           substr(description, instr(description,'.', 1, 3 )+1, length(description) )
      from xxc_target
     where description like '%.%.%.%';
    
    select * from  xxc_temp;
    
    ITEM1      ITEM2      ITEM3      ITEM4
    ---------- ---------- ---------- ----------
    A100       ABC        BB         SS
    A1001      ABC1       BB1        SS1
    A1002      ABC2       BB2        SS2
    A1003      ABC3       BB3        SS3
    

    Maybe someone knows an exp simple reg.

    concerning
    Kay
    BTW, I know

    select 'I have to learn more about regular expression!' from all_objects;
    

    ;-/

Maybe you are looking for

  • Expanded for Satellite Pro M70 PSM75E memory

    I need memory paged to my Lotus Symphony programs.But it does not work in this PSM75E-009005DU Toshiba Satellite Satellite Pro M70 with Windows XP.On my desktop with XP, it works... I can set it up in preferences shortcut on the screen.

  • USB 3.0 upgrade

    I have a HP pavilin elite model # hpe - 480 t.  What advice due I need to upgrade to usb 3.0

  • Pavilion dv6-2130er: unknown port

    Hello! Recently, I disassembled my computer laptop dv6-2130er and found a unusual port. After some Googling it seemes mSATA or miniPCI-E... On the other hand, it may be for tv-tuner, as he replied to man with some laptop dv7. But I have not found inf

  • I want to change my password

    I want to change my password

  • I get errow 0x8024400A when I try to update windows.

    I click Start, and then click windows update. I then click on express update, it starts but it is back with this code to not be able to receive.