Update sql need help for hierarchy table
I'm trying to update the raw field based on each unit Qty is the appearance of the table.slevel | Manager | seller | unit_qty | gross Qty
0 | Mary | Mary | 1. 1
.1 | Mary | Lynn | 3. null
.1 | Mary | Betty | 2. null
.1 | Mary | Alice | 2. null
.. 2. Alice | Susan | 1. null
.1 | Mary | Amy | 4. null
I'd like the table to look like this after the update, with the values
slevel | Manager | seller | unit_qty | gross Qty
0 | Mary | Mary | 1. 1
.1 | Mary | Lynn | 3. 3 * 1 = {color: #ff0000} 3 {color}
.1 | Mary | Betty | 2. 2 * 1 = {color: #ff0000} 2 {color}
.1 | Mary | Alice | 2. {color: #008000} 2 * 1 {color} = {color: #ff0000} 2 {color}
.. 2. Alice | Susan | {color: #0000ff} 1 {color} | {color: #008000} 2 * 1 {color} {color: #0000ff} * 1 {color} = {color: #ff0000} 2 {color}
.1 | Mary | Amy | 4. 4 * 1 = {color: #ff0000} 4
{color}
It is the SQL, I've tried to use unsuccessfully.
Update table set gross_qty = unit_qty * ({color: #ff0000} select gross_qty from table {color})
({color: #ff0000} where Manager = seller {color})
where slevel & gt; 0
This is not the same thing?
UPDATE vendor s1
SET s1.gross_qty =
(CASE
WHEN s1.slevel = 0 THEN s1.unit_qty
WHEN s1.slevel > 0 THEN
S1.unit_qty * (SELECT SELLER s2 WHERE s2.client = s1.manager s2.gross_qty)
(END);
I wrote here a basis of hierarchical queries:
http://blog.mclaughlinsoftware.com/hierarchical-queries-basics/
It could be that useful...
Tags: Database
Similar Questions
-
Paging query needed help for large table - force a different index
I use a slight modification of the pagination to be completed request to ask Tom: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]
Mine looks like this to extract the first 100 lines of everyone whose last name Smith, ordered by join date:
The difference between this and ask Tom is my innermost query returns just the ROWID. Then, in the outermost query we associate him returned to the members table ROWID, after that we have cut the ROWID down to only the 100 piece we want. This makes it MUCH more (verifiable) fast on our large tables, because it is able to use the index on the innermost query (well... to read more).SELECT members.* FROM members, ( SELECT RID, rownum rnum FROM ( SELECT rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate ) WHERE rownum <= 100 ) WHERE rnum >= 1 and RID = members.rowid
The problem I have is this:
It will use the index for the column predicate (last_name) rather than the unique index that I defined for the column joindate (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can reference using one of the following methods:SELECT rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
SELECT /*+ index(members, joindate_idx) */ rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
Whatever it is, it now uses the index of the column ORDER BY (joindate_idx), so now it's much faster there not to sort (remember, VERY large table, millions of records). If it sounds good. But now, on my outermost query, I join the rowid with the significant data in the members table columns, as commented below:SELECT /*+ first_rows(100) */ rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
As soon as I did this join, this goes back to the use of the index of predicate (last_name) and perform the sort once he finds all the corresponding values (which can be a lot in this table, there is a cardinality high on some columns).SELECT members.* -- Select all data from members table FROM members, -- members table added to FROM clause ( SELECT RID, rownum rnum FROM ( SELECT /*+ index(members, joindate_idx) */ rowid as RID -- Hint is ignored now that I am joining in the outer query FROM members WHERE last_name = 'Smith' ORDER BY joindate ) WHERE rownum <= 100 ) WHERE rnum >= 1 and RID = members.rowid -- Merge the members table on the rowid we pulled from the inner queries
My question therefore, in the query full above, is it possible that I can get to use the ORDER of indexing BY column to prevent having to sort? The join is what makes go back to using the predicate index, even with notes. Remove the join and just return the ROWID for these 100 records and it flies, even over 10 millions of documents.
It would be great if there was some generic hint that could accomplish this, such as if we change the table/column/index, do not change the indicator (indicator FIRST_ROWS is a good example of this, while the INDEX indicator is the opposite), but any help would be appreciated. I can provide explain plans for the foregoing, if necessary.
Thank you!
-
I need help for the upgrade of my current system.
I need help for the upgrade of my current system.
I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.
I want to make the larger environment using the following:
(1) apply Virtualization
(2) apply to the failover process (clustering)
"(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.
Storage 4) that supports Raid (1 and 5)
UTM excellent 6) that supports (SSL VPN, VPN Global)
suitable backup solution 7)
(8) good antivirus for clients
my questions:
(1) can you provide me with a good design for this environment
(2) should I choose what operating system:
Microsoft datacenter or company
I know datacenter provide us the unlimited VM but needs per processor license
so if I have two Grouped servers I want to buy 4 licenses
and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?
(3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?
(4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?
(5) what about win2k8 license for VM:
lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?
(6) can I use backExec license for SBS with windows 2008 standard
(7) who better to virtualization AMD or INTEL
(8) hyper V or VMware?
(9) what of Microsoft data protection Manager... is this good?
(10) what virtual machine manager? What are the benefites keys
Thanks in advance
Hello AnasAI,
You can find the Server forums on TechNet support, please create a new post at the following link:
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
-
Need help for optical safety circuit.
I buy these parts and prototype with real components, but since I multisim, I thought it would be nice to create the circuit and maybe work through issues I can practically.
I need a circuit that takes 120 VCA, generates 5 VDC and 1.5Vdc power of optical transmitter and receiver. I actually use a data port because he has great range and is pretty cheap. Rather than send the binary code well I just send a light stead that is broken or not broken through doors and windows in my house. Then the receiver sees this as an entry and order a relay.
I tried several voltage regulators that come with multisim, but I get an error of execution of my circuit. Really I can't the 120 VAC to power levels necessary for the functioning of the optics.
Otherwise I might want to run on a system 120Vdc with battery backup, so throw a 120Vdc up to 20 v DC switching power supply - but I have not found a SMP in the library which takes 120 as input and as output 20.
Basic plan: 120VAC source-> transform to 24Vac-> Full bridge rectifier to ~ 20 v DC-> voltage capacitor filter on the input of two voltage regulators (1 to 5 VDC, 1 to 1.5Vdc) - then circuit since the two power supply of the transmitter and the receiver.
I just need help for 5V and 1.5V, from there, I know that the real world circuit will work component tests already carried out. Thanks for reading.
I didn't Multism so I can't advise you on the compatible models. I ran the model on semiconductors with slight modifications of format on my SPICE simulator based on Berkeley Spice 3f5. I had to change the format of model resistance semiconductors appeal but has not changed any values.
The output of your power supply circuit 3 (with 5 V, not the 1.5 V regulator regulator) was 4.99995 V.
There are a few messages about changing templates published for compatibility Multisim woth. You can search those to see if there are any suggestions on what you'll need to fix in the model.
Lynn
-
I need help for activation of the real administrator account.
I have a problem with Adobe reader 9 standard, Adobe customer service asked the unhide real administrator account before you can continue to help me.
I need help for that.
http://www.Vistax64.com/tutorials/67567-administrator-account.html
Read the above info.
See you soon. Mick Murphy - Microsoft partner
-
I need help for my reader to USB drive on my windows 10 ACER?
I need help for my reader to USB stick on my chrome windows 10 plug ins acer. Can you help me?
What Adobe application that you use?
This is the Adobe Media Encoder forum, and you did not mention anything on this subject. If you can let us know what Adobe application, you need help, we can help you make the right forum.
Thank you
Regalo
-
Hello, I need help for cancel the payment on my adobe account.
Hello, I need help for cancel the payment on my adobe account. I'm from Peru, Im paying a monthly fee as a student. Help, please...
-
Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him. Thank you very much
Hey ihorl18351266,
Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.
Kind regards
Ana Maria
-
[8i] need help for updating/fixing work table
I work in an old database:
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
PL/SQL Release 8.1.7.2.0 - Production
CORE 8.1.7.0.0-Production
AMT for HP - UX: 8.1.7.2.0 - Production Version
NLSRTL Version 3.4.1.0.0 - Production
I'm trying to fix a work schedule, and I'm not exactly sure how do. I am accustomed to querying data, do not make changes to the data...
Some examples of data:
Note: 2010-12-31 is the last time that I am 100% sure that the data in the table are good. After that, clndr_days and work_days are absent or at least in the case of work_days, are not correct No.CREATE TABLE test_cal ( clndr_dt DATE NOT NULL , work_day NUMBER(3) , clndr_days NUMBER(6) , work_days NUMBER(5) ); INSERT INTO test_cal VALUES (TO_DATE('12/30/2010','mm/dd/yyyy'), 254, 11322, 7885); INSERT INTO test_cal VALUES (TO_DATE('12/31/2010','mm/dd/yyyy'), 255, 11323, 7886); INSERT INTO test_cal VALUES (TO_DATE('01/01/2011','mm/dd/yyyy'), 0, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/02/2011','mm/dd/yyyy'), 0, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/03/2011','mm/dd/yyyy'), 1, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/04/2011','mm/dd/yyyy'), 2, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/05/2011','mm/dd/yyyy'), 3, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/06/2011','mm/dd/yyyy'), 4, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/07/2011','mm/dd/yyyy'), 5, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/08/2011','mm/dd/yyyy'), 0, NULL, NULL); INSERT INTO test_cal VALUES (TO_DATE('01/09/2011','mm/dd/yyyy'), 0, 11332, 7895); INSERT INTO test_cal VALUES (TO_DATE('01/10/2011','mm/dd/yyyy'), 6, 11333, 7896);
It is a question of both parties, since I need to set the clndr_days and the work_days. (You can fix probably both with a single statement, but I broke it into two to start, to simplify it for me).
I show only 12 days in my sample data, but really, the table stretches in a number of years and pass another 5 years.
PART 1: determination of clndr_days
I've implemented this request:
Who gives the right clndr_days (like clndr_days_test), but I don't know how to get that in the table.SELECT clndr_dt , work_day , work_days , clndr_days , min_clndr_day + r_num AS clndr_days_test FROM ( SELECT t.* , MIN(clndr_days) OVER(ORDER BY clndr_dt) AS min_clndr_day , ROW_NUMBER() OVER(ORDER BY clndr_dt)-1 AS r_num FROM test_cal t WHERE clndr_dt >= TO_DATE('12/31/2010','mm/dd/yyyy') ) ;
It does not work:
and I don't know how to operate...UPDATE test_cal SET clndr_days = ( SELECT min_clndr_day + r_num FROM ( SELECT t.* , MIN(clndr_days) OVER(ORDER BY clndr_dt) AS min_clndr_day , ROW_NUMBER() OVER(ORDER BY clndr_dt)-1 AS r_num FROM test_cal t WHERE clndr_dt >= TO_DATE('12/31/2010','mm/dd/yyyy') ) c WHERE c.clndr_dt = ??? -- how do I make this equal whatever the clndr_dt is for the record I'm updating? ) WHERE clndr_dt > TO_DATE('12/31/2010','mm/dd/yyyy')
PART 2: Fixing work_days
Then, I can't set up a query for work_days.
That's what I have so far, but it does not work quite right, and then it must also be as well an UPDATE statement:
(When I tried to use LAG, that did not work either, because you can have more than 1 non consecutive working day and so it only works for the first day of non-working to have the correct work_days, and then it is to be wrong again)SELECT clndr_dt , work_day , work_days , clndr_days , min_work_day + r_num AS work_days_test --this isn't right, when work_day is 0 work_days_test should be the previous work_day not the minimum work_day FROM ( SELECT t.* , MIN(work_days) OVER ( ORDER BY clndr_dt) AS min_work_day , CASE WHEN work_day <> 0 THEN ROW_NUMBER() OVER ( PARTITION BY CASE WHEN work_day <> 0 THEN 1 ELSE 2 END ORDER BY clndr_dt ) ELSE 0 END AS r_num FROM test_cal t WHERE clndr_dt >= TO_DATE('12/31/2010','mm/dd/yyyy') ) ;
That's what I want my table to look like in the end:
(Sorry for all the additional decimals)CLNDR_DT WORK_DAY WORK_DAYS CLNDR_DAYS_TEST ------------------- --------------- --------------- --------------- 12-31-2010 00:00:00 255.000 7,886.000 11,323.000 01-01-2011 00:00:00 .000 7,886.000 11,324.000 01-02-2011 00:00:00 .000 7,886.000 11,325.000 01-03-2011 00:00:00 1.000 7,887.000 11,326.000 01-04-2011 00:00:00 2.000 7,888.000 11,327.000 01-05-2011 00:00:00 3.000 7,889.000 11,328.000 01-06-2011 00:00:00 4.000 7,890.000 11,329.000 01-07-2011 00:00:00 5.000 7,891.000 11,330.000 01-08-2011 00:00:00 .000 7,891.000 11,331.000 01-09-2011 00:00:00 .000 7,891.000 11,332.000 01-10-2011 00:00:00 6.000 7,892.000 11,333.000
Published by: user11033437 on January 11, 2012 13:40Hello
Thanks for posting the CREATE TABLE and instructions INSERT, the desired output that is very clear, and your attempts; It's all very useful. It would also be useful to explain how you get the desired based on the sample results. There's always a chance, a person could get by chance good results for the wrong reasons with the small set of sample data, but allows you to get complete wrong results with your data would cause.
It seems that clndr_days is the total number of days elapsed since some point of conventional departure (perhaps when the company started), and that work_days is the total number of days of work to a starting point. It seems that work_day is 0 when the day is not a working day, and otherwise, the total number of working days so far in the calendar year. Is this fair?You said the data after December 31, 2010 is not reliable. Did you mean that two columns (clndr_days and work_days) are not reliable, but the rest of the data is reliable? In other words, are you sure there is only one line a day even after that 2010 and the work_day column is accurate? If so, you can do this:
UPDATE test_cal m SET (clndr_days, work_days) = ( SELECT MIN (clndr_days) + COUNT (*) - 1 -- clndr_days , MIN (work_days) + COUNT ( CASE WHEN work_day > 0 AND clndr_dt > TO_DATE ('12/31/2010', 'MM/DD/YYYY') THEN 1 END ) -- work_days FROM test_cal WHERE clndr_dt BETWEEN TO_DATE ('12/31/2010', 'MM/DD/YYYY') AND m.clndr_dt ) WHERE clndr_dt > TO_DATE ('12/31/2010', 'MM/DD/YYYY') ;
You are right: it is possible to set the two columns at the same time.
It's a shame that you are using Oracle 8.1. The command MERGE, which was new in Oracle 9.1, is much clearer and more effective. If you could use MERGE, you can essentially use the code you have posted in the middle of a MERGE statement.
Education of UPDATE above assumes that, for the incorrect days, clndr_days and work_days will be never less than the last exact value. If this is not the case, the solution is a bit more complicated. You can avoid this problem and to make the statement faster too, by simply hard-code the last exact value of clndr_days and work_days in the UPDATE statement, where I used min. (this looks like a situation where the efficientcy is not a big problem, however. "You'll probably never make this exact UPDATED once again, so if it runs in 1 second or 10 minutes maybe not much of importance.)
Sorry, I don't have an Oracle 8 database to test this. It works in Oracle 9.2, and I do not think that it uses all the features that are not available to the point 8.1.
-
Need help for query flat_file type clobdata oracle table data.
Hi Sir,
I need help to query oracle table flat file data having given clob type.
COLUMN FOR CHAR_DATA FLAT_FILEOracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product PL/SQL Release 10.2.0.1.0 - Production "CORE 10.2.0.1.0 Production" TNS for 32-bit Windows: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production Source table CREATE TABLE order_details ( QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, CHAR_DATA CLOB, OPTIMISTIC_LOCK_KEY NUMBER(20,0) )
EXPECTED RESULTS:EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY EU 6067AT AT10 000000402004 NEXIUMGERDMANAGEMENTPROJECT Z435 NULL ZZ29 NIS-GOLD AT EU 6068AT AT11 000000402005 NEXIUMGERDMANAGEMENTPROJECT Z435 NULL ZZ29 NIS-GOLD AT
Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something asselect table_row, level clob_row, regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row, char_data from order_details ) connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null and prior char_data = char_data and prior table_row = table_row and prior sys_guid() is not null
to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.
Concerning
Etbin
Edited by: Etbin on 3.2.2013 09:01
.. .but I m connected to do things according to the instructions, I can't do something.
Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
rp0428 post - something to remember. -
I Iconia Tab A500 running 3.0, need help update, I downloaded the entire updaes list in the supprt of acer, all versions, 3.0, 3.1, 3.2 and 4., I read on the acer support somewhere I can use a microSD card to update my device, as acer provides automatically, when I try it says 'poor network connection '. moving instead of anthoer. ", I have to update all the updates that are listed, or can I only update, using the 4. 0? to get the last known update. I also downloaded, 'Documents, applications, drivers, patches and O.S... How do I intsaller all these updates, I think that running the lowest version available, please help me... Thank you in advance.
There are some instructions step by step on the site, but basically you check out the file "update.zip" download, copy to the root of a FAT32 formatted microSD card, then start in recovery mode (press one of the volume buttons [which it depends if you are landscape or portrait mode] and hold, then the power press and hold). From there, you can choose to update in the zip file it finds on the map.
It is important before you have the correct version of the update, it's different for different regions of the world, and you will not be able to upgrade the (for example) Brazil version from the US site.
-
Need help for PL/SQL Script
If I wanted to give access to all my tables in my schema to a role, how could I do that.
Thus, rather than run a query for each table 100 times, looking for something
who would have a loop.
For each Table in my schema, give select, update and insert, but remove it from user role?
?
Thank you advance, 10 G here.BEGIN FOR v_REC IN (SELECT TABLE_NAME FROM USER_TABLES) LOOP EXECUTE IMMEDIATE 'GRANT SELECT ON ' || v_REC.TABLE_NAME || ' TO your_role_name'; END LOOP; END; /
SY.
-
Need help for the conversion of the Date
Hi all
Your expert input is much appreciated.
Have a problem where it is my master table structure, whenever there is an update/delete/insert on the main table
There's a trigger that insert an entry in the Audit table.
SQL > cpp_Master Desc;
Number of Ent_id
Date of Ent_date
SQL > Desc Cpp_Master_Audit
Number of Ent_id
Date of Ent_date,
Insert_type varchar2 (1)
The problem is that when we insert the Sub record in the table, the ent_date column appears in this way.
SQL > INSERT INTO CED.cpp_Master (ENT_ID, Ent_date)
VALUES (6030902, TO_DATE (1 JANUARY 01 00:00:00 ', ' HH24: PUT DD/MM/YYYY "));SQL > SELECT * FROM CED.cpp_Master;
6030902 01/01/0001
SQL > SELECT * FROM CDS. Cpp_Master_Audit;
6030902 01/01/0001
But when I update the date is coming up as below
SQL > update ced.cpp_Master set Ent_date = to_date (' 1 March 01', ' dd-mon-YYYY "") where ent_id = '6030902';
SQL > commit;Tried under updates so
(
Update ced.cpp_Master set Ent_date = ' March 1 01' where ent_id = '6030902';
Update ced.cpp_Master set Ent_date = to_char (' 1 March 01', ' dd-mon-YYYY "") where ent_id = '6030902';
)
Whenever the output below always. (Insert has no problem, just update a problem)
I wonder why when there is an insertion of the date value is "01/01/01" in (Cpp_Master_Audit), but when I update the date value is "01/01/2001" ".
I need the value to insert as "01/01/01", as all that was updated in Master table (Cpp_Master)
SQL > SELECT * FROM CED.cpp_Master;
6030902 01/01/2001
My request to trigger:
CREATE OR REPLACE TRIGGER CDS. CPP_AUDT
AFTER INSERT OR UPDATE OR DELETE
ON CED.cpp_Master REFERENCING OLD AS OLD AGAIN AS NEW
FOR EACH LINE
DECLARE
l_action_code VARCHAR2 (1);
BEGINIF THE INSERTION
THEN
l_action_code: = 'I ';
ELSIF UPDATE
THEN
l_action_code: = 'U ';
ON THE OTHER
l_action_code: = ';
END IF;IF (l_action_code = 'I'
OR l_action_code = '
OR (l_action_code = 'U'
AND (NVL (: OLD.)) ENT_ID, 0) NVL <>(: NEW.) ENT_ID, 0)
OR NVL (TO_CHAR (: OLD.)) Ent_date, ' mm/dd/yyyy'),
'X') <>
NVL (TO_CHAR (: NEW.)) Ent_date, ' mm/dd/yyyy'),
« X »)
)))
THEN
INSERT IN DEC. () Cpp_Master_Audit
ENT_ID, Ent_date, Insert_type
)
VALUES (DECODE (: OLD.ent_id, NULL,: NEW.ent_id,: OLD.ent_id),)
DECODE (l_action_code, 'I',: NEW.) Ent_date, 'd', NULL, 'U', DECODE (: NEW.) Ent_date,: OLD. Ent_date, NULL,: NEW. Ent_date)),
Insert_type l_action_code);END IF;
END;
/You wrote that ent_date is of type DATE
SQL > cpp_Master Desc;
Number of Ent_id
Date of Ent_date
so DO NOT fill with a chain, but with a date, and you have correct data in it.
This:
Update ced.cpp_Master set Ent_date = 1 March 01 ' where ent_id = '6030902';
is simply wrong that fill you your column DATE with a string and your NUMBER column with a string filter too.
Use
Update ced.cpp_Master
Set Ent_date = TO_DATE('01-MAR-0001','DD-MON-YYYY') where ent_id = 6030902;
and you will have no problems (as long as the NLS_DATE_LANGUAGE parameter is set correctly to support abbreviations English months)
HTH
-
I need help for my printer/scanner/copier to work with my computer
I have a problem for my computer to connect with my printer/scanner/copier. I need help!
Hi GraceEverts,
· What exactly happens when you try to connect printer/scanner/copier to work with my computer?
· You receive an error message?
· What is the brand and model of the printer/scanner/copier?
I suggest to check the following items and check if it helps.
To add a printer attached to your computer
To install new or updated printer drivers to update
Resources for the resolution of the printer in Windows XP problems
http://support.Microsoft.com/kb/308028
Printer in Windows problems
http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows
To install a scanner or digital camera
Hope this information helps.
-
Hey, I have a problem in Windows Vista:
I've been updating / updated my graphics card and it is the graphics card, I'm updating, after a while, a black screen will appear (PITCH BLACK) and I there is no cursor and I tried Ctrl + Alt + Delete, but nothing seems to work, after I turned off my laptop, starts to load then it was the new dark night! (NO LOGIN SCREEN). Then I turned off my laptop then I constantly pressed f8, then I pressed "Computer repair" then it loads then my screen showed "Another user", then I clicked it then I had to type my ID but I have no details of connection, I pressed on enter with no connection details, but this still does not work because I had to type in my login information. I tried everything, then I went to safe mode and fact a password and changed my admin account type, then I rebooted my laptop, then I have constantly pressed f8 and pressed "Computer repair" then it loads and then my screen showed 'Another user' again... .
PLEASE I NEED HELP! I WANT TO PLAY MY GAMES!Hello
Follow the steps below:
Method 1: Do the Startup Repair to fix the problem.
See the following article for more information on the Startup Repair:
Startup Repair: frequently asked questions
http://Windows.Microsoft.com/en-us/Windows-Vista/startup-repair-frequently-asked-questions
Method 2: Use the Bootrec.exe tool in the Windows recovery environment to troubleshoot and repair startup issues in Windows
For instructions, see the following article:
How to use the Bootrec.exe tool in the Windows recovery environment to troubleshoot and repair startup issues in Windows
http://support.Microsoft.com/kb/927392
Let us know if that helps.
Maybe you are looking for
-
Hello Nearly six years ago, I bought a MacBook 7.1. The operating system is Mac OS X 10.6.8 (10 K 549). I noticed in the last few months he began to run quite slowly. Web pages will take much longer time to load, and switch between different progr
-
I can swap between Alpha A100 and A77 lens
I have an Alpha A100 and want to buy a Sony A77, are the compatible lens?
-
Difference between ISO ESXi M420 and M630. Is this the same ISO?
I will install 6.0 ESXi update 2 of 3 new servers M630. I used the ISO next to install my m420s: VMware-VMvisor-Installer-6.0.0.update02-3620759.x86_64-Dell_Customized-A02.iso This ISO works for my m630s so? These aircraft were ordered and received
-
I have an app that will require a connection. Once you start the application, it should show you a login screen. For the moment, I do this with a sheet. How can I have it show the login on the load screen without showing the page slot with the slidin
-
CISCO SX80 - PrecisionHDMC 1080 p 12 X CAMERA
Hello I want to know if the camera precision HD 1080 p 12 x is compatible with the Codec SX80. Thank you Ivan