![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have table and i dont know how to write trigger to this table Table: CREATE TABLE TAB1 ( * ID * * *NUMBER(9), * ID2 * * VARCHAR2(20) ) Valuses: INSERT INTO TAB1 VALUES (1,'') INSERT INTO TAB1 VALUES (2,'') INSERT INTO TAB1 VALUES (3,'') INSERT INTO TAB1 VALUES (4,'') Single update: UPDATE TAB1 *SET ID2 = ('TEXT' || (SELECT ID FROM TAB1 WHERE ID=1)) *WHERE ID=1 I have a question: How to update whole table based on "Single update" ? I need help with writeing trigger based on "Single update" to automate this process. I will be very grateful for your help --------------= *Posted using GrabIt *=---------------- ------= *Binary Usenet downloading made easy =--------- -= *Get GrabIt for free fromhttp://www.shemes.com/*=- |
#3
| |||
| |||
|
|
I have table and i dont know how to write trigger to this table Table: CREATE TABLE TAB1 ( ID NUMBER(9), ID2 VARCHAR2(20) ) Valuses: INSERT INTO TAB1 VALUES (1,'') INSERT INTO TAB1 VALUES (2,'') INSERT INTO TAB1 VALUES (3,'') INSERT INTO TAB1 VALUES (4,'') Single update: UPDATE TAB1 SET ID2 = ('TEXT' || (SELECT ID FROM TAB1 WHERE ID=1)) WHERE ID=1 I have a question: How to update whole table based on "Single update" ? I need help with writeing trigger based on "Single update" to automate this process. |
#4
| |||
| |||
|
|
Your sample code looks fairly similar to the more obvious and less convoluted single query: UPDATE TAB1 SET ID2 = 'TEXT' || ID WHERE ID=1 ... even this: UPDATE TAB1 SET ID2 = 'TEXT1' WHERE ID=1 Other than that, I'm not sure I understand your requirements. Do you want to write a trigger so every time you update one row all other rows will receive the same update? Why do you think you need that? What do you have so far? |
#5
| |||
| |||
|
|
It sounds like a singularly bad idea, but I'll just ask, what exactly are you trying to accomplish? The docs have the syntax. jg -- @home.com is bogus. http://www.theregister.co.uk/2011/11..._0_part_three/ |
#6
| |||
| |||
|
|
Thank You I find the solution in Oracle documentation Regards ---------- KonradWo |
![]() |
| Thread Tools | |
| Display Modes | |
| |