INSERT TRIGGER WITH DATE
hi,
This may be a very basic doubt.please help me.
i m creating the dynamic table every month to maintain the particular month data seperately .when the records are getting inserted in the table,trigger will automatically insert the records in the dynamic table. In the ACTN_DATE column, only date alone(without timestamp) getting inserted in the dynamic table from main table. so by default ,00:00:00 is getting appended with date instead of actual timestamp present in the main table. tried select to_date(to_char(:new.ACTN_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS') INTO v_temp_actn_date from dual; then in the insert query ,i tried to insert the temp. variable v_temp_actn_date. but only date alone getting inserted in the dynamic table . In main table and dyanmic table datatype for date column is date .
actn_date value in main table 30-jun-2012 12:50:32 but actn_date value in the dynamic table is 30-jun-2012 00:00:00 . don't know why timestamp value is not present in the date field. please help me solve this issue .Thanks.
Welcome to the forum!
Whenever you post please provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
I don't understand how you data is getting inserted into each of the tables.
>
when the records are getting inserted in the table,trigger will automatically insert the records in the dynamic table.
>
What exactly is the trigger doing? What kind of trigger is it? What table is it on? Is the trigger inserting data into another table? Post the trigger code.
Please show the sample data from each table and the query that is being used to SELECT data from the one table and INSERT it into the main table.
Similar Messages
-
Insert statement with Date, time into Oracle
Hi,
I've got the following statement that I'm trying to insert into Oracle. Actually had to change up the format to dd-mm-yy to get it to insert the date correctly, not sure why, but I've got it "supposedly" formatted to also insert the hours, min., seconds into the db record, but it's not catching it.
My code:
INSERT INTO VOTETBL
(CHANGE_CTRL_ID,BUSVP,BRANCH,VOTE,VOTE_TIMESTAMP)
VALUES (?, ?,?,?,to_date(sysdate, 'dd-mm-yy hh24:mi:ss'));Shouldn't the sysdate capture all those elements sufficiently? The day, month, year get inserted correctly with this, but not so for the time portion.
Any suggestions is welcomed.
Thx.ok, thanks.
I tried making a result set with the following:
Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rst = stmt.executeQuery("select to_char(sysdate) from dual");
Date dualtimestamp = (rst.getDate("sysdate"));But it makes the servlet blow up! Not sure why either, because if I enter that exact statement in Oracle, it pulls back the date and time just like I aim to. But not embedded in the result set statement within the servlet.
It breaks up somehow and doesn't get that result! -
Insert trigger with if condition
Hi.
I am new sql programming and I am trying to write a insert trigger.
I have created an insert-trigger that inserts into another table(p_person) whenever the trigger table (p_personmds) gets insterted:
CREATE OR REPLACE TRIGGER INSERT_P_PERSON_TG
AFTER INSERT ON P_PERSONMDS
FOR EACH ROW
BEGIN
insert into P_PERSON (person,person_id,person_name,email_address,disabled)
values (seq_p_person.nextval,:new.person_id,:new.person_name,:new.email_address,:new.disabled);
END INSERT_P_PERSON_TG;
After testing the trigger I discovered that I need to add some checking to the trigger:
If person_id already exists in the p_person table I need to just update the 'DISABLED' column and set it to 'null' value.
So I tried modifying the trigger:
CREATE OR REPLACE TRIGGER TESTMDS.INSERT_P_PERSON_TG
AFTER INSERT ON TESTMDS.P_PERSONMDS
FOR EACH ROW
BEGIN
IF :new.disabled is not null
THEN
update p_person set disabled=NULL where person_id=:old.person_id;
ELSE
insert into P_PERSON (person,person_id,person_name,email_address,disabled)
values (seq_p_person.nextval,:new.person_id,:new.person_name,:new.email_address,:new.disabled);
END IF;
END INSERT_P_PERSON_TG;
Hovewer the triggers seems to ignore the first if update condition and only inserts another row with mulitiple values.
Anyone know what I am doeing wrong here?user12064835 wrote:
so if I use: 'IF :OLD.Disabled is not NULL then' ,
will :OLD:Disabled represent the p_person table or do I have to come up with something new?if you use :old.Disable, it will run always the ELSE-block.
you should write your block as same thing like follows:
IF :new.disabled is not null THEN
update p_person set disabled=NULL where person_id=:old.person_id;
IF SQL%ROWCOUNT = 0 THEN --this block will be executed if there was no row updated in table p_person
insert into P_PERSON (person,person_id,person_name,email_address,disabled)
values (seq_p_person.nextval,:new.person_id,:new.person_name,:new.email_address,:new.disabled);
END IF;
ELSE
insert into P_PERSON (person,person_id,person_name,email_address,disabled)
values (seq_p_person.nextval,:new.person_id,:new.person_name,:new.email_address,:new.disabled);
END IF;but
user12064835 wrote:
if DISABLED column is not null in p_person table I want to insert a null value in the DISABLED column in p_person
where the person_id that gets inserted in p_personmds table = person_id in p_person table.means
update p_person set disabled=NULL where person_id=:old.person_id AND disabled is not NULL; -
After Insert Trigger with DML on the subject table?
I am trying to set up e-mail notifications, so I created a procedure, which accepts the argument of an id. In the procedure, it queries the table and sends out mail based on the result set. (in the trigger, I pass in the value of :NEW.id). The procedure then queries the table for that row id.
First, for the after update I was getting the error:
ORA-04091: table is mutating, trigger/function may not see it ORA-06512
So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem there. SO I did the same in the after insert trigger, but then I get the error:
ORA-00060: deadlock detected while waiting for resource ORA-06512
I asked our DBA and he said you are not able to query the table of which the trigger is a subject of. I thought it would be possible since its After insert or update?
Can anyone offer any suggestions ? :)
Thanks,
TrentAny reason why it would work in an after update trigger then?
So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem therePRAGMA AUTONOMOUS_TRANSACTION "bends" the restriction against SQL against base table.
It is the equivalent to tap dancing across a mine field.
You might get the desired results most of the time or you might get a tasty surprise when you least expect it.
What happens to your application in the future, if/when the UPDATE has a ROLLBACK issued & PRAGMA AUTONOMOUS_TRANSACTION has successfully completed?
Inquiring minds would like to know the answer. -
After insert trigger with :NEW.ROWID
Hi All,
I am using a After insert trigger to generate history record as following:
CREATE TABLE TB_TEST (classID number(3), classNm varchar2(12));
CREATE TABLE TB_HIST_TEST (hist_dttm timestamp(6), classID number(3), classNm varchar2(12));
CREATE or REPLACE TRIGGER air_test AFTER INSERT ON tb_test FOR EACH ROW
BEGIN PK_SRVC.CRT_NewRec('TB_TEST', 'TB_HIST_TEST', :new.ROWID); END:
In PK_SRVC package, I use the following statment to create new record in TB_HIST_TABLE:
Insert into tb_hist_test (hist_dttm, classID, classNm)
values (select systimestamp, classID, classNm from tb_test where rowid = ROWID )
The trigger DOES fire when a new row is inserted into TB_TEST. However there is no record inserted into TB_HIST_TEST. Any suggestion?
Thanks,The PK_SRVC.CRT_NewRec is a generic service package that can be shared by many tables. It uses dynamic SQL to get all the collumns for different tables based on USER_TAB_COLUMNS. The following is the code of this package:
PROCEDURE CRT_NewRec ( p_TableName IN VARCHAR2, p_AudTableName IN VARCHAR2, p_RowID)
IS
TYPE TabCol_RecTyp IS RECORD (COLUMN_NAME VARCHAR2(30), COLUMN_ID NUMBER);
TYPE TabCol_CurTyp IS REF CURSOR;
c_TabCol TabCol_CurTyp;
rc_TabCol TabCol_RecTyp;
v_Sql_TabCol VARCHAR2(1000);
v_ColNames VARCHAR2(1000);
v_Sql VARCHAR2(1000);
PRAGMA AUTONOMOUSE_TRANSCATION;
BEGIN
v_SQL_TabCol := ' SELECT column_name, column_id FROM USER_TAB_COLUMNS'
|| ' WHERE table_name = ' || CHR(39) || p_TableName || CHR(39)
|| ' ORDER BY column_id';
v_ColNames := NULL;
OPEN c_TabCol FOR v_Sql_TabCol;
Loop
FETCH c_TabCol INTO rc_TabCol; Exit WHEN c_TabCol%NOTFOUND:
v_ColNames := v_ColNames || ',' || rc_TabCol.COLUMN_NAME;
End Loop;
CLOSE c_TabCol;
v_Sql := 'INSERT INTO ' || p_AudTableName || '(HIST_DTTM, ' || v_ColNames || ' )'
|| ' SELECT systimestamp, ' || v_ColNames || ' FROM ' || p_TableName
|| ' WHEN ROWID = chartorowid(' || CHR(39) || p_RowId || CHR(39) || ')';
EXECUTE IMMEDIATE v_Sql;
COMMIT;
END;
(charmingholidays-yyz) -
Trigger problem -- can't insert the same data into audit table
Sir/Madam,
I'm trying to use insert trigger with a 'long raw' datatype data for my audit purpose. Each time, the data of original table can be inserted correctly. While the trigger for audit table in which it contains almost the same data as original would failed. The error messages are some thing like following:
java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at "CORPSEC.TI_ARCHIVE_PDF", line 9
ORA-04088: error during execution of trigger 'CORPSEC.TI_ARCHIVE_PDF'
If the column with 'long raw' datatype is taken out, then there is no error at all. I'm using Oracle 8i 8.1.6 for Windows NT and suspect there is bug in PL/SQL execution.
The following are SQL text for the trigger:
CREATE OR REPLACE TRIGGER "CORPSEC"."TI_ARCHIVE_PDF" AFTER INSERT ON "ARCHIVE_PDF" FOR EACH ROW DECLARE
LOG_SEQ_NO NUMBER;
BEGIN
SELECT AUDIT_SEQ.NEXTVAL INTO LOG_SEQ_NO FROM DUAL
insert into ad_archive_pdf (DOC_TITLE,PDF_FILENAME,CONTENT,DOC_DESC,AUDIT_REF_NO,AUDIT_DATE,AUDIT_MODE,AUDIT_BY)
values (:new.DOC_TITLE,:new.PDF_FILENAME,:new.CONTENT,:new.DOC_DESC,LOG_SEQ_NO,sysdate,'I',:new.created_by);
END;
Any help on this. Thank in advance.
Best regards,
RuijieSee here for a discussion of how to incorporate LONG datatypes into triggers:
http://asktom.oracle.com/pls/ask/f?p=4950:8:635439::NO::F4950_P8_DISPLAYID -
After Insert Trigger - IF-THEN-ELSE
Is it possible to put an if-then-else statement in an after insert trigger with an update to a second table?
CREATE OR REPLACE trigger bev_trg
after insert
on bev
for each row
DECLARE
MEINS VARCHAR2(3);
SPART VARCHAR2(2);
FKIMG NUMBER(22);
SHKZG CHAR(1);
BEGIN
insert into bev2
(vbeln,
posnr)
values
(:new.vbeln,
:new.posnr
IF FKIMG = '10' and MEINS = 'EA'
THEN
update bev2 set bwsie = (fkimg * '12.17') ;
ELSIF
FKIMG = '12' and MEINS = 'EA'
THEN
update bev2 set bwsie = (fkimg * '19.02');
ELSIF
SHKZG = 'X'
THEN
update bev2 set bwsie = (fkimg * '-1');
ELSE
update bev2 set bwsie = '0' ;
END IF;
update bev2 set bwfkimg = (fkimg * '-1') where SHKZG = 'X';
end;
This does not do the updates.
Thanks
BevMy original problem is this: I need to create a table
derived from data in another table
and change it to be the conditional data in the update statements.
create table bev(
VBELN VARCHAR2(10),
POSNR VARCHAR2(6),
MEINS VARCHAR2(3),
SPART VARCHAR2(2),
FKIMG NUMBER(22),
SHKZG CHAR(1),
BWSIE NUMBER(9,2),
BWFKIMG NUMBER(22)
update bev set bwsie = (fkimg * '12.17') where SPART = '10' and meins = 'EA' ;
update bev set bwsie = (fkimg * '19.02') where SPART = '12' and meins = 'EA';
update bev set bwsie = (fkimg * '27.39') where SPART = '15' and meins = 'EA';
update bev set bwsie = (fkimg * '48.69') where SPART = '20' and meins = 'EA';
update bev set bwsie = (fkimg * '109.56') where SPART = '30' and meins = 'EA';
update bev set bwsie = '0' where meins = 'EA' and SPART not in('10','12','15','20','30');
update bev set bwsie = (fkimg * '-1') where SHKZG = 'X';
update bev set bwfkimg = (fkimg * '-1') where SHKZG = 'X';
This did not produce the required results so I thought I would try
creating a second table
and using a trigger with if-then-else to update it.
Can't use the trigger on the
original table because it mutates.
create table bev2(
VBELN VARCHAR2(10),
POSNR VARCHAR2(6),
BWSIE NUMBER(9,2),
BWFKIMG NUMBER(22)
insert into bev select vbeln, posnr, meins, spart, fkimg , shkzg, '', ''
from [email protected]
where vbeln = '0090043834' and posnr = '000011'
insert into bev select vbeln, posnr, meins, spart, fkimg , shkzg, '', ''
from [email protected]
where vbeln = '0090043833' and posnr = '000011'
CREATE OR REPLACE trigger bev_trg
after insert
on bev
for each row
DECLARE
MEINS VARCHAR2(3);
SPART VARCHAR2(2);
FKIMG NUMBER(22);
BEGIN
insert into bev2
(vbeln,
posnr,
fkimg
values
(:new.vbeln,
:new.posnr,
:new.fkimg
IF :new.FKIMG = '10' and :new.MEINS = 'EA'
THEN
update bev2 set bwsie = (:new.fkimg * '12.17') ;
ELSIF
:new.FKIMG = '12' and :new.MEINS = 'EA'
THEN
update bev2 set bwsie = (:new.fkimg * '19.02');
ELSIF
:new.FKIMG = '15' and :new.MEINS = 'EA'
THEN
update bev2 set bwsie = (:new.fkimg * '27.39');
ELSIF
:new.FKIMG = '20' and :new.MEINS = 'EA'
THEN
update bev2 set bwsie = (:new.fkimg * '48.69');
ELSIF
:new.FKIMG = '30' and :new.MEINS = 'EA'
THEN
update bev2 set bwsie = (:new.fkimg * '109.56');
ELSIF
SHKZG = 'X'
THEN
update bev2 set bwsie = (:new.fkimg * '-1');
ELSE
update bev2 set bwsie = '0' ;
END IF;
update bev2 set bwfkimg = (:new.fkimg * '-1') where SHKZG = 'X';
end; -
Update by after insert trigger
I need to update each new inserted row of data by checking if there were same values in the table. So I tried the After Insert Trigger with the code below :
CREATE OR REPLACE TRIGGER approve_checker
after insert on TBL_BILL
for each row
declare
counter integer;
begin
SELECT COUNT() INTO counter FROM TBL_BILL WHERE issue_date=:NEW.issue_date AND wagon_no=:NEW.wagon_no ;*
IF( counter > 1)
THEN
UPDATE TBL_BILL SET approved = 2 WHERE id = :NEW.id;
END IF;
end approve_checker;
But errors accured :
ORA-04091: table RAIL.BILL is mutating, trigger/function may not see it
ORA-06512: at "RAIL.APPROVE_CHECKER", line 4
ORA-04088: error during execution of trigger 'RAIL.APPROVE_CHECKER'
Any help appreciated.You cannot SELECT from the table on which the row-level trigger is defined, nor can you UPDATE a table on which the row-level trigger is defined. If you are inserting multiple rows in a single INSERT statement, Oracle can't be sure what rows to update and/or select.
Is there a reason that you wouldn't just create a unique constraint to enforce this condition?
Justin -
Hi,
I am using Oracle 10G DS with Oracle 11G XE. I tried PRE-INSERT Trigger with the Code given by Mr Hamid. However, its not working. Though, the WHEN-NEW-ITEM-INSTANCE works fine, I wish to use PRE-INSERT Trigger only.
Can you please help me.
My Code is shown below
BEGIN
SELECT asset_id_seq.nextval INTO :r_it_blk.asset_id
FROM dual;
END;
Thanks in advance
RameshHi Hamid,
Thank you very much for your reply.
I tried at Block Level itself. Further, I also tried the below Code with Cursor (Block Level). Unfortunately, it is also not working. Even the Error Message is also not displayed. The User has full privileges.
DECLARE
CURSOR next_id IS SELECT asset_id_seq.NEXTVAL FROM dual;
BEGIN
OPEN next_id;
FETCH next_id INTO :r_it_blk.asset_id;
CLOSE next_id;
IF :r_it_blk.asset_id IS NULL THEN
Message('Error Generating Next Asset ID');
RAISE Form_Trigger_Failure;
END IF;
END;
Regards
Ramesh -
Problem with forms6i using Pre-Insert Trigger
I created a block level pre-insert trigger to do some validations and when I save the first time with wrong data it is working fine and popping up alerts that I defined but if I press save the second time it is saving even though the data is wrong.
This is in Applications 11.5.10 using all the property classes and running on the server.
I created exact replica of the form(no applications, property classes
just basic form but with same functionality) and ran it on my local machine it is working fine. It is giving error till the data is fixed.
Anybody know why?
Thanks in advanceIt did not work. It is still doing the samething. Actually it is popping up my alerts but saving the record first time itself. Is there any way I can tell it not to save if the data is wrong. My code is below it basically pops up the alerts but doesn't tell anywhere not to save it.
Thanks
VJ
declare
v_amount number;
alert_id ALERT := Find_Alert('amount_from');
alert_id1 ALERT := Find_Alert('amount_to');
dummy_var NUMBER;
begin
select max(ssibe_amount_to) into v_amount from ssibe_orderappr_tab where
ssibe_account_number = :ssibe_orderappr.ssibe_account_number;
if :ssibe_orderappr.ssibe_amount_from <= v_amount
then
Set_Alert_Property(alert_id, ALERT_MESSAGE_TEXT, 'Amount_From should be greater than '|| v_amount);
dummy_var := Show_Alert(alert_id);
else
IF (:SSIBE_ORDERAPPR.SSIBE_AMOUNT_TO <= :SSIBE_ORDERAPPR.SSIBE_AMOUNT_FROM)
THEN
dummy_var := Show_Alert(alert_id1);
end if;
end if;
end; -
Mutating table exception on trigger with After Insert but not with before
Hi
I need to maintain some constraint on the table to have only one row for values of the columns but not by primary key constraint.
Because in case of primary key the insert would fail and the rest of the operation would be discontinued, I cannot change in the somponent that inserts the row so I have to prevent that on the table I have.
I created a before insert trigger on the table which checks if any row exists in the table with same column values as the one being inserted. if found I delete the rows and let the insert happen (w/o raising any error). if the rows do not exist then the insert shall be continued.
I read at place that modifying the dame table in the trigger body shall raise a mutating table exception, but I donot get the exception when the trigger is fired.
Just when I change the trigger to after insert trigger then the nutating table exception is thrown.
Is it the right behavior i.e. the Before insert trigger does not raise the exception and only after insert does that, since I could not find the example for before insert triggers throwing such exception so I think it is better to confirm it before finalizing the implementation.
Thanks
Sapansapan wrote:
Hi Tubby
I cannot user unique constraint because that would raise an exception upon violation and the third party component that is inserting in the table would fail.
That component does some other tasks as well after this insert and if an exception is raised then those tasks would not be performed.
Also I cannot change the component to ignore this exception.Well then, you're in a bit of a pickle.
I'm guessing the trigger you have been working on isn't "safe". By that i mean that it doesn't account for multi-user scenarios. You'll need to serialize access to the data elements in question and implement some sort of locking mechanism to ensure that only 1 session can work with those values.
After you work out how to do that it sounds as though you would be better served using an INSTEAD OF trigger (you'd need to implement this on a view which is made off of your base table).
Here's one way you can work on serializing access to your table on a relatively fine grained level (as opposed to locking the entire table).
Re: possible to lock stored procedure so only one session may run it at a time?
Cheers, -
Insert old missing data from one table to another(databaase trigger)
Hello,
i want to do two things
1)I want to insert old missing data from one table to another through a database trigger but it can't be executed that way i don't know what should i do in case of replacing old data in table_1 into table_2
2)what should i use :NEW. OR :OLD. instead.
3) what should i do if i have records exising between the two dates
i want to surpress the existing records.
the following code is what i have but no effect occured.
CREATE OR REPLACE TRIGGER ATTENDANCEE_FOLLOWS
AFTER INSERT ON ACCESSLOG
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
V_COUNT NUMBER(2);
V_TIME_OUT DATE;
V_DATE_IN DATE;
V_DATE_OUT DATE;
V_TIME_IN DATE;
V_ATT_FLAG VARCHAR2(3);
V_EMP_ID NUMBER(11);
CURSOR EMP_FOLLOWS IS
SELECT EMPLOYEEID , LOGDATE , LOGTIME , INOUT
FROM ACCESSLOG
WHERE LOGDATE
BETWEEN TO_DATE('18/12/2008','dd/mm/rrrr')
AND TO_DATE('19/12/2008','dd/mm/rrrr');
BEGIN
FOR EMP IN EMP_FOLLOWS LOOP
SELECT COUNT(*)
INTO V_COUNT
FROM EMP_ATTENDANCEE
WHERE EMP_ID = EMP.EMPLOYEEID
AND DATE_IN = EMP.LOGDATE
AND ATT_FLAG = 'I';
IF V_COUNT = 0 THEN
INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT
,TIME_IN ,TIME_OUT,ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
NULL,
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
NULL ,'I');
ELSIF V_COUNT > 0 THEN
UPDATE EMP_ATTENDANCEE
SET DATE_OUT = TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
TIME_OUT = TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_OUT
ATT_FLAG = 'O'
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_IN <= (SELECT MAX (DATE_IN )
FROM EMP_ATTENDANCEE
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL )
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL ;
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN RAISE;
END ATTENDANCEE_FOLLOWS ;
Regards,
Abdetu..INSERT INTO SALES_MASTER
( NO
, Name
, PINCODE )
SELECT SALESMANNO
, SALESMANNAME
, PINCODE
FROM SALESMAN_MASTER;Regards,
Christian Balz -
Insert or Update data in SAP with Business Objects?
Hi all,
I am new to Business Objects world with my little expertise in Crystal Reports and Xclesius.
Could you please clarify me that is there any solution or technology or Product of Business Objects which not only make impressive dashboards and analyze the data but also can communicate with back end SAP R/3 to save or update data.
We are actually analyzing our Client requirements in which there is a need of Dashboards as well as some custom configurations that needs to be saved somewhere in the SAP system in order to make decisions in future.
Our back end system is SAP BW. One possibility is to use Adobe Flex as a base architecture with BSP and BW but we are more concerned with what BOBJ provides.
Looking forward for your suggestions.
Kind Regards
Umer FarooqGR81 wrote:
I would like to know how I can insert or update data in a Google Spreadsheet from an Oracle Database please?
Thanks,you can't since Oracle knows nothing about spreadsheets; Google or otherwise. -
Insert OR Update with Data Loader?
Hello,
can i Insert OR Update at same time with Data Loader?
How can i do this?
Thanks.The GUI loader wizard does allow for this including automatically adding values to the PICKLIST fields.
However, if you mean the command line bulk loader, the answer is no. And to compound the problem, the command line version will actually create duplicates for some of the objects. It appears that the "External Unique Id" is not really "unique" (as in constrained via unique index) for some of the objects. So be very careful when you prototype something with the GUI loader and then reuse the map on the command line version.
You will find that some objects can work well with the command line loader (some objects will not).
Works well (just a few examples):
Account (assuming your NAME,LOCATION fields are unique).
Financial Product
Financial Account
Financial Transaction
Will definitely create duplicates via command line bulk loader:
Contact
Asset
Also be aware that you might hear that during a go-live that Oracle will remove the 30k record limit on bulks loads (temporarily). I have not had any luck with Oracle Support making that change (2 clients specifically in the last 12 months). -
Errors with post-insert trigger
I had a POST-INSERT TRIGGER here.but i encountered some problems.can someone help me with the errors?
begin
insert into user_acct
userid_n, user_m, coy_c, contact_n, emp_n,
work_loc_c, curr_passwd_t, prt_f, indv_pc_f, pc_deploy_c,
ext_email_addr_t, other_na_sys_t, status_c, status_rmk_t, upd_d)
values
(:user_acct.userid_n, :user_acct.user_m, :user_acct.coy_c, :user_acct.contact_n, :user_acct.emp_n,
:user_acct.work_loc_c, :user_acct.curr_passwd_t, :user_acct.prt_f, :user_acct.indv_pc_f, :user_acct.pc_deploy_c,
:user_acct.ext_email_addr_t, :user_acct.other_na_sys_t, :user_acct.status_c, :user_acct.status_rmk_t,
:user_acct.upd_d);
exception
when others then
clear_message;
Message('Insertion of Applicant Particulars failed');
SYNCHRONIZE;
RAISE Form_Trigger_failure;
end;
begin
insert into user_acct_na_detl
na_sys_c)
values
(:na_sys_cd.na_sys_c);
exception
when others then
clear_message;
Message('Insertion of Non-Application failed');
SYNCHRONIZE;
RAISE Form_Trigger_failure;
end;
when others then
null;
end;
the error:
Error 103 at line 31, column 3
Encountered the symbol 'WHEN' when expecting one if the following:
begin declare end exception exit for goto if loop mod null
pragma raise return select update while <an identifier>
<a double-quoted delimited-identifier><a bind variable><<
close current delete fetch lock insert open rollback
savepoint set sql commit<a single-quoted SQL string>
The symbol "exception"was substituted for "WHEN" to continue
Error 103 at line 2, column 1
Encountered the symbol "END"i delete the "END" already but when i compile again, i encountered some error again.
Error 370 at line 27, column
OTHERS handler must be last among the exception handlers of a block
Error 0 at line 1, column 1
Statement ignored
Maybe you are looking for
-
Constraints are not created when using a cart
Hi all, I have created a cart in SQL Developer with all the tables from HR schema. If I apply the cart to my database cloud service the tables and data are there but most of the constraints are missing. In log I can see error messages like: Error sta
-
How to use Result Search (TREX) Impagination in customize Layout Set
Hello Experts We are using a customise Layout Set get from "NewsBrowser" duplication.. At the moment we are using it to show the first three documents of a km folder, but that folder contains a lot of documents and in the bottom of the iview are show
-
My settings and my icloud don't match.
I have a 4s and the settings says that I have 2.2 GB of pictures but when I got into my Icloud it says that I have 4.7 GB of pictures. How can I fix that? I would love to be able to back up my iphone again without having to buy more storage.
-
For some reason I have lost the handles when I use the Radial Filter and I cannot change or move the oval. Is there something Lightroom 5.5 that is a issue or am I doing something wrong?? I am on a mac with 10.9.5.
-
The file path and directory about the .exe file created in LabView, who knows?
I have a project, in the project, VIs and documents(.doc,.txt,.tdms,etc.) in different directories, and when the project run in the labView, it can find the directories and files, but when I created .exe file, I found the directories had changed and