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.

Tags: Database

Similar Questions

  • 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

  • Same question "how to limit the story" old with FF 27.0.1

    Windows 7 Pro, FF 27.0.1, Adobe and Flash modules (and it's auxiliary)... just the basics. My box is a server as well as used for most ordinary tasks... mail, browsers, editors of documents, etc., is always 'on' and never 'idle '. It's the Add-ons that make these things why don't do anything on my box.

    It is, I know, is an old question, but outstanding, in my opinion. I revive this post:
    https://support.Mozilla.org/en-us/questions/799503?FPA=1

    First of all, let me say that I consider that the best time of the Firefox browser. I love the essential philosophy of Mozilla and Firefox customization by the user and the control, while respecting their need to ensure security and stability.

    OK, the issue is evident in the title, how can I limit history with Firefox? More recently, I observed when the activation and the deactivation of JavaScript in the preferences options has been removed. I have read the reasons of Bugzilla and Firefox and it was not difficult for me to open a topic: config tab next to a label containing a page I was working so I could see how the page without JavaScript. Once you know how, it was only a little more difficult that using the preferences options... which doesn't bother me really.

    The history limit is implicit in the browser itself, where, if you open the history window, you can see your history and (for me) see an option 'longer than six months' who, if you mouse over and right click will get an option 'remove '. I think that everyone who tries this blocking their browser and if something is deleted when you finally get to the top, it will be your cache.

    I know that the amount of history is set: config in the "places.history.expiration.transient_current_max_pages" as an integer parameter. Read many articles here in 'support' and personal judgment, I find that although the number can be increased, it cannot be decreased. If we do, it is up to the old definition as soon as Firefox is reopened.

    I read the blog referenced in the first link above: http://blog.bonardo.net/2010/01/20/places-got-async-expiration and it even seems outdated, containing references to places.history.expiration.max_pages, which is not the file in topic: config in 27.0.1

    In https://bugzilla.mozilla.org/show_bug.cgi?id=643254 , I read the debate on these changes where Marco Bonardo held firmly at his post while I find the comment of al_9x, discuss the issue with him. "You have removed features that people use and love, that been in Fx since its inception. It is you who need to justify deletion. "And your justification of" nobody really wants expire history "is a lie, people do and I explained why", to represent my feelings completely. I have no need or desire for the history of more than 3 months. It is tyrannical to limit the ability of Firefox users to limit their history. And no.... I have not create yet another account of Mozilla and 'vote '.

    There must be a way I and other users can limit (or increase) their history. So I ask "how?" This is, by design, to do this then I find a very disturbing trend, away from the philosophy of the user control and customization.

    If I'm missing something, please let know me. Please * don't * send me a bunch of standard items 'aid', because I read all. That is my question.

    Kind regards
    Axis

    You must create a new pref to around places.history.expiration.max_pages if you want to change the default behavior.

    You can watch the extension that I posted at the bottom of my answer above.

  • 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

  • Limit the "Record Type" options in the section search for presentation of the action bar

    Is it possible to limit the options of 'Record Type' in the 'Search' section in the disposition of the action bar for users specific role.

    Thank you!

    Mahesh, if you uncheck the box to go to step 2 of the role that you would restrict access to these types of records in the section of the application and research in the action bar.

  • Limit the search results with ", not".

    Is there a way to limit the search using the 'no '? For example, I searched for the industrial paper rolls and got pictures of toilet paper. I would have liked to find rolls of paper, excluding the toilet in the description of the image.

    Its possible using the sign less would help in that way it helps to google search.

  • How can I use the button "Insert" with RDP (German keyboard)

    Hello

    I would like to know what I have to press to simulate the Windows button "insert" (einfg in German) on my MacBook Pro 15 "mid 2015 (German keyboard) keyboard.

    I use remote desktop to connect to a Windows Terminal Server and have the Insert button in a tool of emulation that I need for my work, but I can't find a way to use this button.

    Can someone help me out here?

    ask on the forums Microsoft DRC since it is their software with which you experience problems.  c https://social.technet.Microsoft.com/forums/windowsserver/en-US/Home?Forum=winRD

  • How can I get the chart inserted with "Senior officer" at the center inside a table column?

    I'm trying to insert graphics into the columns of the table using 'Frame' above, but the inserted chart, don't Center not within the column, such as the text of paragraph. Horizontal alignment settings seems to be ignored for the chart.

    I can solve this problem by changing the image containing the graph in the reference page, alternatively by changing the margins of cell parameter in the paragraph designer but neiter of these solutions is really good. I would like a solution that really centers the chart in the column of table not only simulates, as I like it to be compatible with the design of future changes in master pages, etc. of lika.

    Is there a nice way to fix this?

    It seems rather as if senior / lower frame is always aligned to the left. This isn't just a problem of Table. It does the same thing in ordinary text blocks.

    I worked in a store, at home, we knew as our column width (which was constant) and controlled the placement of art in affecting the graphic block of reference Page at the address named full column width, then precisely position the art to the breast.

    Were I faced with columns or cells of variable thickness, I had probably not use FA/FB, but rather a framework anchored in graphic design, anchored at the point of Insertion, to a specific tag para (say CellAnchor), which is centered. The NextPgfTag would be CellBody.

  • Help! How to limit the digital range with a cell.

    Hello

    I am VERY new in Livecycle Designer ES.

    I'm trying to create a form simple calibration and must restrict entry into a cell in a specified numerical range.

    Example:

    Cell 1 Cell 2
    ToleranceFinal reading after calibration
    1.35 - 1, 47 v eff.This value must be 1.35 - 1: 47 <-this is what I have to limit!

    It would be nice to have a popup error window explaining the error, but not mandatory.

    Thanks in advance for you help!

    Bryan

    As part of the commit event for your domain, in the script editor, insert the following:

    this.rawValue > = 1.35 & this.rawValue<>

    Then to define what you want like error message, just go to the palette of the object. The 'Value' at the bottom tab, you can type in your error message in the "Message of Validation Script". Check that the error box is just the difference between the icon that appears in your error window.

    I hope this helps.

    Kyle

  • The labels inserted with form elements?

    The excellent series Missing Maual says DW CC 2014 that: creating forms, DW will also write label code when you ask him to insert the entries as a text box.  My CC DW 2014.1.1 (on Mac) does not, definitely.

    What is done?  The Missing Manual is simply wrong?  This feature has been removed?  Or...

    Appreciate the help, to understand where we are on that.

    Thank you, David Allen

    See if this video helps to clarify.

    Make the HTML5 forms in DW CC (video)

    http://TV.Adobe.com/watch/learn-Dreamweaver-CC/HTML5-forms-workflow/



    Nancy O.

  • The CPU insert with the clause to APPEND

    Hello!

    I have this insert in my main activity on the grid control to consume resources:

    ++ Insert /+ append * / into sys.ora_temp_1_ds_120564 select / * + no_parallel (t) no_parallel_index (t) dbms_stats cursor_sharing_exact use_weak_name_resl dynamic_sampling (0) no_monitoring * / 'CHAVEUNICA', 'CHAVEACESSO', 'DTPROCESSAMENTO', 'NRRECIBO', 'NRPROTOCOLO', 'XMLNOTA', 'XMLPROTOCOLO' to 'NFISCAL '. "' TB_NFISCALAUTORIZACAO ' sample (10.0000000000) t where TBL$ OR$ IDX$ PART$ NUM ("NFISCAL". "TB_NFISCALAUTORIZACAO", 0,4,0, "ROWID") =: objn ++ * + "

    The 'TB_NFISCALAUTORIZACAO' table has 256 million lines. I would like to understand what would be the sys.ora_temp_1_ds_120564 of the table and serve in this insert.


    Fix we will see an impression of activity in my base:

    https://www.dropbox.com/s/qjc10xoag46gskn/CONSUMPTION_CPU2.jpg
    and where the
    https://www.dropbox.com/s/04kqp80yu2w23u5/CONSUMPTION_CPU.jpg

    Thank you

    Rafael Ceolim

    If the last_analyzed DBA_TABLES column is changed every minute you pile up stats every minute. You need to know where DBMS_STATS in invoked and change the frequency, as appropriate.
    If last_analyzed column is not changed, then you must know what is the process called that statement. A first step would be to examine when the process is run so that what is happening. Please note that TBL$ OR$ IDX$ PART$ NUM is related to partitioning.

    Lordane Iotzov
    http://iiotzov.WordPress.com/

  • How can I limit the information displayed with a message?

    When I hilight a screen message includes twenty or more lines of technical information that I don't want and didn't used to be there. How can I get the display to normal email format?

    View (Alt - V) - headers - Normal

  • BEEP and Siebel: limit the number of records displayed in a table

    Hi all
    I use BEEP with Siebel. For example, my XML has a set of 50 activities. These activities are of a different type and different date. Now, I want to show:

    5 activities the newer type A in a table.
    5 activities the most recent type B in another table.
    5 activities the most recent type C in another table.

    I tried using the position() method, but since I use the same set of activities 3 times it will not work. The reason is that after you sort the activities in descending order of creation date, I could end up having 5 recent activities of type A digit 4, 9, 17, 23 and 31. That's why I can't use <? If: position() < 6? >.

    The 'worst' solution would be to create a link of multiple values in Siebel for each type of activity and prior filtering of activity types in the object link, so I could use the solution above to limit the records per table. But it is really more practical in my opinion.

    All welcome ideas on how to do this inside the model.

    If you couldn't do something similar to this in your model:

    <=5]?>

    If you wish, send me the sample xml data and a RTF file to [email protected] and I can take a look.

    Thank you!

  • I need help with the removal of "all records associated with my domain name.

    Hello

    I have some problemsthe same exact problem like Daren... set up my site to go live. Here's what I've done so far:

    (1) built the site and pushed it live

    2) updated the site

    (3) put in place a GoDaddy domain name

    (4) set up servers on GoDaddy

    (5) put in place the account information associated with British Colombia

    And then... nothing.

    I then removed from the area and tried to repeat the process, in case I missed something, but now I can not put in place a new area and get the error "field already exists. Please delete all the records associated with this area. What records? What does this even mean?

    Anyone can guide me please you through the steps to get this live site?

    Thank you!

    Alex

    The field works on my end.

    It just a delay which should get fixed in a few hours.

    Give it some time and check again.

    Thank you

    Sanjit

  • ORA-00001 violation, always on the 2nd insertion irrespective of the values

    Connected to:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    I get a UK violation when I shouldn't be, and I'm stuck.  Where to look to figure out what is causing the problem?  Excerpts below.

    I insert only two records.  The second insertion always fails, regardless of the value of LOT_NO.

    I.E.

    • If the first insert is with LOT_NO 1234, the 2nd insertion with LOT_NO 1235 fails.
    • If the first insert is with LOT_NO 1235, the 2nd insertion with LOT_NO 1234 fails.


    truncate table ppr_lots;


    commit;


    Select * from ppr_lots;  -not return any records


    -alter table ppr_lots change the lot_uk disable constraint;


    insert into PPR_LOTS (lot_no, lot_id, lot_type_id, lot_status_type_id, cadastral_area_id, land_tenure_type_id, land_use_type_id, lot_demarcation_type_id, the plan_id argument, address_id, lot_building_id, pid, legal_issues_yn, lot_size, area_unit_type_id, gis_data_captured_yn, short_legal_dsc, long_legal_dsc, eff_from_dtm) eff_through_dtm remarks_dsc, section_locator_no, lot_guid, logically_deleted_yn, concurrency_check_ts, log_created_by_user_id, log_created_ts, log_updated_by_user_id, log_updated_ts)

    values (1234, 2, 5305, 5201, 23, 4700, 1802, 5000, 1, null, null, 1, 'n', 10, 201, 'Y', 'GAC002001234', null, null, null, null, null, null, 'n', to_timestamp (27 November 2015 09:05:42.517978', 'dd-mm-yyyy hh24:mi:ss.ff'), 1, to_timestamp (27 November 2015 09:05:42.517978', 'dd-mm-yyyy hh24:mi:ss.ff'), null, null);


    insert into PPR_LOTS (lot_no, lot_id, lot_type_id, lot_status_type_id, cadastral_area_id, land_tenure_type_id, land_use_type_id, lot_demarcation_type_id, the plan_id argument, address_id, lot_building_id, pid, legal_issues_yn, lot_size, area_unit_type_id, gis_data_captured_yn, short_legal_dsc, long_legal_dsc, eff_from_dtm) eff_through_dtm remarks_dsc, section_locator_no, lot_guid, logically_deleted_yn, concurrency_check_ts, log_created_by_user_id, log_created_ts, log_updated_by_user_id, log_updated_ts)

    values (1235, 3, 5304, 5201, 24, 4701, 1802, 5000, 2, null, null, 2, 'n', 104.5, 200, 'Y', 'CEC003001235', null, null, null, null, null, null, 'n', to_timestamp (27 November 2015 09:05:42.538275', 'dd-mm-yyyy hh24:mi:ss.ff'), 1, to_timestamp (27 November 2015 09:05:42.538275', 'dd-mm-yyyy hh24:mi:ss.ff'), null, null);


    Error report-

    SQL error: ORA-00001: unique constraint (LIS_PPR. LOT_UK) violated

    00001 00000 - "forced single (s.%s) violated."

    * Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.

    For Trusted Oracle configured in DBMS MAC mode, you can see

    This message if there is an entry double at a different level.

    * Action: Either remove the single restriction or not to insert the key.

    BTW, if I turn off the UK, everything is fine.

    -Ken

    LOT_UK is defined simply as follows.

    ALTER TABLE PPR_LOTS

    ADD CONSTRAINT LOT_UK UNIQUE

    (

    LOT_NO

    )

    USING INDEX

    (

    CREATE A UNIQUE LOT_UK ON PPR_LOTS (LOT_NO CAD) INDEX

    LOGGING

    TABLESPACE USERS

    PCTFREE 10

    INITRANS 2

    STORAGE

    (

    65536 INITIAL

    NEXT 1048576

    MINEXTENTS 1

    MAXEXTENTS UNLIMITED

    DEFAULT USER_TABLES

    )

    NOPARALLEL

    )

    ENABLE;

    Found the problem.

    I thought that I had disabled triggers.  Turns out I didn't, and a defective trigger is overwhelming as LOT_NO.

    It's always the answer is simple.

    -Ken

Maybe you are looking for

  • Pages - trying to link the issue to the paragraph of the answer

    Hi there: neophyte user Pages for businesses trying to link the issue of the survey to a paragraph "answering machine".  As an example... Question: What's your brown grass?  Yes No If the answer is Yes, then want to fill and print a paragraph explain

  • BSOD when moving hp 4520 s

    HelloI have windows 8 x 64installed almost 1 year ago and my hp probook 4520 s is 2.5 years and work great in this period5 and graphic CPU is amd hd 4300/4400health, autorun and dump file of check are all attached with your exclusive report file.I ha

  • MathScript childcare

    Reactions of NOR Mathscript support structures in LV 2011? There was mention that it is on the roadmap for LV 2011 in one post, that I found on this forum, but this refers to the NIWeek 2009.

  • my windows livemessenger cannot connect will not come

    sing my windows or connection it don't dose me no newspapers in all I get is up grade Skype which will not down load on my computer

  • running msconfig I find BOOT. INI is missing, how do I get it back

    while I start my laptop I get the message "invalid boot.ini". booting from C:/WINDOW. I checked running msconfig in the run command and find out all the perimeter ok except boot.ini by report with another machine. I can fix msconfig with boot.ini fil