Insert newspapers in the errors table
HelloI want to insert errors in the custom error message table.
eventhogh is runs properly but I cannot insert rows in the error table.
This is the code.
DECLARE
v_status VARCHAR2 (20);
cursor c1
is
Select * from all_errors
When type = 'PROCEDURE '.
and name = upper ('updatecourse');
v_rec c1% rowtype;
BEGIN
Select the State
in v_status
of object
where object_type = upper ('PROCEDURE')
and object_name = upper ('updatecourse');
If v_status = "INVALID" Then
Open c1;
loop
Fetch c1 in v_rec;
When exit c1% notfound;
insert into values of error_log (owner, name, type, text) (v_rec.owner, v_rec.name, v_rec.type, v_rec.text);
end loop;
Close c1;
end if;
END;
Please let me know what to do.
Thank you
Rami Reddy.
Why a loop?
You can manage in a simple SQL statement... (Not tested, just to give an idea). I hope that you don't have the name of this procedure in the two schemas
insert into error_log(owner,name,type,text)
select owner,name,type,text
from all_errors
where type='PROCEDURE'
and name=upper('updatecourse')
and 'INVALID' =
(
select o.status
from all_objects o
where o.object_type=upper('PROCEDURE')
and o.object_name=upper('updatecourse');
);
Tags: Database
Similar Questions
-
Insert and update the nested table
Hello
I created a nested table containing the following columns. I need to insert records into the nested table. And also I have to update the nested table. Please find below my table and get error message.
Please advose...!
Can I use '&' while inserting records in the nested table? Yes / No?SQL> create type details as object( 2 basic number(7,2), 3 da number(6,2), 4 hra number(6,2), 5 pf number(6,2), 6 it number(6,2), 7 gross number(7,2), 8 ded number(6,2), 9 net number(8,2)); 10 / Type created. SQL> create type details_t is table of details; 2 / Type created. SQL> ed Wrote file afiedt.buf 1 create table emp_tab(empno number(4),name varchar2(10),details_tab details_t) 2* nested table details_tab store as empl_details SQL> / Table created. SQL> ed Wrote file afiedt.buf 1* insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null))) SQL> / Enter value for empno: 1 Enter value for name: asdf Enter value for da: 120 Enter value for hra: 130 Enter value for pf: 120 Enter value for it: 120 old 1: insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null new 1: insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null))) insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null))) * ERROR at line 1: ORA-02315: incorrect number of arguments for default constructor
I do need to update also net gross, ded, columns... !!
Please help me... !!
Concerning
A$ sqlplus scott/tiger SQL*Plus: Release 10.2.0.2.0 - Production on Thu Apr 21 16:18:16 2011 Copyright (c) 1982, 2005, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production With the Partitioning, OLAP and Data Mining options SQL> CREATE TYPE details AS OBJECT( basic NUMBER(7,2), da NUMBER(6,2), hra NUMBER(6,2), pf NUMBER(6,2), it NUMBER(6,2), gross NUMBER(7,2), ded NUMBER(6,2), net NUMBER(8,2)); 2 3 4 5 6 7 8 9 10 / Type created. SQL> CREATE TYPE details_t IS TABLE OF details; 2 / Type created. SQL> CREATE TABLE emp_tab(empno NUMBER(4),name VARCHAR2(10),details_tab details_t) NESTED TABLE details_tab store as empl_details 2 3 / Table created. SQL> INSERT INTO emp_tab VALUES(7001,'Saubhik',details_t(details(100,100,50,10,10,null,null,null))); 1 row created. SQL> SELECT * FROM TABLE (SELECT details_tab FROM emp_tab WHERE empno=7001); BASIC DA HRA PF IT GROSS DED ---------- ---------- ---------- ---------- ---------- ---------- ---------- NET ---------- 100 100 50 10 10 SQL> ^C SQL> ed Wrote file afiedt.buf 1 UPDATE TABLE (SELECT details_tab FROM emp_tab WHERE empno=7001) 2 emp_sal 3* SET emp_sal.net=emp_sal.basic+emp_sal.da+emp_sal.hra SQL> / 1 row updated. SQL> SELECT * FRM emp_tab; SELECT * FRM emp_tab * ERROR at line 1: ORA-00923: FROM keyword not found where expected SQL> SELECT * FROM emp_tab; EMPNO NAME ---------- ---------- DETAILS_TAB(BASIC, DA, HRA, PF, IT, GROSS, DED, NET) -------------------------------------------------------------------------------- 7001 Saubhik DETAILS_T(DETAILS(100, 100, 50, 10, 10, NULL, NULL, 250)) SQL>
-
set of full data after that the incorrect line should pass to the errors table
Hi all
In fact, I have a table which has key equipment, date and so far the data comes as e1, 10:30 11:30.I want if the readings are not continue then this data point all records that the equipment should go to the error table. Is it possible to have a logic as it means assume that I have a data like e1, 11:30, 12:30; E1, 12:30, 01:00; E1, 01:30, 03:30, e1, 03:30, 05:30 since reads are not continuous from 01:00 the logic must be such that the two lines: e1, 01:30, 03:30, e1, 03:30, 05:30 is expected to rise to the error table.
Thanks in advance for the help.Sorry ;)
Snapshost is [url http://tsib.freehostia.com/analytfun_f1.html] here -
Error running columns must be updated in the error table
Hi all
I deliver, in my process when execution time if I got an error, that it would be updaed in my error log table, is there any special function is there for that?Hello
For any error that occurs in your trapping interface use the package step.
Go to step 1 to step 2 by KO trail
in step 2, you can use a variable with a refresh of query ' select SUBSTR)< %="odiRef.getPrevStepLog" ("message")="" %="" >,="" 1,="" 4000)="" du="" double="" '="" faire="" passer="" votre="" message="" d’erreur...="" de="" cette="" façon,="" vous="" pouvez="" gérer="" vos="">
Also, as mentioned in a previous post, you can easily change your variable as refresh query*'select SUBSTR (< %="odiRef.getPrevStepLog" ("message")="" %="" >,="" 1,="" 3000)="" || »=""><->' |)< %="odiRef.getPrevStepLog" (« step_name »)="" %="" >="" du="" double="" '="" *="" d’inscrire="" le="" nom="" de="" l’étape="" afin="" que="" vous="" sachiez="" où="" cette="" erreur="" s’est="">
Now, you can use this variable to insert this value into a table of error log using a procedure of ODI step (do the next step).Solve your problem?
Published by: 922636 on 13 Sep 2012 06:58
-> -
Domain! = Insert then in the other Table
Hello
I can't figure out how to create a trigger that inserts data based on cases an old.field! = new.field. If the field has been changed to
a tbl_test table then insert this file into the other tbl_test_history of the table. It's a little different since I want to insert a record if an update
has taken place. The update will still take place at tbl_test, but I want an insert will be held at tbl_test_history.
I have a separate trigger that will insert records from tbl_test to tbl_test_history. This trigger compiles without error but when ICREATE OR REPLACE TRIGGER AU_INSERT_TEST_HISTORY AFTER UPDATE ON TBL_TEST FOR EACH ROW WHEN ( OLD.Orange != NEW.Orange OR OLD.Apple != NEW.Apple ) BEGIN INSERT INTO TBL_TEST_HISTORY (ORANGE, APPLE BANANA, GRAPE ) select ORANGE, APPLE BANANA, GRAPE FROM TBL_TEST, TBL_TEST_HISTORY WHERE TBL_TEST.PK_TEST_ID = TBL_TEST_HISTORY.PK_TEST_ID; END AU_INSERT_TEST_HISTORY; /
create a record in tbl_test I have an error message. I don't know if the syntax is correct, can someone help me with this?My bad. I put the colon: in the when clause. They were not there in your code. I usually use an if condition, which is a little different.
I added a NEW logic to also consider the comparison of NULL values.
CREATE OR REPLACE TRIGGER AU_INSERT_TEST_HISTORY AFTER UPDATE ON TBL_TEST FOR EACH ROW BEGIN if nvl(:old.ORANGE,'xxx') != nvl(:new.ORANGE,'yyy') OR nvl(:old.APPLE,'xxx') != nvl(:new.APPLE,'yyy') then INSERT INTO TBL_TEST_HISTORY (ORANGE, APPLE, BANANA, GRAPE) values (:new.ORANGE, :new.APPLE, :new.BANANA, :new.GRAPE); end if; END AU_INSERT_TEST_HISTORY; /
In addition, you can consider making trigger a trigger AFTER INSERT or UPDATE.
Then you would also put the values inserted early in your history table.
Published by: Sven w. August 9, 2012 16:14
-
I've implemented the event to OBIEE 10.1.3.4.1 table and I am facing this error:
2011-09-02 12:04:58
[55004] operation failed to prepare election table UET.
2011-09-02 12:04:58
[nQSError: 22005] Metadata repository: column has no data type.
2011-09-02 12:04:58
[55005] cache vote delete statement failed for table UET.
My connection pool use OIC 10 g/11 and table was imported using BEAK too. After reading in a blog about the differences between the code imported by ODBC, I made the necessary changes (.) Now, my code is that:
DECLARE the "Cache Control" TABLE... "" POET ". "" "UET" AS "UET" UPGRADE DOESN'T ID NOT CACHEABLE 449075 HIDE EVENT TABLE SURVEY FREQUENCY 300 NO INTERSECTION ROW COUNT LAST UPDATE 8.000000 ' 2011-09-01 12:53:24.
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "" UPDATETYPE ' AS 'UPDATETYPE' ID TO UPGRADE 450774 PRECISION SCALE 15 0 'DOUBLE' TYPE NON NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "" UPDATETIME "AS"UPDATETIME"450775"DATETIME"UPGRADE ID BALANCE 0 0 TYPE NOT NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "" DBNAME "LIKE"DBNAME"ID UPGRADE 450776 TYPE 'CHAR' A BALANCE 40 0 NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "' CATALOGNAME ' AS 'CATALOGNAME' 450777 TYPE"VARCHAR"UPGRADE ID BALANCE 40 0 NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "" SCHEMANAME "AS"SCHEMANAME"450778 TYPE"VARCHAR"UPGRADE ID BALANCE 40 0 NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "' TABLENAME ' LIKE 'TABLENAME' 450779 TYPE"VARCHAR"UPGRADE ID BALANCE PRECISION 40 0 NOT NULLABLE
PRIVILEGES (READ);
DECLARE the COLUMN "Cache Control"... "" POET ". «UET ".» "' OTHER ' AS 'OTHER' UPGRADE 'VARCHAR' TYPE 450780 ID BALANCE 80 0 NULLABLE
PRIVILEGES (READ);
I have already connected the database having the same user connection pool and I could insert and delete records.
My database structure is that:
Name DEFAULT Nullable Type
UPDATETYPE NUMBER N 1
UPDATETIME DATE N SYSDATE
DBNAME 40 Y
CATALOGNAME VARCHAR2 (40) Y
SCHEMANAME VARCHAR2 (40) Y
TABLENAME VARCHAR2 (40) N
ANOTHER VARCHAR2 (80) Y
No idea what could be the problem?
Thank youHello
It could be a problem with the schema of the table, run ddl OracleBI\server\Schema\SAEPT.**.sql. Then import the table in the physical layer of the RPD
Workaround this problem by using the default value provided for creation script table mark of the event, located in the folder:
\server\Schema\SAEPT. Oracle.SQL There are several scripts SAEPT (Siebel Analytics Table Event of the election), named differently according to your particular database.
Name change column names (defined by the user) of the voting table event to match those of the OracleBI\server\Schema\SAEPT. Oracle.SQL file will solve the problem.Rgds,
DpKa -
Insert select on the same table: possible without side effects?
I have a very large table T1 containing millions of records. I need to treat its lines and create a few new lines based on selection.
Table T1 contains events and one of them, with the code 100, is created by the further development of other events inside the table.
My code is as follows:
insert /*+append */ into T1 (code,...) values (100, c1,c2,...) select c1,c2... from T1 where (code=20 or code=10) and <other conditions>...
as you can see I'm extract T1 lines to insert again in T1 with a different code and I use the direct path in order to get good performance.
My fear is: choose is made from the same table I risk data loss? In general it is a good practice? Or is it better to create another table?
Hello
No I don't think that there may be loss of data. But that may depend on the behavior of the application and your where clause.
I will explain how it is treated, so you can see if it's ok:
1. the table is locked because of the insert add, (as)
2 lines are read by select and make compatible from the State that was at the beginning of the query - 1.
3 rows are inserted at the end, after the high-water line
4 columns for new lines are sorted to be merged in the index
5. high watermark is adjusted - visible new lines and lock is released
Note that 2. and 3. occur at the same time: rows are inserted all read.
Note that anyone can choose in the table during the operation - they see the changes committed only - if the State 1.
all other DML are waiting for the lock being released, and will see new ranks and then
If you have things that prevent the direct-path insert, append the hint will be ignored. So, if you must rely on close to 1. then the best lock explicitly with table lock. But I don't think that you need.
Kind regards
Franck.
-
Insert data into the same table based on certain conditions
Hello. I'm new to this forum.
I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:
Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:
1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then
CurrentInstallment = CurrentInstallment + 1
2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...
So, I have to insert data by incrementing the month and year. for example:
If currentdata is 11/2012 next data will be 12/2012
But following will be 01, 2013
I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.
How to achieve that?
Thank you.978184 wrote:
Hello. I'm new to this forum.
I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:1. if PaidAmount > 0 & CurrentInstallment
CurrentInstallment = CurrentInstallment + 1
2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...
So, I have to insert data by incrementing the month and year. for example:
If currentdata is 11/2012 next data will be 12/2012
But following will be 01, 2013
I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).You can do this way:
This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.
insert into your_table (col1, col2, col3...current_installment, month_field) select col1, col2, col3.., current_installment + case when paidamount > 0 and current_installment < total_installment then row_number() over ( partition by column1, column2,.. columnn -->You may choose partition if you want the --Increment of Current_installment to reset after particular combination ends order by primary_key -->Order the Increment, you may choose to add more columns to order by ) else 0 --> if condition is not met, then Add 0 end curr_installment, add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month from your_table;
-
Insert records in the W_EXCH_RATE_G table.
Hi all
Can someone help me with the following scenario.
I would like to know how to insert additional record of exchange rates in the W_EXCH_RATE_G table in the data warehouse.
I checked records in this table ate PS_RT_RATE_TBL of peoplesoft.
But I have just a flat file and I have to complete additional registration.
Can you let me know if I have to use and update the query to do the same thing or do I change the mapping in Informatica?
Thanks for the help in advance!
-NikkiNikki, see also my response to your similar message: -.
Change SIL_GLBalanceFact to populate the Balance_Global1_Amt column.
Please indicate if helpful/useful.
Andy. -
Code of the trigger with the error table mutation
I have 2 tables, cc_call_lists and cc_call_issues. I have a trigger on the table of cc_call_issues so that when the priority is updated I can determine how to set Issue_Priority.
Basically, the priority update for an Issue_Id I need to update the I want to watch Issue_ids of all the participating on the cc_call_lists table and determine how to update the Issue_Priority column.
Issue_Priority must always be the first priority of the table cc_call_issues for Issue_id records in the cc_call_lists table. So when I need to watch all changes priority priority values for which the Participant has records in the cc_call_lists table and take the max value priority after the record is updated.
Unfortunately, I get the following error message when the trigger is activated:
ORA-04091: table TTMS. CC_CALL_ISSUES is changing, function of triggering/can not see
ORA-06512: at «TTMS.» UPDATEISSUEPRIORITY', line 30
ORA-04088: error during execution of trigger ' TTMS. UPDATEISSUEPRIORITY'
Is there a work around which is not too complicated? Any help would be greatly appreciated.
Table: cc_call_lists
Name
-----------------
PARTICIPANT_TYPE
PARTICIPANT_ID
LAST_ACCESS_DT
LAST_ACCESS_BY
CREATE_DT
CREATE_BY
MODIFY_DT
MODIFY_BY
CALL_STATUS
CALL_PRIORITY
Table: cc_call_issues
Name
-----------------
ISSUE_ID
ISSUE_DESCR
DEACTIVATION_DT
PRIORITY
CREATE_DT
CREATE_BY
MODIFY_DT
MODIFY_BY
Trigger on cc_call_issues code:CREATE OR REPLACE TRIGGER TTMS.UpdateIssuePriority BEFORE UPDATE OF PRIORITY ON TTMS.CC_CALL_ISSUES REFERENCING NEW AS New OLD AS Old FOR EACH ROW DECLARE tmpMaxPriority number:=0; -- Get list of all participants call queue records, existing priority who also have a participant issue record with this issue code cursor c1 is select a.participant_id, a.call_priority from cc_call_lists a, cc_participant_issues b where a.participant_id = b.participant_id and b.issue_id = :new.issue_id and b.issue_status = '001' and a.call_status <> '003'; -- Not closed already BEGIN for thisone in c1 loop -- Get the existing highest priority select nvl(max(b.priority),0) into tmpMaxPriority from cc_participant_issues a, cc_call_issues b where a.issue_id = b.issue_id and a.participant_id = thisone.participant_id; -- Update it if the new priority value is higher than the existing call queue record priority if :new.priority > tmpMaxPriority then update cc_call_lists set call_priority = :new.priority where participant_id = thisone.participant_id; elsif :new.priority < tmpMaxPriority then update cc_call_lists set call_priority = tmpMaxPriority where participant_id = thisone.participant_id; end if; end loop; END UpdateIssuePriority; /
Move the level of LINE at the STATEMENT level triggers, see:
http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936 -
cannot insert data into the PRODUCT_USER_PROFILE table
I've connected to the database as the sysdba, which is installed on VMWARE. database is oracle 11g.
whenever I insert data in the table PRODUCT_USER_PROFILE that the database returns 1 row inserted and then when I try to show everything on the table before or after the statement commit is made the database returns "No. LINES SELECTED.
guys any idea about this problem...Hello
Try to connect as a system and make the insert and check. Always think about the issue.
-Pavan Kumar N
Oracle 9i / 10g - OCP
http://oracleinternals.blogspot.com/Published by: pounet on January 4, 2010 16:29
-
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";) -
How can I do a new insert data in the other table extrancting?
Hello, I'm looking how to do an insertion of two tables save values and apply to other tables like this:
The insert I'm looking for is something like this:
Have two tables, the first table is emp1 and contains the column: data 1 and 2 with line of data1: 1234 and line data 2:5555, therefore,.
I want to create an insert on a new table called (emp2) that contain the data in the column: data 1, data 2 (from the first table demo1), data 3, data 4, etc.
How insert again I can put / call data from another table insert in this table (emp2).
I don't know if my example is correct (my English is very bad).
This is an example: (sorry for the points).
table EMP2:
1 data... 2 data... 3 data... data 4... data 5
(from emp1)... (from emp1)... 8534... 2347... 4544
Thanks for the help.
Published by: user10182692 on 24-May-2009 08:39
Published by: user10182692 on 24-May-2009 08:40
Published by: user10182692 on 24-May-2009 08:45Welcome! on the forum.
You can include the code and data in the {code} tags
If I'm good, and I know what is your condition
insert into emp2 ( data1, data2) select data1, data2 from emp1
SS
-
Support for mandatory request - insert, select from the same table
Hi all
I need your help to write queries effectively.
Oracle Version: 10.2.0.3.0
OPERATING SYSTEM: UNIX
I have a METRICS_TBL that is mentioned below table.
CYCLE_DATE METRIC VALUE
08/17/2008 COST-TV 100
08/17/2008 COST-JOURNAL 50
08/17/2008 COST-POSTALMAIL 25
08/17/2008-PROD-TV 10
08/17/2008-PROD-JOURNAL 25
08/17/2008-PROD-POSTALMAIL 5
Any data above, I have to add (Insert into select METRICS_TBL METRICS_TBL) at the same table with the records as mentioned below.
2008-08-17 COSTPERPROD-TV 10
08/17/2008-COSTPERPROD-LOG 2
2008-08-17 COST PROD-POSTALMAIL 5
Basically, I need to calculate the cost per product for each category. Depending on the settings available, metric should also be changed as COSTPERPROD and values should be cost/prod under each category.
Can someone help me with the query.
Thank youSomething like this:
INSERT INTO metrics_tbl (cycle_date, metrics, value) SELECT cost.cycle_date , 'COSTPERPROD-'||cost.mtype ,cost.value / prod.value FROM ( select cycle_date,substr(metrics, 1, 4) mtype, substrmetrics,instr(metrics,'-')+1) mmetric where substr(metrics, 1, 4) = 'PROD' ) prod INNER JOIN ( select cycle_date,substr(metrics, 1, 4) mtype, substrmetrics,instr(metrics,'-')+1) mmetric where substr(metrics, 1, 4) = 'COST' ) cost on cost.cycle_date = prod.cycle_date and cost.mmetric = prod.mmetric
Ideally you would divide your METRICS column into two: one for the thing you're measuring (e.g. TV or NEWSPAPER) and the other for the metric (COST, PROD, COSTPERPROD etc.). That's what I did in the views online. Without it, it's kinda a mess and behave so, if the table becomes much more.
HTH
Nigel cordially
Edited by: nthomas on January 14, 2009 15:57 - small correction SQL
-
Error inserting line in the w_etl_run_s table
Hello
I'm below every time error performance DAC. I don't know why it's existing row_wid integration or integration id in the table w_etl_run_s. no idea please advise...
Severity: ERROR
Timestamp: 2011-07-26 10:12:36
Node: node01_hdcbitest
Thread: WRITER_1_ * _1
Process ID: 11304
A message Code: WRT_8229
Message: Database error occurred:
ORA-00001: unique constraint (BIDATA. W_ETL_RUN_S_P1) violated
Database driver error...
Function name: run
Stmt SQL: INSERT INTO W_ETL_RUN_S (DATAMART_ID, DATASOURCE_NUM_ID, DATASRC_ID, INTEGRATION_ID, NAME, NUMERIC_ROW_ID, ROW_WID, ACTUAL_START_TS, LOAD_DT, LOAD_DT_WID, STATUS_CD) VALUES (?,?,?,?,?,?,?,?,?,?,?)
Database driver error...
Name of the function: Execute Multiple
Stmt SQL: INSERT INTO W_ETL_RUN_S (DATAMART_ID, DATASOURCE_NUM_ID, DATASRC_ID, INTEGRATION_ID, NAME, NUMERIC_ROW_ID, ROW_WID, ACTUAL_START_TS, LOAD_DT, LOAD_DT_WID, STATUS_CD) VALUES (?,?,?,?,?,?,?,?,?,?,?)
Gravity: INFO
Timestamp: 2011-07-26 10:12:36
Node: node01_test
Thread: WRITER_1_ * _1
Process ID: 11304
A message Code: CMN_1053
Message: Rowdata: (RowType = 0 (insert) CBC Rowid = Rowid Targ = 1 1
DATAMART_ID (DATAMART_ID:UniChar.15 :): '1')
DATASOURCE_NUM_ID (DATASOURCE_NUM_ID:Double :): "1.000000000000000")
DATASRC_ID (DATASRC_ID:UniChar.15 :): '1')
INTEGRATION_ID (INTEGRATION_ID:UniChar.30 :): "477")
NAME (NAME:UniChar.100 :): "ETL: 26/07/2011-10:12:35 ')
NUMERIC_ROW_ID (NUMERIC_ROW_ID:Double :): "476.0000000000000")
ROW_WID (ROW_WID:Double :): "476.0000000000000")
ACTUAL_START_TS (ACTUAL_START_TS:Date :): '2011-07-26 10:12:35 ')
LOAD_DT (LOAD_DT:Date :): '2011-07-26 10:12:35 ')
LOAD_DT_WID (LOAD_DT_WID:Double :): "20110726.00000000")
STATUS_CD (STATUS_CD:UniChar.50 :): 'How TO')
)Following a note (545761.1) Metalink notes can help:
1 - DO NOT restart an ETL from the beginning when it fails in the middle. Difficulty regardless of the problem, then continue the series where it was stopped.
2 - If do you restart an ETL from the beginning instead of continuing where he left off, you must first delete the record in the table w_etl_run with the status "Running" OR update this record if its status is "completed."If this was helpful, please mark as answered.
Maybe you are looking for
-
How to change the font on the displayed web pages
We now have a large number of web pages which displays very small, greyish fonts on web pages. Content on a page Web must be at least as important as advertising. There's a firefox Add on that, with a single click, change the Web page background colo
-
Graphics card need help for the severe game for WoW - Lag
Hi, here is my card: HP Pavilion, 8 GB of Ram, Intel Core 2 Quad CPU Q8400 2.66 GHz (4 processors) Windows 7 Home Premium 64-bit DirectX 11 Card: Intel G45/G43 Express Chipset 1695 MB 1920 x 1080 (32 bit) (60 Hz) Please let me know which card should
-
A Slimline PC can be used on its side or must it be vertical? Thank you Farva
-
How is the best way to connect the configuration of my router and switch?
I have a cable modem. connect to a switch, I have 2 computers connected to the switch. I also just connected my router wireless switch. That's the best configuration or I lose my firewall of the router in passing is not by ports directly above?
-
no reference to 'snd_pcm_open_preferred '.
I understand this error means that this function cannot be found in the headers or libraries. I use this code to wave.c: #include .... int card = -1; int dev = 0; snd_pcm_t *pcm_handle; int rtn; rtn = snd_pcm_open_preferred (&pcm_handle,&card, &dev,