When the id program in the base table will be updated?
Hello
I have a trigger on the table mtl_system_items_b that fires events when a record is created / updated. I need to create a program that will update the records in the table, but at the same time, it will not trigger trigger events for the updated records. My plan is to use the program_id column in the MSIB table to check if the particular update is done by the new program. Now, the question is, what happens if the same record is updated by any user front end (after the execution of the program)? It will update the program to something else id so that the trigger fires the event? If this isn't the case, then how can I limit the trigger for these recordings?
We can disable the trigger during execution of the program, but that we will lose some updates made by users on other records.
Thanks in advance... !!
Devendra
Hi Devendra,
When someone updates the same record on before the id program also updates.
Solution because it would be too write a when clause to your relaxation. Something like below
CREATE OR REPLACE TRIGGER
after insert/update REFERRING AGAIN AS NINE OLD AND OLD FOR EACH LINE Where (NEW.program_id =
DECLARE
end; hope this helps you. Kind regards SoundariyaKumar.R
Tags: Oracle Applications
Similar Questions
-
When Android apps up to date. Fix mobile photoshop Lightroom, etc.
Adobe does not address future plans in the open forums, so that nobody here knows
https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform for feature requests
-
How to compare the length of the data to a staging table with the definition of the base table
Hello
I have two tables: staging of the table and the base table.
I get flatfiles data in the staging of the table, depending on the structure of the requirement of staging of the table and the base table (length of each column in the staging table is 25% more data dump without errors) are different for ex: If we have the city long varchar 40 column in table staging there 25 in the base table. Once data are discharged into the intermediate table that I want to compare the actual length of the data for each column in the staging table with the database table definition (data_length for each column of all_tab_columns) and if no column is different length that I need to update the corresponding line in the intermediate table which also has an indicator called err_length.
so for that I use the cursor c1 is select length (a.id), length (b.SID) of staging_table;
c2 (name varchar2) cursor is select data_length all_tab_columns where table_name = 'BASE_TABLE' and column_name = name;
But we get atonce data in the first query while the second slider, I need to get for each column and then compare with the first?
Can someone tell me how to get the desired results?
Thank you
Manoi.Hey, Marco.
Of course, you can set src.err_length in the USING clause (where you can reference all_tab_columns) and use this value in the SET clause.
It is:MERGE INTO staging_table dst USING ( WITH got_lengths AS ( SELECT MAX (CASE WHEN column_name = 'ENAME' THEN data_length END) AS ename_len , MAX (CASE WHEN column_name = 'JOB' THEN data_length END) AS job_len FROM all_tab_columns WHERE owner = 'SCOTT' AND table_name = 'EMP' ) SELECT s.ename , s.job , CASE WHEN LENGTH (s.ename) > l.ename_len THEN 'ENAME ' END || CASE WHEN LENGTH (s.job) > l.job_len THEN 'JOB ' END AS err_length FROM staging_table s JOIN got_lengths l ON LENGTH (s.ename) > l.ename_len OR LENGTH (s.job) > l.job_len ) src ON (src.ename = dst.ename) WHEN MATCHED THEN UPDATE SET dst.err_length = src.err_length ;
As you can see, you have to hardcode the names of the columns common to several places. I swam () to simplify that, but I found an interesting (at least for me) alternative grouping function involving the STRAGG user_defined.
As you can see, only the subquery USING is changed.MERGE INTO staging_table dst USING ( SELECT s.ename , s.job , STRAGG (l.column_name) AS err_length FROM staging_table s JOIN all_tab_columns l ON l.data_length < LENGTH ( CASE l.column_name WHEN 'ENAME' THEN ename WHEN 'JOB' THEN job END ) WHERE l.owner = 'SCOTT' AND l.table_name = 'EMP' AND l.data_type = 'VARCHAR2' GROUP BY s.ename , s.job ) src ON (src.ename = dst.ename) WHEN MATCHED THEN UPDATE SET dst.err_length = src.err_length ;
Instead of the user-defined STRAGG (that you can copy from AskTom), you can also use the undocumented, or from Oracle 11.2, WM_CONCAT LISTAGG built-in function.
-
Add more than 2 lines for a select statement without inserting rows in the base table
Hi all
I have a below a simple select statement that is querying a table.
Select * from STUDY_SCHED_INTERVAL_TEMP
where STUDY_KEY = 1063;
but here's the situation. As you can see its return 7 ranks. But I must add
2 rows more... with everything else, default or what exist... except the adding more than 2 lines.
I can't insert in the base table. I want my results to end incrementing by 2 days in
measurement_date_Taken on 01-APR-09... so big measurement_date_taken expected to
end at study_end_Date...
IS IT STILL POSSIBLE WITHOUT INSERT ROWS IN THE TABLE AND PLAYIHY ALL AROUND WITH
THE SELECT STATEMENT?
Sorry if this is confusing... I'm on 10.2.0.3
Published by: S2K on August 13, 2009 14:19Well, I don't know if this request is as beautiful as my lawn, but seems to work even when ;)
I used the "simplified" version, but the principle should work for your table, S2K.
As Frank has already pointed out (and I fell on it while clunging): simply select your already existing lines and union them with the 'missing documents', you calculate the number of days that you are "missing" based on the study_end_date:MHO%xe> alter session set nls_date_language='AMERICAN'; Sessie is gewijzigd. Verstreken: 00:00:00.01 MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn 2 select 1063 study_key 3 , to_date('01-MAR-09', 'dd-mon-rr') phase_start_date 4 , to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken 5 , to_date('01-APR-09', 'dd-mon-rr') study_end_date 6 from dual union all 7 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 8 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 9 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 10 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 11 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 12 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual 13 ) -- actual query: 14 select study_key 15 , phase_start_date 16 , measurement_date_taken 17 , study_end_date 18 from t 19 union all 20 select study_key 21 , phase_start_date 22 , measurement_date_taken + level -- or rownum 23 , study_end_date 24 from ( select study_key 25 , phase_start_date 26 , measurement_date_taken 27 , study_end_date 28 , add_up 29 from ( 30 select study_key 31 , phase_start_date 32 , measurement_date_taken 33 , study_end_date 34 , study_end_date - max(measurement_date_taken) over (partition by study_key 35 order by measurement_date_taken ) add_up 36 , lead(measurement_date_taken) over (partition by study_key 37 order by measurement_date_taken ) last_rec 38 from t 39 ) 40 where last_rec is null 41 ) 42 where rownum <= add_up 43 connect by level <= add_up; STUDY_KEY PHASE_START_DATE MEASUREMENT_DATE_TA STUDY_END_DATE ---------- ------------------- ------------------- ------------------- 1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00 9 rijen zijn geselecteerd.
Is there a simpler way (in SQL), I hope that others join, and share their ideas/example/thoughts.
I feel that it is using more resources there.
But I have to cut the daisies before now, they interfere my 'grass-green-ess";) -
the base tables store jobs oem
Hello
I have some work in the Oracle Enterprise Manager job console. (These jobs call a PL/SQL procedure). Can you please let me know what are the base tables that store the names of this work, work planning and other information about jobs? The version of database is Oracle 9i and OEM version 9.0.2
Thank you
RKHello
using the repository databaseWork 4SystemJOBS tables
--> Connect as SYSDBA
# > export ORACLE_SID = emrep
# > sqlplus / as sysdba
SQL # > select table_name from user_tables where table_name like '% % ';4Emrep (OEMGC) work tables
--> Connect as SYSMAN
# > sqlplus sysman/MYPASS@emrep
SQL # > select table_name from user_tables where table_name like '% % ';
SQL # > mgmt_job desc;* T
-
reason for updating a view rather than on the base table
Can someone tell me what is the reasons that sometimes we would update a view rather than on the base table? I always thought that we cannot update a view, of course, I am wrong. Thank youHi Welcome to the Forum
Basically, a view is used to present the data, a different way. He can rely on more than one table and we cannot update a
Discover directly that contains Sql functions, aggregate functions, a group of Clause and a view created excluding the required columns of the table.In all the cases mentioned Instead of trigger is very useful
Published by: user10862473 on July 28, 2009 07:10
-
When the 11g CMO will they be released?
Dear friends
When the 11g CMO will they be released?
Do we not have a phase of beta as the other reviews?
Thank you.
Kind regards
HubWe have interim deadlines for reviews of CMO 11 g to be released. Our hope is that upgrade of 1 day 11 g CMO will be available at the end of April. This review will upgrade the candidates in the 9i or 10g 11g CMO CMO. The new 2 day 11g exam CMO should be available by the end of June. Please keep in mind that the dates are subject to change. This is the latest information we have at this moment.
Kind regards
Brandye Barrington
Certification Forum Moderator
Manager certification program -
When the gogle toolbar will be compatible
When the toolbar Google will be available compatible.
It will not and Google themselves no longer support it. Anyway, almost all of the features of the Google toolbar are available in Firefox.
For more detailed information and links Googles of information please read
-
Why is-strike (shift-") on my keyboard (@) key? When the other my keyboard is (update 2).
Hi acesdie,
Probably to do with the language of the keyboard. Shift + 2 is the American keyboard. Go to control panel and click the language and region. In the window of the region and language, click the keyboard and languages and then click on the button "change keyboards. What language is in the box 'default language'? If it's in the United Kingdom and you are not in the United Kingdom, then click the Add button and select English (United States). Click the plus (+) next to the English (United States) option and then click on the plus sign (+) next to the option "keyboard". Here you will see a list of the types of keyboards, i.e. the United States Dvorak, Dvorak to the United States for the left hand, etc. If you have a keyboard to type Dvorak, then select one of them; If this isn't the case, then I suggest to choose the United States (international) or simply WE. Then click on the arrow to the right of the box in the section "default input language" and select English (United States), and then click apply then OK.
This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.
John Barnett MVP: Windows XP Expert associated with: Windows Desktop Experience: Web:http://www.winuser.co.uk; Web:http://xphelpandsupport.mvps.org; Web:http://vistasupport.mvps.org; Web:http://www.silversurfer-guide.com
-
Well when I transfer my videio and/or photos from my camera sd card, when the transfer images will open in Windows Live Photo Gallery with pictures showing as a large icon. My photos are stored on my HP-Pavilion(E:).) drive
But after that when I click on the drive C: E: MyPictures they open as a flower tile. I can go to the top, then click on view and then large icon and they will change to display an icon of the photo. But the next time I go in this same folder they showup new slot-shaped sticker flower. I can go through the same process and click the show the big icon and they will change to a large icon image.
It was that all of my photos, at all times, remained as a large icon all the time. Something has changed this feature.
Now I can go to the libraries, photos, My Pictures(E:) et cliquez sur n'importe quel dossier et le dossier s'ouvre avec les images dans ce dossier, montrant une image de grande icône.)
Something has changed at the sight of my photos in the folder that contains photos. I can't stay on display large icons.
Thank you
Hey
Follow article
http://www.SevenForums.com/general-discussion/75911-how-can-i-keep-all-folders-changing.html
Good luck
-
When the creative cloud installs an update happens to 5%, and then he said: try to connect to the server. Any suggestions
Please refer to the document:
- Using creative cloud | Download error in the applications tab of Creative Cloud Desktop Application
- Error download or update Adobe Creative Cloud applications
- Connect to CC - stuck on "Installing update..."
Concerning
Stéphane
-
Data block in the procedure and the Base Table
Hello
I hava a form with a block of master and detail. The fields in the Master block are
Emp_name, DateOfJoin, salary... I created this block with the procedure with a Ref Cursor, becaue the user
want to load the data based on the conditions it enter for example: DateOfJoin < = Sysdate and DateOfJoinn July 1, 2008 "."
SO I created a block of control with the fields name, MiddleName, LastName, of DateOfJoin, in DateOfJoin, the salary, and when the user clicks on the data loading
button, I load the data to block under these conditions using the procedure.
Note that in the Emp_Name table if a field, but contain first name, middle name, and last name with a separate space.
My needs is, is there any method to develop this master block with a database table, so that if the user want to select it
data based on other conditions, it can enter directly into the block of data using Qry enter and run Qry, also if he wants to
Select data based on the top-level asked the search criteria, it will click Load Data.
I hope that in this case, when the user selected the Load data button, I need to change the data source to the Type of procedure and set the source of data on behalf of the procedure name.
Is there any other easy solution flor this
Thanks in advancenot sure if I get your needs. I understand the following:
You have a block based on table emp, containing a DateOfJoin column and the user should be able to enter into a 'complex' where denomination.To do this, you do not have to base block one a procedure or ref_cursor. Two possibilities:
Add two fields more directly in the block that are non-base of data-objects of type date fixed query on yes and let the user to enter a date range in these columns. In the accumulation of PRE-QUERY-trigger a WHERE condition by using the value in this field:
something like:
DECLARE vcMin VARCHAR2(10):='01.01.1700'; vcMax VARCHAR2(10):='01.01.2999'; BEGIN IF :BLOCK.DATE_FROM_JOIN IS NOT NULL THEN vcMin:=TO_CHAR(:BLOCK.DATE_FROM_JOIN, 'DD.MM.YYYY'); END IF; IF :BLOCK.DATE_TO_JOIN IS NOT NULL THEN vcMax:=TO_CHAR(:BLOCK.DATE_TO_JOIN, 'DD.MM.YYYY'); END IF; SET_BLOCK_PROPERTY('BLOCK', ONETIME_WHERE, 'DATEOFJOIN BETWEEN TO_DATE(''' || vcMin || ''', ''DD.MM.YYYY'') AND TO_DATE(''' || vcMax || ''', ''DD.MM.YYYY'')'); END;
Another option:
together, the length of the request of the DATEOFJOIN field to say 255, then the user can directly enter #BETWEEN fromdate AND fodate in the field. -
Behavior when the BootP table is empty
What is the behavior of a cFP-2220, if it is configured to use DHCP and it gets a contact with a BOOTP server, which happens to have a cleared BOOTP table? Always starts the RT app (stop over TCP is set to False) and function normally, but with a link-local address?
Is there a difference between having online with a DHCP server and using a BOOTP server?
We have a case where one such controller seems to freeze upwards, the status LED starts flashing 4 times in a row. We cannot recreate it with a DHCP server.
(This particular case is a bit special because it also involves an application that will try to reconfigure the controller to static (using the System Configuration API 5.0) IP if it does not get a valid IP address in the DHCP boot AND it has a valid IP address of a previous start saved in an INI file, and it is difficult to say exactly when the accident occurred... But there is a difference in the startup behavior to predict?)
FYI - this issue is now explained and fixed in part in another thread here on the forum:
-
Enlarge the cell size in the control table will be slower enforcement program?
I write data in the table control and to some color the background of the cell. First of all, I work with the table control in the smaller size. After that, when I put my cell more I found that the update data is slower when the cell size is smaller. Is there a solution for this problem?
I store all my data in the shift register, and then update only to the table. I found that in this way the data will out in faster table and then update a.
-
How to MERGE when the target table contains invisible columns?
Oracle running on Oracle Linux 6.4 12.1.0.2.0 database:
During his studies of FUSION with invisible columns, I discovered that invisible columns in the target table cannot be read. Workaround seems to be
MERGE INTO (SELECT <column list> FROM <target table>) AS <alias>
However, the documentation does not seem to allow this. Here are the details.
Test data
> CREATE TABLE t_target( k1 NUMBER PRIMARY KEY, c1 NUMBER, i1 NUMBER invisible ) table T_TARGET created. > INSERT INTO t_target (k1,c1,i1) SELECT 2, 2, 2 FROM dual UNION ALL SELECT 3, 3, 3 FROM dual UNION ALL SELECT 4, 4, 4 FROM dual 3 rows inserted. > CREATE TABLE t_source( k1 NUMBER PRIMARY KEY, c1 NUMBER, i1 NUMBER invisible ) table T_SOURCE created. > INSERT INTO t_source (k1,c1,i1) SELECT 1, 1, 1 FROM dual UNION ALL SELECT 2, 2, 9999 FROM dual UNION ALL SELECT 3, 3, 3 FROM dual 3 rows inserted.
First try
Please note that I have a WHERE clause in the WHEN MATCHED clause. Its purpose is to avoid the update of a row when data are already correct. The WHERE clause is trying to read the invisible column of the target table.
> MERGE INTO t_target o USING ( SELECT k1, c1, i1 FROM t_source ) n ON (o.k1 = n.k1) WHEN MATCHED THEN UPDATE SET c1=n.c1, i1=n.i1 WHERE 1 IN ( decode(o.c1,n.c1,0,1), decode(o.i1,n.i1,0,1) ) WHEN NOT MATCHED THEN INSERT (k1, c1, i1) VALUES(n.k1, n.c1, n.i1) ... Error at Command Line : 10 Column : 12 Error report - SQL Error: ORA-00904: "O"."I1": invalid identifier
As you can see, I put a subquery after the USING clause so that 'n.i1' would be 'visible', but this is not enough since the 'I1' column in the target table is always invisible.
Second test
> MERGE INTO ( SELECT k1, c1, i1 FROM t_target ) o USING ( SELECT k1, c1, i1 FROM t_source ) n ON (o.k1 = n.k1) WHEN MATCHED THEN UPDATE SET c1=n.c1, i1=n.i1 WHERE 1 IN ( decode(o.c1,n.c1,0,1), decode(o.i1,n.i1,0,1) ) WHEN NOT MATCHED THEN INSERT (k1, c1, i1) VALUES(n.k1, n.c1, n.i1) 2 rows merged.
Here I used a subquery in the INTO clause thus, and it worked.
Unfortunately, this does not seem to be admitted in the documentation: IN fact refers to a table or a view as schema objects.
My question is:
How can I refer to invisible columns in the target table without creating a new object? My workaround using a subquery solution seems to work very well, but can I recommend if it is not documented?
Can I replace a "inline view" for a view and still be supported?
During his studies of FUSION with invisible columns, I discovered that invisible columns in the target table cannot be read. Workaround seems to be
However, the documentation does not seem to allow this. Here are the details.
Here I used a subquery in the INTO clause thus, and it worked.
Unfortunately, this does not seem to be admitted in the documentation: IN fact refers to a table or a view as schema objects.
My question is:
How can I refer to invisible columns in the target table without creating a new object? My workaround using a subquery solution seems to work very well, but can I recommend if it is not documented?
Can I replace a "inline view" for a view and still be supported?
But the documentation DO ALLOWS not only! You use a view - a view online and those that can be changed in a MERGE statement.
All versions of the doc for FUSION since 9i specifically say this:
INTO clause
Use the
INTO
target clause to specify the table or view you are updating or inserting into. To merge the data in a view, the view must be updated. Please refer to the "Notes on the editable views" for more information.Here are the links for the doc. 9i, 10g, 11g and c 12, ALL OF THEM (the last three), except 9i have this EXACT clause above.
SQL statements: INDICATED to ROLLBACK FALLS, 15 of 19
http://docs.Oracle.com/CD/B19306_01/server.102/b14200/statements_9016.htm
http://docs.Oracle.com/CD/B28359_01/server.111/b28286/statements_9016.htm
https://docs.Oracle.com/database/121/SQLRF/statements_9016.htm
9i doc does not have this specific quote in the INTO clause section, but it doesn't have that quote a little later:
Limitation of the update of a view
- You cannot specify
DEFAULT
when refreshing a view. - You cannot update a column referenced in the
ON
condition
clause.
merge_insert_clause
The
merge_insert_clause
specifies the values to insert into the column of the target table, if the condition of theON
clause is false. If the insert clause is executed, then all insert triggers defined on the target table are activated.Restrictions on the merger in a view
You cannot specify
DEFAULT
when refreshing a view.If your "workaround" isn't really a workaround solution. You SHOULD use an inline view if you need to reference a column "invisible" in the target table, since otherwise, these columns are INVISIBLE!
My workaround using a subquery solution seems to work very well, but can I recommend if it is not documented?
You can recomment it because IT IS documented.
- You cannot specify
Maybe you are looking for
-
Dear Sir, I am unable to see you tube to Firefox browser. hearing is only audio. black screen is displayed. I can see it on other browsers. Please notify.However, I can see thumbnail when I move the mouse over the timeline of the video stream.concern
-
What does mean MCMailErrorDomain error 1032
What does mean MCMailErrorDomain error 1032? and how it resolved
-
Hello I recently got a HP Envy 23-060qd and it's a great machine. Currently when I try to save all the I am recording is what comes of ther speakers. I woud rather record what is happening off the coast of the sound card What myust settings adjust f
-
Installation stops HP laserjet pro 200
Hello I have a problem with the installation of my printer HP laserjet pro 200. My laptop is a 8.1 64-bit Windows. I use the latest installation files downloaded on HP - com. When the installation guide asks for the USB connection between the compute
-
Photosmart HP 6520: HP 6520 will not scan
6520 used to work without problem on the old pc w/windows 7. I have a new Toshiba satellite w/AMD 8. Prints fine but will not computer scan. Message on printer said computer unresponsive and check the usb connection. I rebooted driver did not help.