Trigger not working
Good Day !
Hi ,
Scenario , I have a oracle form i'm loading the data from text file to the form(non - database block), it have two columns "CODE" and "Verify".
The data will be populated in the column "CODE", Once the complete data is loaded in the Form, Each value in the "CODE" column is verified with database lookup table, if the value in the "Code" column exist in the database then Corresponding "Verify" will have value as YES,
otherwise it will be NO.
My issue is the file is getting populated using webutil, but the corresponding value in "Verify" not populated
My script given below... At When- button - pressed...
DECLARE
txtfile text_io.file_type;
linebuf VARCHAR2 (1800);
filename VARCHAR2 (30);
ret NUMBER;
count_pl NUMBER;
BEGIN
count_pl := 1;
filename := webutil_file.file_selection_dialog ('D:\');
IF (filename IS NOT NULL)
THEN
txtfile := text_io.fopen (filename, 'r');
text_io.get_line (txtfile, linebuf);
LOOP
ret := 0;
:count_plmn := count_pl;
:form_code := linebuf;
text_io.get_line (txtfile, linebuf);
NEXT_RECORD;
count_pl := count_pl + 1;
text_io.new_line;
EXIT WHEN linebuf IS NULL;
END LOOP;
END IF;
GO_BLOCK ('block5');
FIRST_RECORD;
LOOP
IF :roam_plmn_code IS NOT NULL
THEN
SELECT COUNT (*)
INTO ret
FROM lookup
WHEREcode = :form_code;
IF ret = 0
THEN
:valid_roam := 'N';
ELSE
:valid_roam := 'Y';
END IF;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END LOOP;
END;can any one help ASAP , Thanks in Advance.
Hi,
Is the below code same as written in your form or is there some typo error:
SELECT COUNT (*)
INTO ret
FROM lookup
WHEREcode = :form_code;I can't find a space between WHERE and code. Not sure, if it is a typo.
Another thing, is form_code a data item in block5?
Hope it helps.
Navnit
Similar Messages
-
Format Trigger not working in 10g Report.
I have a report with two eclipses
(*) Debit (*) Credit . Please note that the two asterics denotes eclipses.
I have a format triggers on these eclipses based on the database item Debit_credit.
IF :debit_credit = 'CREDIT' THEN
RETURN FALSE;
ELSE
RETURN TRUE;
End if;
and vis-visa. However the format trigger is not working. Regardless of the value of
debit_credit. I even created a frame around these eclipses and put my format trigger all to no avail. Please help.Create a boilerplate text in your repeating frame (get rid of the field :debit_credit from your layout, but leave it in your query). I created the boilerplate field B_1. My format trigger looks like:
function B_1FormatTrigger return boolean is
begin
if upper(:debit_credit) = 'CREDIT' then
srw.set_field(0, to_char('(*) CREDIT'));
else srw.set_field(0, to_char('(*) DEBIT'));
end if;
return (TRUE);
end;I hope I understood your question OK...I am not sure what an eclipses is? -
After Logon on Database Trigger Not Working From Client Terminal
Hi Every One
I Have a Problem, I'am Using Oracle 10g R2, I'd Written After Logon on Database Trigger, I'd Written The Trigger Under The Under The User With DBA Privileges, and it is work Fine, but it is work only when i Logon On The Database from The Server Terminal with any user, and If Logon From any Other Terminal It Is Not Work,
Can any One Know The Reason, Please Help me
Yasser MokhtarPlease post the trigger code.
-
Business Rule in trigger not working
Hi,
I have business rule that no one below 18 years should be employed in this system.
I have created a trigger that alerts me so, but when ever I insert someone either over 10 or below, it fires and deos not insert any record, but if I deleted the trigger, everything works fine.
I should have put a check constraint (s_hire_date - s_dob) < 6570 on the table, but I just thought should be able to do it.
Why please?
stops insertion of under 18 years into employee table
CREATE OR REPLACE TRIGGER Tr_new_employee
BEFORE INSERT ON employee for each row
DECLARE s_hire_date DATE;
s_dob date;
begin
select :NEW.hire_date, :NEW.dob into s_hire_date, s_dob from employee
where empid =:new.empid;
IF (s_hire_date - s_dob) < 6570 then
raise_application_error(-20101,'Person too young');
end if;
end;
Many thanks in advance
cube60Hello Warren and All,
Thanks for the code, the trigger did compile successfully, but prevents any kind of insertion whether over 18 or younger.
SQL> CREATE OR REPLACE TRIGGER Tr_new_employee
2 BEFORE INSERT ON employee for each row
3 DECLARE s_hire_date DATE;
4 s_dob date;
5 begin
6
7 select :NEW.hire_date, :NEW.dob into s_hire_date, s_dob from employee
8 where empid =:new.empid;
9
10 IF TRUNC(months_between(s_hire_date,s_dob)/12) < 18 then
11 raise_application_error(-20101,'Person too young');
12 end if;
13 end;
14 /
Trigger created.
SQL> COMMIT;
Commit complete.
SQL> --under 18 to time of hire_date
SQL> EXEC NEW_EMPLOYEE('CHARLES','DICKSON','M','29-JAN-1992','PT2','','','','',sysdate,NULL,09890111
,'HSBC','WANDSWORTH','CURRENT','PR3');
BEGIN NEW_EMPLOYEE('CHARLES','DICKSON','M','29-JAN-1992','PT2','','','','',sysdate,NULL,09890111,'HS
ERROR at line 1:
ORA-01403: no data found
ORA-01403: no data found
ORA-06512: at "SYSTEM.TR_NEW_EMPLOYEE", line 5
ORA-04088: error during execution of trigger 'SYSTEM.TR_NEW_EMPLOYEE'
ORA-06512: at "SYSTEM.NEW_EMPLOYEE", line 26
ORA-06512: at line 1
SQL> COMMIT;
Commit complete.
SQL> --over 18
SQL> EXEC NEW_EMPLOYEE('WARREN','TALENTINO','M','29-JAN-1975','HOURLY','','','','','18-FEB-2001',NUL
L,36901212,'BARCLAYS','SYDENHAM','CURRENT','TEMP7');
BEGIN NEW_EMPLOYEE('WARREN','TALENTINO','M','29-JAN-1975','HOURLY','','','','','18-FEB-2001',NULL,36
ERROR at line 1:
ORA-01403: no data found
ORA-01403: no data found
ORA-06512: at "SYSTEM.TR_NEW_EMPLOYEE", line 5
ORA-04088: error during execution of trigger 'SYSTEM.TR_NEW_EMPLOYEE'
ORA-06512: at "SYSTEM.NEW_EMPLOYEE", line 26
ORA-06512: at line 1
I know your logic is fine, something might be wrong with the trigger even though it created succesfully. It is not doing what it is intended to do.
Many thanks
cube60 -
Account Assignment Trigger not Working
I'm working on Siebel Assignment Manager.. first I try to Assign Service Request to an Employee and in two Assignment mode (Batch and Dynamic) and it's work fine.
but when I try to assign Account to a Position, and I follow the same steps I followed before, the monitor work and the owner change depending on the Score and the Rule not working ...on the other hand the trigger (Dynamic) not working at all, and there is no change
I have searched to know where is the problem …and didn’t find solution
please help me ASAP
Thanks & Regards,
EnasHi Glenn,
Thanks for u r replay.
We are using our own ZVIEWS. We have copied the Bupasearch view and we done some modifications according to our requirement.(added DOB field)
We got DOB in our Zview. But Customer search functionality is not working.
Plz help me to solve the issue.
Thanks,
Sreedhar -
Oracle Form Services Installation (Test.fmx) Trigger Not working
Hi
I install oracle BI and forms Services on oracle application infrastructure after installation i run the following command "http://ora.server.com:7778/forms/frmservlet?config=testfrm" it will show the form "form services install sucessfully" but when i do a certain cusmization on it i.e. put a one text box on that text put put a key_next tigger in which i show a alert message only. After Customization i run a same URL it will again show that form with the changes but the trigger (Key_next) will not fire
I don't understatnd why tigger is not working or fire.So we understand things correctly,
You are running a form and a trigger won't fire. What kind of trigger? A when-button-pressed, or a key-next-item, or something else? I don't believe key_next is a valid trigger.
If you are using a key trigger, you need to make sure that the keys are mapped as you expect. You can see how the keys are mapped in the menu under Help => Keys when you run the form. Make sure the button is mapped like you expect. Additionally, you can modify the mapping by updating the resource file, but that's kind of outside the scope of this...
This type of questions really is suited for the Forms forum under Developer Tools => Forms at: Forms
If you need more help, post there. The focus of that section if Forms. -
Trigger not working as expected
create or replace trigger EMP_B4
before insert on SCOTT.EMP
for each row
when (NEW.SAL IS NULL)
declare
-- local variables here
i NUMBER;
begin
:NEW.SAL := 22222;
end EMP_B4;Hi,
The trigger is not working; when an entry inserted with SAL null, I should see the salary set to default 22222. But sometimes, it dont work and SAL remains as NULL.
Anyone encountered similar case before?
Message was edited by:
[email protected]Hi,
Here is what i have done. I have used your trigger as;
SQL> create or replace trigger EMP_B4
2 before insert on SCOTT.EMP
3 for each row
4 when (NEW.SAL IS NULL)
5 declare
6 -- local variables here
7 i NUMBER;
8 begin
9 :NEW.SAL := 22222;
10* end EMP_B4;
11 /
Trigger created.
SQL> insert into emp (empno,deptno) values (111,10);
1 row created.
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
111 22222 10
211 yogesh analyst 7369 12-DEC-05 22222 10 20
SQL> insert into emp values (211,'yogesh','analyst',7369,'12-dec-2005','',10,20);
1 row created.
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
111 22222 10
211 yogesh analyst 7369 12-DEC-05 22222 10 20
See, again it's working fine. Can you give a case where your trigger has not workrd properly. -
Logon trigger not working over DB-Link?
Hi all,
I have a serious question about accessing tables over a database link.
I have three schema:
DATA@SOURCE
INTERFACE@SOURCE
WORK@TARGET
Schema DATA has one table called T1
The INTERFACE schema has select privileges on all tables from DATA. Furthermore schema INTERFACE has a logon trigger to change the "current schema" to DATA:
CREATE OR REPLACE TRIGGER TRG_A_LOGIN_SET_SCHEMA AFTER LOGON
ON INTERFACE.SCHEMA
BEGIN
execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = DATA';
END;
The WORK schema has a database link to the INTERFACE schema called INT_DB_LINK.
I am now logged into schema WORK on the TARGET database and I am executing following statement:
select a from T1@INT_DB_LINK
-> it's working
Next I execute
declare
cursor c is
select a
from T1@INT_DB_LINK
where rownum<2;
begin
for r in c loop
null;
end loop;
end;
This is not working. Error message is ORA-000942: table or view does not exist.
But why?
Can anyone help me?
Thanks in advance
PyHi all,
after a long, very long search I found what caused this strange behaviour.
The ORA- Error was not raised by the SQL-Execution-Engine but by the SQL-Parser/SQL-Validation.
As the second statement is an anonymous SQL block the Oracle Parser checks all objects dependencies before execution.
This means a connection is established from TARGET to SOURCE checking if table T1 is available. The strange thing is
that on this connection the "ALTER SESSION" trigger is not fired. So the parser does not find object T1 in schema INTERFACE.
If I create an empty table T1 in INTERFACE the anonymous block gets parsed/validated and the statement is executed. But this
time the block does a normal "connect session" and the trigger is fired. This means the statements accesses the T1 table in
schema DATA. (But T1 in INTERFACE has to be existent that parse/validation works)
I don't know if this is a bug or a feature.
To workaround this I have created private synonyms in schema INTERFACE pointing to the objects in DATA.
Thanks for your help!
Py
regarding the other qestion:
Yes, permissions are granted over a role. -
Hello all.
I am working on a project, Yes it is for a class. I am creating a simple Boat rental db. I am trying to construct a Trigger that will verify when a Reservation is made for a particular date and time in the future (current day and beyond) that the Rental_Start_Time falls within the business hours for that particular date.
I have a Reservation table
CREATE TABLE RESERVATION
(res_id NUMBER (10),
req_date DATE,
renter_id NUMBER(10),
model VARCHAR2(30) NOT NULL,
rental_date DATE NOT NULL,
rental_start_time DATE NOT NULL,
rental_end_time DATE NOT NULL,
guests NUMBER(2) NOT NULL,
CONSTRAINT res_id_pk
PRIMARY KEY(res_id, req_date, renter_id, model))My trigger is as such:
CREATE OR REPLACE TRIGGER bus_hrs
BEFORE INSERT ON RESERVATION
FOR EACH ROW
DECLARE
RST DATE := :NEW.RENTAL_START_TIME;
RD DATE := :NEW.RENTAL_DATE;
BEGIN
IF ((TO_CHAR(RD,'D') BETWEEN 1 AND 5) AND
(TO_DATE(TO_CHAR(RST, 'hh24:mi'), 'hh24:mi') NOT BETWEEN
TO_DATE('12:00', 'hh24:mi') AND TO_DATE('21:00', 'hh24:mi')))
OR ((TO_CHAR(RD, 'D') BETWEEN 6 AND 7)
AND (TO_DATE(TO_CHAR(RST, 'hh24:mi'), 'hh24:mi') NOT BETWEEN
TO_DATE('08:00', 'hh24:mi') AND TO_DATE('24:00', 'hh24:mi'))) THEN
RAISE_APPLICATION_ERROR(-20999,
'Rental start times cannot be scheduled outside of business hours');
END IF;
END bus_hrs;And this is my call:
CALL make_reservation(SYSDATE,'11','pontoon' , (to_date('2012/06/15 08:00', 'yyyy/mm/dd hh24:mi')),(to_date('2012/06/15 08:00', 'yyyy/mm/dd hh24:mi')), (to_date('2012/06/15 16:00', 'yyyy/mm/dd hh24:mi')), '12');And this is the result I am seeing:
ORA-20999: Unhandled error in make_reservation. Please contact your application administrator with the following information: ORA-01850: hour must be between 0 and 23 ORA-06512: at "LAKERS.BUS_HRS", line 9 ORA-04088: error during execution of trigger 'LAKERS.BUS_HRS' ORA-06512: at "LAKERS.EXCEPTION_HANDLER", line 11 ORA-06512: at "LAKERS.MAKE_RESERVATION", line 15
In the Call I am trying to make enter a reservation for June 15 with a start time of 08:00 AM which should be an hour of 8, however the error response tells me it is not recognizing the hour.
Am I formating the Call wrong or do i have a problem within the trigger?
Thanks for taking the time to look.
GHi,
You're doing a lot of converting between DATEs and VARCHAR2s, and back again. There's no need for that.
It looks like all you need to know about :NEW.rental_start_time is the time of day. If so, convert it once for all into a form convenient to work with, such as as string like '14:30'. Likewise for :NEW.rental_date.
I think you want something like this:
CREATE OR REPLACE TRIGGER bus_hrs
BEFORE INSERT ON RESERVATION
FOR EACH ROW
DECLARE
days_into_week NUMBER := :NEW.rental_date
- TRUNC (:NEW.rental_date, 'IW');
rst VARCHAR2 (5) := TO_CHAR ( :NEW.rental_start_time
, 'HH24:MI'
BEGIN
IF (days_into_week < 5 AND rst NOT BETWEEN '08:00' AND '24:00') -- Monday-Friday
OR (days_into_week >= 5 AND rst NOT BETWEEN '12:00' AND '21:00') -- Saturday-Sunday
THEN
RAISE_APPLICATION_ERROR ( -20999
, 'Rental start times cannot be scheduled outside of business hours'
END IF;
END bus_hrs;
SHOW ERRORSDo you really need two separate columns, rental_date and rental_start_time? What are you using the hours, minutes and seconds parts of rental_date for? What are you using the year, month and day parts of rental_start_date for?
TO_CHAR (date_column, 'D') depends on your NLS_TERRITORY setting. If you ever change NLS_TERRITORY, you're probably not going to remember to change this trigger. I used 'IW' instead of 'D', because 'IW' does not depend on any NLS settings. -
Report format trigger not working
Hi,
I am using a format trigger on a column in my report as follows:
function B_9FormatTrigger return boolean is
begin
if (:TEST > 30) then
return (FALSE);
else
return (TRUE);
end if;
end;
When testing in reports builder everything works fine, but when running the report from a form, the trigger is not executed.
I am thinking this might have something to do with te reports runtime, but i don't know how to solve it.
I am using Report Builder 9.0.4.0.33
Edited by: user10085365 on 3-feb-2009 6:12so, did you try my suggestion to switch the condition?
Or, is there maybe an old rep-file in your runtime-environment which doesn't include the format-trigger? Try to colorize a field and see if the correct reports-version is run.
And I am a 100% shure the :TEST value is correct.
So the field that should be hidden, stays displayedYes, but its unlikely that you hit a bug here (but not impossible), the chance in gendral is higher that there is some other reason for that. (in my case, 99.99% of the things which don't work are my own fault ;-) ) -
Dear All,
I wrote the DataBase Trigger which gets compile but not execute and if i execute the procedure manually then it works.
CREATE OR REPLACE TRIGGER ficreports.trg_omni
AFTER STARTUP ON DATABASE
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
Temp_Reporting_Datasync;
commit;
END;
Kindly give your valuable suggestions to start executing the trigger after starting the database.
Regards,
AnandYes , if it is fired then it will perform the DML operation on the tables which is mentioned inside the procedure..
Is there any possiblibility of not firing the trigger or the way of calling procedure is not correct ?
Kindly confirm. -
Echo letter /proc/sysrq-trigger not-working? [Solved]
According to various resources including https://fedoraproject.org/wiki/QA/Sysrq … it_work.3F
It's possible to write a letter to trigger a sysrq command like so:
[root@a-pc proc]# echo t> /proc/sysrq-trigger
'm' - Will dump current memory info to your console.
Edit: apparently the info is outdated? At any-rate it writes correctly to journal rather than to console (I did check the journal as well before posting but I had a few processes on watch and forgot to filter those :S). Feel free to delete this post if it's not contributing anything.
Last edited by dejy (2015-04-29 17:54:29)Thanks for the tip, but I just discovered the issue on my own: I actually forgot to install "xf86-input-synaptics". (Well, it's the newbie corner... )
I think I installed it the first time I tried to get everything to work, and then forgot about it the second time I installed Arch on my machine... Sorry for all the fuss about nothing, apparently.
Last edited by Lustique (2013-11-29 20:43:37) -
Delete trigger not working on delete button
I have a form (parent) / report (children) combo page with all the default buttons (create, apply changes, delete, cancel) created from the wizard. I've created a before delete trigger on the parent table that basically finds all the children and deletes them. For debugging purposes, I've added some inserts into a test table to make sure my bind variables binding correctly (they are). When I confirm the java script delete and say ok, the insertion of the text for debugging purposes works fine, but the actual deletion of the other records does not. Any ideas why?
Then it is easy-your delete process is not fireing!!
Why...there may be many reasons....but I'm pretty sure that process is never fired!
Look in your page or show us a demo on workspace -
Instead of Trigger not working as expected
We use a view v_test ( union on two tables ) with an Instead of Trigger for insert. The Instead of Trigger just inserts data into one of the underlying tables.
If we insert a single row ( insert into v_test(...) values(...) ) everything works fine.
If we insert multiple rows using one statement ( insert into v_test(...) select ...) some columns have same values although they should be different.
(tested on Oracle 9 and 10)here is an example (Oracle Version is 9.2.0.6.0):
view vtest_:
SELECT *
FROM (SELECT * FROM EM_TRANSPORTMITTEL_B
UNION
SELECT * FROM EM_TRANSPORTMITTEL_H)
WHERE Nvl(To_Date(pa_session.f_getContext('hist_date'), 'dd.mm.yyyy hh24:mi:ss'), SYSDATE) BETWEEN hist_from AND hist_to
Instead of Trigger:
CREATE OR REPLACE TRIGGER tib_v_test instead of insert on v_test for each row
declare
l_cols EM_TRANSPORTMITTEL_B%rowtype;
begin
l_cols.EM_TRANSPORTMITTELID := :new.EM_TRANSPORTMITTELID;
l_cols.tmtyp := :new.tmtyp;
insert into EM_TRANSPORTMITTEL_B (em_transportmittelid, tmtyp, ....) values (l_cols.em_transportmittelid, l_cols.tmtyp, ....)
end tib_v_test;
Insert Statement
insert into v_test (em_transportmittelid, tmtyp, ...)
select em_transportmittelid, 'WAGEN' tmtyp, ...
from tmp_tmstamm
order by wagenummer; -
After Insert Trigger Not Working
Hi All,
I am not a guru in writing triggers.
I am inserting new records in a Table FA_BOOKS by application and this inserts records in FA_ADDITIONS_B. This is a vanilla process.
i have written a trigger on FA_ADDITIONS_B, and i want to update the cost from the fa_books to fa_additions_b column attribute21
The trigger i have written is After insert on FA_ADDITIONS_B and i try to select cost from the fa_books for the :new.asset_id.
SELECT COST
INTO v_cost
FROM FA_BOOKS
WHERE ASSET_ID = :NEW.ASSET_ID;
this is always returning no_data_found exception and i do not understand how to update the attribute21 in FA_ADDITIONS_B
Here is a sample of my trigger.
CREATE OR REPLACE TRIGGER update_attribute21_new_asset_1
after INSERT ON fa_ADDITIONS_B
FOR EACH ROW
DECLARE
V_COST NUMBER;
BEGIN
SELECT COST
INTO v_cost
FROM FA_BOOKS
WHERE ASSET_ID = :NEW.ASSET_ID;
update fa_ADDITIONS_B
set attribute21 = v_cost
where ASSET_ID = :NEW.ASSET_ID;
END;
Any help on this will be appreciated.
TX in advance.
Regards,I still haven't understood the reason why you can't transfer the COST information from FA_BOOKS to FA_ADDITIONS_B in the initial trigger on FA_BOOKS that populates FA_ADDITIONS_B. Or how is the population of FA_ADDITIONS_B accomplished? Is it part of the application code?
Regarding the NO_DATA_FOUND issue:
Is it ensured that populating the FA_ADDITIONS_B table is done in the same transaction as the FA_BOOKS inserts or that the FA_BOOKS transaction is committed?
Why do you need that additional trigger?
My assumption is that you're in a trigger "chain" - if I get your approach correctly - you're basically attempting to query FA_BOOKS in a trigger on FA_ADDITIONS_B that in turn has been triggered by a trigger on FA_BOOKS which gets us back to the "mutating" trigger issue. You can't read a table that is currently in the process of being modified.
Or even worse: The (potential) trigger on FA_BOOKS that populates FA_ADDITIONS_B uses "autonomous transaction" and therefore the trigger on FA_ADDITIONS_B can't see the changes of the original transaction.
As already mentioned: Be very careful with "autonomous transactions" in general. There are only a few cases where these are actually useful (e.g. logging purposes), but Tom Kyte has written numerous articles why triggers and in particular autonomous transactions are mostly evil.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Sql server 2012 Logon trigger not working for certain logins
Hello. I created a login trigger to insert data for each login in a table, and it works for all logins except one that is format domain\login
and the login ends with the dollar sign(actual name is domain\CTXDEVDCSI1$).
I had been using varchar, but after reading other forum posts, I changed the varchar's to nvarchar's, but it still fails for that id.
The errors written to the sql server error log were the usual "login failed due to trigger execution".
I had granted insert on the rvvlogindata table in dsa to public, and only one id wasn't able to login after that.
Any suggestions would be much appreciated!
Here's the modified table ddl:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[rvvlogindata](
[sessionId] [int] NULL,
[LoginTime] [datetime] NULL,
[HostName] [nvarchar](50) NULL,
[ProgramName] [nvarchar](300) NULL,
[LoginName] [nvarchar](50) NULL,
[ClientHost] [nvarchar](50) NULL
) ON [PRIMARY]
GO
Here's the logon trigger code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create trigger [LOGIN_IP_RESTRICTION] on all server for logon
as
Begin
Declare @LogonTriggerData xml,
@EventTime datetime,
@LoginName nvarchar(50),
@ClientHost nvarchar(50),
@HostName nvarchar(50),
@AppName nvarchar(300)
Set @LogonTriggerData = eventdata()
set @EventTime = @LogonTriggerData.value('(/EVENT_INSTANCE/PostTime)[1]', 'datetime')
set @LoginName = @LogonTriggerData.value('(/EVENT_INSTANCE/LoginName)[1]', 'varchar(50)')
set @ClientHost = @LogonTriggerData.value('(/EVENT_INSTANCE/ClientHost)[1]', 'varchar(50)')
set @HostName = HOST_NAME()
set @AppName = APP_NAME()
insert into dsa.dbo.rvvlogindata
sessionId,
LoginTime,
HostName,
ProgramName,
LoginName,
ClientHost
select @@spid,
@EventTime,
convert(nvarchar(50),@HostName),
convert(nvarchar(300),@AppName),
convert(nvarchar(50),@LoginName),
convert(nvarchar(50),@ClientHost)
END
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ENABLE TRIGGER [LOGIN_IP_RESTRICTION] ON ALL SERVER
GOErland, I wanted to add more info to my reply earlier today.
sp_who2 showed no blocking, activity monitor from my local PC SSMS showed no major waits or high i/o or cpu activity.
I was wondering if you have any suggestions on how to find out what was the cause of the 5+ minute wait for SSMS on the remote desktop to respond and fully come up.
I definitely can't put this in production with this hanging delay possibly occurring there.
I was connecting as read_user when it hung.
sp_who2 output at the time was:
1 BACKGROUND sa . . NULL LOG WRITER 54631 0 04/10
06:59:43
1 0
2 BACKGROUND sa . . NULL RECOVERY WRITER 8673 0 04/10 06:59:43
2 0
3 BACKGROUND sa . . NULL LAZY WRITER 300691 0 04/10
06:59:43
3 0
4 BACKGROUND sa . . NULL RESOURCE MONITOR 1207010 0 04/10 06:59:43
4 0
5 BACKGROUND sa . . NULL XE TIMER 38828 0 04/10
06:59:43
5 0
6 BACKGROUND sa . . NULL XE DISPATCHER 1404 0 04/10
06:59:43
6 0
7 BACKGROUND sa . . master SIGNAL HANDLER 0 0 04/10 06:59:43
7 0
8 BACKGROUND sa . . NULL LOCK MONITOR 179978 0 04/10
06:59:43
8 0
9 sleeping sa . . master TASK MANAGER 0 11 04/21
08:37:04
9 0
10 sleeping sa . . master TASK MANAGER 0 0 04/10
06:59:44
10 0
11 BACKGROUND sa . . master TRACE QUEUE TASK 546 0 04/10 06:59:44
11 0
12 BACKGROUND sa . . NULL SYSTEM_HEALTH_MO 4930 0 04/10 06:59:44
12 0
13 BACKGROUND sa . . NULL RECEIVE 422 0 04/10
06:59:45
13 0
14 BACKGROUND sa . . master CHECKPOINT 79137 31811 04/10
06:59:46
14 0
15 BACKGROUND sa . . master TASK MANAGER 1606 0 04/10
06:59:46
15 0
16 BACKGROUND sa . . NULL UNKNOWN TOKEN 0 0 04/10 06:59:46
16 0
17 sleeping sa . . master TASK MANAGER 0 74 04/21
08:37:04
17 0
18 sleeping sa . . master TASK MANAGER 0 0 04/21
08:18:49
18 0
19 sleeping sa . . master TASK MANAGER 0 0 04/21
08:30:29
19 0
20 sleeping sa . . master TASK MANAGER 0 1 04/21
08:37:14
20 0
21 sleeping sa . . master TASK MANAGER 0 7 04/21
08:30:59
21 0
22 sleeping sa . . master TASK MANAGER 16 4 04/21
08:37:44
22 0
23 sleeping sa . . master TASK MANAGER 0 15 04/21
08:39:24
23 0
25 BACKGROUND sa . . master BRKR EVENT HNDLR 0 95 04/10 06:59:48
25 0
30 BACKGROUND sa . . master BRKR TASK 0 0 04/10
06:59:48
30 0
31 BACKGROUND sa . . master BRKR TASK 16926 0 04/10
06:59:48
31 0
32 BACKGROUND sa . . master BRKR TASK 0 0 04/10
06:59:48
32 0
34 BACKGROUND sa . . master BRKR TASK 10701 0 04/10
06:59:48
34 0
51 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
03:16:56
51 0
52 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
52 0
53 sleeping NT AUTHORITY\SYSTEM SQLDEV2012 . msdb AWAITING COMMAND 0 0 04/10
06:59:58 SQLAgent - Email Logger 53 0
54 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:51 Citrix:Broker#1 54 0
55 sleeping edit_user ASDEV1 . dsa AWAITING
COMMAND 0 0 04/21 08:55:27 jTDS
55 0
56 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
56 0
57 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
57 0
58 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
58 0
59 sleeping NT AUTHORITY\SYSTEM SQLDEV2012 . msdb AWAITING COMMAND 124 242 04/10
06:59:59 SQLAgent - Generic Refresher 59 0
60 sleeping NT AUTHORITY\SYSTEM SQLDEV2012 . msdb AWAITING COMMAND 2790 1160 04/21
08:55:00 SQLAgent - Job invocation engine 60 0
61 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
61 0
62 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
62 0
63 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
63 0
64 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
64 0
65 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
65 0
66 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
03:16:56
66 0
67 sleeping reports_adm REPORTSDEVSI2 . JBOSS_Cluster_CRServer2011 AWAITING COMMAND 0 0 04/21
08:52:12 jTDS
67 0
68 sleeping edit_user DCMA10685 . dsa AWAITING COMMAND 0 0 04/21
08:56:47 jTDS
68 0
69 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:49 Citrix:Configuration 69 0
70 sleeping rvanveen DCMA8460 . master AWAITING COMMAND 1794 7120 04/21
08:51:37 Microsoft SQL Server Management Studio 70 0
71 sleeping xsp_user XSPDEVSI2 . xspv5 AWAITING COMMAND 0 0 04/21
08:58:52 .Net SqlClient Data Provider 71 0
72 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:56:01 Citrix:Monitor 72 0
73 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:30 Citrix:Monitor 73 0
74 sleeping rvanveen DCMA8460 . master AWAITING COMMAND 16 2 04/21
08:53:37 Microsoft SQL Server Management Studio - Query 74 0
75 sleeping rvanveen DCMA8460 . loginaudit AWAITING COMMAND 0 22 04/21
08:50:29 Microsoft SQL Server Management Studio - Query 75 0
76 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:05:07
76 0
77 sleeping adm_jbossportal ASDEV1 . jbossportal AWAITING
COMMAND 0 0 04/21 08:40:27 jTDS
77 0
78 sleeping rvanveen DCMA8460 . master AWAITING COMMAND 110 542 04/21
08:46:17 Microsoft SQL Server Management Studio - Query 78 0
79 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:05:56
79 0
80 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:54 Citrix:MachineCreation 80 0
81 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
08:08:29
81 0
82 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:02:13
82 0
83 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:02:15
83 0
84 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:44 Citrix:Monitor 84 0
85 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:11:05
85 0
86 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:53 Citrix:AdIdentity 86 0
87 sleeping DAIWA_USA\admsql SQLDEV2012 . master AWAITING COMMAND 15 2 04/21
08:56:20 Microsoft SQL Server Management Studio - Query 87 0
88 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:36 Citrix:SiteServices 88 0
89 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:42 Citrix:Host 89 0
90 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:47 Citrix:ConfigurationLogging 90 0
91 RUNNABLE rvanveen DCMA8460 . master SELECT INTO
15 51 04/21 08:58:46 Microsoft SQL Server Management Studio - Query 91 0
92 sleeping rvanveen DCMA8460 . master AWAITING COMMAND 63 30 04/21
08:52:34 Microsoft SQL Server Management Studio - Query 92 0
94 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:53 Citrix:DelegatedAdmin 94 0
95 sleeping DAIWA_USA\admsql SQLDEV2012 . loginaudit AWAITING COMMAND 173 27 04/21
08:56:10 Microsoft SQL Server Management Studio 95 0
96 sleeping xsp_user XSPDEVSI2 . xspv5 AWAITING COMMAND 0 0 04/21
08:58:33 .Net SqlClient Data Provider 96 0
97 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
08:10:07
97 0
98 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 31 38 04/21
08:00:31
98 0
99 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
08:10:12
99 0
100 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 282 04/21
08:10:14
100 0
101 sleeping DAIWA_USA\admsql SQLDEV2012 . master AWAITING COMMAND 0 8 04/21
08:56:50 Microsoft SQL Server Management Studio 101 0
102 sleeping DAIWA_USA\admsql SQLDEV2012 . master AWAITING COMMAND 31 0 04/21
08:54:57 Microsoft SQL Server Management Studio 102 0
103 sleeping read_user SQLDEV2012 . master AWAITING COMMAND 0 8 04/21
08:57:09 Microsoft SQL Server Management Studio 103 0
104 sleeping read_user SQLDEV2012 . dsa AWAITING COMMAND 0 0 04/21
08:57:09 Microsoft SQL Server Management Studio 104 0
105 sleeping rvanveen DCMA8460 . tempdb AWAITING COMMAND 8875 336 04/21
08:58:54 Microsoft SQL Server Management Studio 105 0
106 sleeping read_user SQLDEV2012 . master AWAITING COMMAND 16 0 04/21
08:57:39 Microsoft SQL Server Management Studio 106 0
107 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:47 Citrix:EnvTest 107 0
108 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 2200 8514 04/21
08:00:31
108 0
109 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:05:56
109 0
110 sleeping rvanveen DCMA8460 . master AWAITING COMMAND 0 0 04/21
08:58:48 Microsoft SQL Server Management Studio 110 0
113 sleeping Citrix_adm CTXDEVSI1 . XenApp6 AWAITING COMMAND 284 777 04/21
08:51:33 Citrix IMA 113 0
119 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:42 Citrix:ConfigurationLoggingData 119 0
120 sleeping AMERICAS\CTXDEVDCSI1$ CTXDEVDCSI1 . CitrixXDFarm1 AWAITING COMMAND 0 0 04/21
08:58:26 Citrix:Storefront 120 0
125 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/16
13:55:16
125 0
126 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 16 0 04/16
11:25:30
126 0
131 sleeping echouliak DCMA10685 . master AWAITING COMMAND 139 8 04/14
15:26:55 Microsoft SQL Server Management Studio 131 0
135 sleeping echouliak DCMA10685 . dsa AWAITING COMMAND 0 0 04/14
15:24:52 Microsoft SQL Server Management Studio - Query 135 0
136 sleeping echouliak DCMA10685 . dsa AWAITING COMMAND 0 0 04/14
15:00:17 Microsoft SQL Server Management Studio - Query 136 0
140 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:05:56
140 0
145 sleeping edit_user INFADEVFS2 . dsa AWAITING COMMAND 0 0 04/21
07:05:56
145 0
Maybe you are looking for
-
Hello all, I am new to ThinApp and working as a consultant to help a company migrate older Windows 2003 software to Windows 2012. They have purchased ThinApp 5.0.4.5 so that is what we will be using. We have created a clean 2003 VM and did a pre-sca
-
Error in applciation server starting up
HI Folks, i am trying to restart application server (ABAP), and it is giving me below error, can someone please help me phu344gb:p16adm 149> pg dev_disp.new trc file: "dev_disp.new", trc level: 1, release: "701" sysno 18 sid P16 systemid
-
Using page items in a report region
Hi all, I am attempting to query a database table using values from two page items. SEARCH_FIELD is the field in which a query constraint is being applied SEARCH_CONDITION is the the query constraint condition being applied So, for example, I tried s
-
Does installing Lion Server mean: No Sleep ?
Hi, I have the problem, that my iMac won`t go to sleep automatically after the time I setup in the energy saver settings. I can get it asleep, if I select Sleep in the Apple menu, but it is only working manually. I already tryed resetting PRAM, NVRAM
-
KODO 3.3.2 RAR installation
Iam trying to install 3.3.2 rar into WSAD 5.1.1 and having issues as its throwing exceptions com.ibm.websphere.management.exception.ConfigServiceException. I could successfully installed earlier versions 3.1.4. Appreciate If anyone can post their fee