Oracle 9i Trigger Problem
In release 1 (9.0.1.1.1) for Windows
creating any trigger such as for example
create or REPLACE TRIGGER BTR_BEFORE_UPDATE BEFORE
UPDATE ON BTS.bts_l_task FOR EACH ROW
begin
:new.btr_last_updated_dttm:=sysdate;
end;
causes the Oracle connection to be dropped.
Is this by design ;-)
I too get the connection droped when replace a trigger. But not when create. WHY????
Thanks
Similar Messages
-
Hi,
I have some trigger problems. I created a trigger to update a certain column each time a new record is inserted or an existent record is updated. I use Oracle 10g. If I create the trigger and execute an insert query via the XE client everything works fine. However, when I use a spring 3.1 setup with Hibernate and OJDBC driver, I get an
java.sql.SQLException: ORA-04098: trigger 'LOCALUSER_PROP_TRIG' is invalid and failed re-validation
And if I execute a show error trigger query I get an invalid SQL query error.
I can easily activate Hibernate debugging and I can see that the prepared statement by Hibernate is just fine, but I was wondering if I could see the full sql sent by the JDBC driver to the server. Maybe seeing the actual query sent to the server would provide new insight of what could be wrong in the Hibernate setup. Does any one what could be wrong and eventually how could setup jdbc to output debug info? Thanks a lot,
CristianWhich platform is the database running on ??
Other things you should check -
when debugging the EJB, JDev
3.1 looks through your IIOP connections to find the one to use.
Make sure that the IIOP connection that JDev is using for the debugging matches the IIOP connection that the EJB client application is using.
raghu
null -
Trigger problem on Sql Server with linked server to Oracle
Hi All,
I have a simple insert trigger on Sql Server 2005, it uses linked server to Oracle.
like that ;
USE [YTM08]
GO
SET QUOTED_IDENTIFIER ON
GO
ANSI_NULLS ON
go
ANSI_WARNINGS ON
CEATE TRIGGER [dbo].[YTM_TBLSTSABIT_I]
ON [dbo].[TBLSTSABIT] FOR INSERT
AS
BEGIN
INSERT INTO YTM_ORACLE..SECTOR.STOCKS
stock_name,
stock_code,
insert_date
SELECT
SBT.STOCKNAME,
SBT.STOCKCODE,
GETDATE()
FROM INSERTED SBT
END
The YTM_ORACLE is a linked server and it's provider is OraOLEDB.Oracle.
Trigger does not works for that linked server but other triggers for local
sql server works fine...
I get this error from sql server
'Heterogeneous queries require the ANSI_NULLS and
ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.'
Does someone know how to solve this issue the right way?
Thanks in advance.
Thanks !
AdamHi Lars,
Thanks for the data. I've already read this note and configure all this parameters. But when I'm executing the Create Source System in the BI system the process dies.
If I look into the logs I see this:
M call semaphore clean-up function ...
M ***LOG Q0E=> DpSigGenHandler, Exception (c06d007e) [dpnttool.c 432]
That's the reason why I start guessing about other possible problem.
Regards -
hi
can any body help me?
i have installed oracle developer 10g with oracle 8i database
when i run any form including the test.fmx
it always ask to install JInitiator although it has been installed (appears in the control panel and in c:\program file\oracle folder)
another problem appears after completing the installtion of JInitiator
the browser views the HTML tags of the form not execute it
so does any body have any idea???From the Windows Start menu, choose Run, type regedit, and click OK.
Expand the registry nodes HKEY_LOCAL_MACHINE > SOFTWARE > ORACLE.
Make a backup copy of this key by right-clicking it and selecting Export from the context menu.
Select one of the HOME nodes beneath the ORACLE node (the one for Developer Suite). Ensure that you have opened the correct node by verifying that the key FORMS90_PATH exists in that node.
From the Registry Editor menu, select Edit > New > String Value. Type in the name FORMS90_HIDE_OBR_PARAMS.
Double-click FORMS90_HIDE_OBR_PARAMS and in the Value data field enter false, then click OK.
Close the registry editor.
Now when you run a form from Forms Builder, it should show parameters, including userid, in the URL, but it should run fine.
15. Set the path for Forms Builder to locate icons:
a) Double-click the UI_ICON key to open it for editing.
b) For the value data, append the path to the .gif file that you will use for the
button icon, which is the \icons subdirectory of your lab directory. Separate this
path from the remainder of the string with a semicolon; for example:
;e:\labs\lab\icons, then click OK. -
Oracle Report Printing problem
Dear All,
i m using below code on button in oracle forms 6i problem is that when i click on button report should be print
on network printer but it's print blank page however network printer is not my default printer when i set default printer
to this network printer its working fine.
and also its working when i set mode=character and network printer is not default printer but when i set mode=default or bitmap and notwork printer is not default then its print blank page.
DECLARE
p_list PARAMLIST;
BEGIN
p_list := get_parameter_list('importdata');
IF NOT Id_Null(p_list) THEN
Destroy_Parameter_List('importdata');
END IF;
p_list := Create_Parameter_List('importdata');
Add_Parameter(p_list,'P_IGM_NO',TEXT_PARAMETER,'10117/11');
Add_Parameter(p_list,'P_INDEX_NO',TEXT_PARAMETER,'498');
Add_Parameter(p_list,'P_CHR_NO',TEXT_PARAMETER,'CL-APL100/011');
Add_Parameter(p_list,'P_CONTAINER_NO',TEXT_PARAMETER,'APHU6305929');
Add_Parameter(p_list,'P_USER',TEXT_PARAMETER,'ALI');
Add_Parameter(p_list,'P_BAL_QTY',TEXT_PARAMETER,0);
Add_Parameter(p_list, 'PARAMFORM', TEXT_PARAMETER, 'NO');
Add_Parameter(p_list,'DESTYPE',TEXT_PARAMETER,'PRINTER');
Add_Parameter(p_list,'DESNAME',TEXT_PARAMETER,'\\192.168.1.67\epson');
RUN_PRODUCT(REPORTS,'\\ORASERV\Atlas6I\Import\System\Reports\abc.rep',
SYNCHRONOUS,
RUNTIME,
FILESYSTEM,
p_list,
NULL);
END;i have made one oracle 6i reports. its is quite wide.when i run the report it shrink into too small font.
and i increse it font size it by pressing + button on menu bar it looks okay.
>
The + button only causes a zoom in on the screen. It is not affecting the actual layout.
>
but the problem is that when i take print out of it ,it's printout comes in its intial format(in small font) evenif i choose different type of paper size or different orientation . it's printout is coming in too small font.
pl tell me how to overcome this problem>
The report rendering engine tries to fit the report page into the physical page size. This results in shrinking of font size,etc.
To fix
a) reduce the content on the report to something reasonable for printing.(Std paper sizes and orientation)
b) change the page size selection. Of course, you will need a printer and paper of the size you set.
Cheers, -
Oracle 10G connection problem
I launch my db with the following script:
su - oracle -c "export ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1 && /u01/app/oracle/product/10.1.0/db_1/bin/dbstart"
su - oracle -c "export ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1 && /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl start"
Here is the output:
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Feb 27 22:17:51 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 778036 bytes
Variable Size 162537676 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
Database "orcl" warm started.
LSNRCTL for Linux: Version 10.1.0.2.0 - Production on 27-FEB-2004 22:17:59
Copyright (c) 1991, 2004, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.1.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.1.0.2.0 - Production
System parameter file is /u01/app/oracle/product/10.1.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.1.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xavan_fi
xe)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 10.1.0.2.0 - Production
Start Date 27-FEB-2004 22:17:59
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.1.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.1.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xavan_fi
xe)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
But when i try to connect with sqlplus:
oracle@xavan_fixe oracle $ sqlplus
SQL*Plus: Release 10.1.0.2.0 - Production on Ven. Févr. 27 22:19:32 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Enter user-name: scott
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directoryWhen you go to get connection you have to set the ORACLE_SID enviroment variable or use the service name in the string to get connection.
Joel Pérez -
Hello all, i have a ' Mutating DB Trigger Problem' for the following Trigger :
=============================================
CREATE OR REPLACE TRIGGER ASSIUT.EMP_ATTENDANCEE_MONA
AFTER INSERT
ON ASSIUT.ACCESSLOG
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
V_COUNT CHAR(2);
--V_COUNT_OUT CHAR(2);
BEGIN
IF :NEW.INOUT = 'IN' THEN
INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT ,TIME_IN ,TIME_OUT)
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 ); -- TIME_OUT
SELECT COUNT(employeeid )
INTO V_COUNT
FROM ACCESSLOG
WHERE employeeid =:NEW.employeeid
AND LOGDATE =:NEW.LOGDATE
AND LOGTIME =:NEW.LOGTIME
AND INOUT ='IN';
IF V_COUNT > 0 THEN
INSERT INTO ATT_INCOMPLETE ( EMP_ID , ATT_DATE , ATT_TIME , ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
1); -- check in
END IF;
ELSIF :NEW.INOUT = 'OUT' 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
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_IN = (SELECT MAX (DATE_IN )
FROM EMP_ATTENDANCEE
WHERE EMP_ID = EMP_ID
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL ) ;
SELECT COUNT(employeeid )
INTO V_COUNT
FROM ACCESSLOG
WHERE employeeid =:NEW.employeeid
AND LOGDATE =:NEW.LOGDATE
AND LOGTIME =:NEW.LOGTIME
AND INOUT ='OUT';
IF V_COUNT > 0 THEN
INSERT INTO ATT_INCOMPLETE ( EMP_ID , ATT_DATE , ATT_TIME , ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
0); -- check in
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN RAISE;
END EMP_ATTENDANCEE_MONA ;The above Trigger generates the following error:
ORA-04091: table ASSIUT.ACCESSLOG is mutating, trigger/function may not see it
ORA-06512: at "ASSIUT.EMP_ATTENDANCEE_MONA'", line 65
ORA-04088: error during execution of trigger 'ASSIUT.EMP_ATTENDANCEE_MONA'i want an easy and a straight forward solution to this problem which occured on selecting or manipulating from the same table i triggered it.
Best regards,
Abdetu..Create a package
CREATE OR REPLACE PACKAGE PK_TRIGGER IS
PROCEDURE PR_BS;
PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE);
PROCEDURE PR_AS;
END;
CREATE OR REPLACE PACKAGE BODY IS
TYPE tData IS RECORD (
vcType TABLE.COLUMN%TYPE,
nEmpid TABLE.COLUMN%TYPE,
vcLogDate TABLE.COLUMN%TYPE,
vcLogTime TABLE.COLUMN%TYPE
TYPE tDataList IS TABLE OF tData INDEX BY BINARY_INTEGER;
lData tData;
PROCEDURE PR_BS IS
BEGIN
lData.DELETE;
END;
PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE) IS
iPos PLS_INTEGER:=lData.COUNT+1;
BEGIN
lData(iPos).vcType:=i_vcType;
lData(iPos).nEmpId:=i_nEmpId;
lData(iPos).vcLogDate:=i_vcLogDate;
lData(iPos).vcLogTime:=i_vcLogTime;
END;
PROCEDURE PR_AS IS
CURSOR crCheck(i_nIdentnum IN NUMBER) IS
SELECT 1
FROM <YOURTABLE> A,
<YOURTABLE> B
WHERE A.IDEN_NUM=B.IDENT_NUM
AND ( A.BEGIN_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
OR A.END_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
iPos PLS_INTEGER;
nDummy NUMBER;
BEGIN
iPos:=lData.FIRST;
LOOP
EXIT WHEN iPos IS NULL;
-- Do whatever you want with the data in the record
-- Process next record
iPos:=lIds.NEXT(iPos);
END LOOP;
lIds.DELETE;
END;
END;replace TABLE.COLUM%TYPE with appropiate table and column
Now create a
- Before Statement trigger on your table calling PK_TRIGGER.PR_BS;
- After Insert on Update for each row Trigger calling PK_TRIGGER.PR_ARIU(...values...);
- After Statement trigger on your table calling PK_TRIGGER.PR_AS;
Hope the code compiles for i have no database at hand.
Andreas -
Can I call host file ( Unix Shell script ) from Oracle 10g trigger
Hi,
I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
thanks & regards
paraguser12009546 wrote:
Hi,
I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
thanks & regards
paragIf you are in 10g, you can simple call shell script from DBMS_SCHEDULER:
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'TEST_SCRIPT',
job_type => 'EXECUTABLE',
job_action => 'PATH_OF_YOUR_SCRIPT',
start_date => SYSDATE,
repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
enabled => TRUE,
comments => 'Shell script from Oracle'
END;
/ -
Post query trigger problem in master detail oracle forms
Hello experts,
I am new in oracle forms n using Fission middleware 10g with oracle forms 11g at windows 7 platform.
I have made a master detail form using a tab canvas.There is a database column STUDENTID and it is in my student tab with a TBL_STUDENTENTRY data block.Now I Have an another tab named previous_education with TBL_STUDENT_PREVIOU_EDU datablock here there is also a database column STUDENTID and corresponding field in my previous_education TAB under TBL_STUDENT_PREVIOU_EDU datablock.Now i want to add a display item to show student name corresponding to STUDENTID.For this I have tried to make a select query in TBL_STUDENT_PREVIOU_EDU data block POPST_QUERY TRIGGER.
begin
select STUDENTNAME into :TBL_STUDENT_PREVIOU_EDU.STD_NM from TBL_STUDENTENTRY where STUDENTID=:TBL_STUDENTENTRY.STUDENTID;
end;
But, This trigger is not fired at runtime,Please suggest me what is going wrong and give me the solution.
Thank You
AADITYA.http://www.club-oracle.com/forums/post_query-problem-in-oracle-forms-t9751/#post23794 , This is the link at where I have tried to show my problem with the help of an image,Please get the link:
thanx
regards Aaditya. -
Migration From SQL Server 2005 to Oracle DB through Oracle SQ Dev Problem
Hi all,
we are trying to do a full Migration from MS SQL Server 2005 to Oracle DB 9.2 i
we are using Oracle SQL Developer V 1.5.3,
the capturing of the DB and the conversion to the oracle model completed succefully
however when we try to generate the scripts from the converted model
the script generation hangs on a sequence and no further progress is made (the script generation pop up keeps still on a certain sequence displaying its name, and thats it )
no error messages are displayed,
how can we know the reason for this? or atleast find a log for whats happening...
any suggestions?
Thank youHi,
migrating a sequence shouldn't make a problem. I did a quick test. I created this table in SQL Server:
create table test_seq (col1 int identity(1,1),col2 char(1))
Then I captured the table, converted the table and generated the script. There was no problem.
CREATE SEQUENCE succeeded.
CREATE TABLE succeeded.
Connected
TRIGGER test_seq_col1_TRG Compiled.
As you see, applying the script was also successful.
I am using Oracle RDBMS 11g, I don't know whether this makes a difference. Do you have any 11g instance available to test it?
Can you show me one of the sequences that are causing the hang? Is the CREATE SEQUENCE statement already in the generated script, or not? Your table is for sure more complex than my simple example.
Regards,
Wolfgang
Edited by: wkobargs on Jan 13, 2009 3:01 AM -
Oracle 10g trigger to pass variable to xmltype.existsnode() function
Hi all,
Could anyone please help me on this? It is kind of urgent.
I created a trigger below, it compiled successfully, but when I tried to insert a xml document into oracle 10g db, I got error message says:
550- Error Response
ORA-00604: error occurred at recursive SQL level 1
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "CONTENTDB.VALIDATE_LINK", line 11
ORA-04088: error during execution of trigger 'CONTENTDB.VALIDATE_LINK'
550 End Error Response
My trigger is:
CREATE OR REPLACE TRIGGER VALIDATE_LINK
BEFORE insert on TABLE_LINK
FOR each row
DECLARE
v_key VARCHAR2(1000);
v_count NUMBER(5);
xmldata XMLType;
begin
xmldata := :new.sys_nc_rowinfo$;
IF xmldata.existsnode('/link/key') = 1 THEN
v_key := xmldata.extract('/link/@key').getStringVal();
select count(*) into v_count from table_link WHERE (existsNode(object_value,'/link[key=v_key]') = 1 )
and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
if (v_count >= 1) then
raise_application_error (-20001, 'TestingFlag can only have one true value.');
end if;
end if;
end;
I have questions regarding above trigger:
1) it seems extract() doesn't work in statement below: v_key := xmldata.extract('/link/@key').getStringVal();
2) can I pass a variable v_key into xmltype.existsnode() function? if yes, what is the right format to do so?
Thanks a lot.
HonsonHi Mark,
Thanks for your comments, I have added checking for xmltype object is not null logic. and my initial problem was fixed, the only last problem I am having now is xmltype.extract().
CREATE OR REPLACE TRIGGER VALIDATE_LINK
BEFORE insert on table_LINK
FOR each row
DECLARE
v_key VARCHAR2(4000);
v_count NUMBER(5);
xmldata XMLType;
v_tmp VARCHAR2(4000);
begin
xmldata := :new.sys_nc_rowinfo$;
if (xmldata is not null) then
IF xmldata.existsnode('/link/key') = 1 THEN
v_key := xmldata.extract('/link/key').getStringVal();
v_tmp := '/link[key=' || v_key || ']';
select count(*) into v_count from cibc_link WHERE (existsNode(object_value,v_tmp) = 1 )
and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
if (v_count >= 1) then
raise_application_error (-20001, 'TestingFlag can only have one true value.');
end if;
end if;
end if;
end;
I am expecting this statement:
v_key := xmldata.extract('/link/key').getStringVal();
return v_key := content.link.viewPrintableVISACreditCard
but now it always returns like this:
v_key := <key>content.link.viewPrintableVISACreditCard</key>
I don't want the xml tag <key></key> returned by extract().getStringVal() function.
Could you or anyone please help?
Thanks.
Honson -
DB Trigger Problem??
Hi ,
I have one problem :
By using database trigger on EMP table I have to update the salary of all the subordinates by 10% if their Manager's Salary is incremented by 5%.
I did it by using a package -that contains PL/SQL Table to store the Manager's Emp No those got increment and their old & new Salary.
Before Update Trigger(Row-Level Trigger) to assign the values in the PL/SQL table. and
After Update(statement Level Trigger)-That reads the manager's empno,old salary & new salary from PL/SQL table and update the EMP table for their Subordinates.
But It gives me the Recursive SQl error.
Pls Help Me ASAP
Regards.
SuneelThere is a good reason for this behaviour. You are trying to automate something that probably shouldn't be automated. Consider:
SELECT * FROM my_emp
ID JOB MGR_FLAG MGR SAL
1 PRESIDENT Y 5000
2 SALESMAN Y 1 2500
3 GRUNT N 2 1400If I issue the following SQL :
UPDATE my_emp
SET sal = sal*1.05
WHERE mgr_flag = 'Y'
/ what should happen? Well, employees 1 and 2 should get a 5% pay rise because they are managers. And employee 3 gets a 10% pay rise, because her manager got 5%. So far so cool. But hang on a moment, employee 2 is managed by employee 1 so, as employee 1 got a 5% pay rise, employee 2 is entitled to a 10% pay rise.
Now, which order do these things get processed in? Because that might make a difference. As it happens, ((2500 * 1.05) * 1.10) = 2887.5 whereas ((2500 * 1.10) * 1.05) = 2887.5. So it doesn't make a difference, in this case.
But Oracle doesn't know that. With a more complicated algorithm e.g.
IF sal < 2700
THEN sal := sal+100;
ELSE sal := sal * 1.05;
END IF;the order the rows are processed in will make a difference. And because it is impossible to forecast beforehand in which order rows will get processed Oracle baulks. It only allows SQL which has predictable results.
Furthermore, the logic is dubious. Is it right for employee 2 to receive two pay rises? Is it right for employee 3 to receive two pay rises as well?
Sure, using AUTONOMOUS TRANSACTION will suppress the error message. But the logic of the design remains flawed. I hope you now understand why this is not a good idea.
Cheers, APC -
I am learning forms with Oracle 9i and have run into a problem.
The following code runs just fine in a Save Button with a WHEN
-BUTTON-PRESSED trigger that inserts a record from a stacked single
record block (does not allow updates or deletes from it).
DECLARE
edit_alert alert;
show boolean := false;
message varchar2(150) := 'You Must Fill the Following Fields:';
choice number;
BEGIN
IF :add_region.region_id IS NULL THEN
show := true;
message := message || CHR(10) || '----- Region Id';
END IF;
IF show = true THEN
edit_alert := Find_Alert('EDIT');
set_alert_property(edit_alert, ALERT_MESSAGE_TEXT, message);
choice := show_alert(edit_alert);
ELSE
insert_record;
commit;
clear_block;
go_block('regions');
END IF;
END;
But when I try to use the following trigger on a Save button which is
almost identical on a table canvas with a multi-line block that allows
queries, updates and deletes...it basically skips the IF....IS NULL
section because the show never turns true and the alert never fires so
it automatically trys to update the record, but fails because of the
null value. It works perfect if the item is not null and gets inserted.
I figure that it has something to do with :regions.region_id within a
multi-line block and the if statement not knowing the current record.
I have searched and searched for a solution with no luck. Can anyone
help?
DECLARE
edit_alert alert;
show boolean := false;
message varchar2(150) := 'You Must Fill the Following Fields:';
choice number;
BEGIN
IF :regions.region_id IS NULL THEN
show := true;
message := message || CHR(10) || '----- Region Id';
END IF;
IF show = true THEN
edit_alert := Find_Alert('EDIT');
set_alert_property(edit_alert, ALERT_MESSAGE_TEXT, message);
choice := show_alert(edit_alert);
ELSE
update_record;
commit;
END IF;
END;
I appreciate any time and help....
MichaelYou say the forms don't work that waySteve said standard forms don't work that way. Your teacher may want to see working programs but (s)he might put more emphasis on your understanding of the forms environment, in which case using standard practices would be best. It's better to be standard in the real world too, although sometimes you really do just have to get something to work before a deadline.
As an example of non-standard practices being bad, consider your idea of having validation/committing in a button. This is Ok as long as the user always presses the button but there are other ways to commit the data, such as closing the form, executing a query or navigating to a new record in a master block. That validation code will not run in those circumstances. Always use a when-validate-* trigger or the property pallette for validation.
Your on-error trigger is also bad. Firstly, do you know why it is firing? Is it because there's a not-null restriction on the region_id item and a null value in the field? If it's firing for any other reason, such as because there is a duplicate record or the database has shut down, then the user will never know because you're overriding standard functionality. If it is firing because of the not-null restriction then a user who does put a value in there will not have their country_id checked at all.
There may be other reasons as well but the on-error trigger is certainly firing because you're calling the update_record procedure in a button. That built-in is only allowed in an on-update trigger (it's annoying that forms will compile with errors like this but that's just the way it is). This will only cause it to fire once, so only the current record will be validated.
Your foreign key integrity check is wrong. You're usingWHERE UPPER(country_id) = UPPER(:locations.country_id);so if I enter FranCe and FRANCE is on the database the program will not see a problem. That's Ok as long as throughout the system you refer to upper(country_id), but this will negate an index on that column so should be avoided. The standard method is to use an LOV and to set the item to 'Validate from List = true' (property pallette). Also, it's very rare to validate an item other than in its own when-validate-item trigger. The exception is paired items such as the start/end of a date range, where one date must precede the other and it's more user-friendly to validate both fields together.
I can't see why the "if...is null" won't work in the WVR trigger, but if you use standard practices throughout the form and that is the only problem then you're much better off than now.
For the path, use "get_form_property(<module_name>,file_name)" and strip off the <module_name>.fmx part. It seems you have a valid reason for not being standard here (using environment variables) so that's Ok ;-). Good luck with the assignment. -
Do anybody know how to use HHTP post within Oracle 9i trigger
What you do is write a stored procedure/trigger in pl/sql that fires an http POST request when a candidate registers. The http POST request can be handled by the server hosting the temp e-mail system. The resulting address is then passed back to Oracle, which then updates the e-mail address table.
Where does one download that interface? (This is the 'Problems with downloads' forum!!)
-
hi,
I am using Oracle 9i Forms on windows 2000 Server.
My Form [32 bit] Builder Version is : 9.0.2.7.0
I am facing a problem using the WHEN-MOUSE-LEAVE Trigger.
I have applied this trigger on an ITEM in a DATA BLOCK but the Trigger is not fired when i leave the item using the mouse.
Can any one guide me, as i may be missing something important.
Thanks.
Samir Farooq.Are you running on the web ? Mouse movement triggers are disabled on web forms as they generate too much network traffic.
Maybe you are looking for
-
Pricing Error - Billing doc. not generated
Hi All, As there was a pricing error in Scheduling agreement the billing document could not be generated. Current Status :- SA(Scheduling agreement) Created. DO(Delivery ) Created PGI done. Stock removed from the system "Shipment Star
-
Extra accouning line item in billing document with zero value
Hi, I am using TAXINN procedure, the following accounting document has been generated during billing.This accounting document contains an extra line item with zero value. However, There is no necessary for this line item with zero value. Can you tell
-
Cannot update or reload third party software
Can someone please help? I have a new imac runnng latest lion OS. I have been using MS office for mac 2011 suite successfully. on attempting to update software using updater, software succesfully downloads but fails to load stopping with a terminal w
-
HTTP_RESP_STATUS_CODE_NOT_OK 401 error
Hi, I am doing sender ABAp proxy and receiver Webservice , Proxy is running sucessfully till yesterday but while executing the ABAp proxy 2day i am getting following error HTTP_RESP_STATUS_CODE_NOT_OK 401 error HTTP response contains status code
-
How to get older Facebook version?
HI. So I was updating pinterest but it needed my moms apple ID and I didn't have it because I used hers when I first got my iPad, so I deleted it and was gonna get it again and I deleted my Facebook too because it also used her apple ID, so when I we