Create Trigger That Can Control Startdate And EndDate?
Apr 30, 2013
create table TestDate(
idDate int not null primary key,
StartDate date not null,
EndDate date not null
)
I want to create a trigger that can control the Startdate and the EndDate when inserting data,the Endate must be less than the StartDate
View 1 Replies
ADVERTISEMENT
Dec 12, 2012
i have to get holidays count including sturday and sunday using HOLIDAYDATEMASTER if between stardate and enddate having any leave below is my procedure if run this procedure
startdate:12/21/2012 -- mm/dd/yyyy endate:12/26/2012 iam getting result=2 only actual not
included 25 holidaydate(22 sat ,23 sun)
CREATE TABLE HOLIDAYDATEMASTER(HOLIDAYDATEID NUMBER not null,HOLIDAYNAME VARCHAR2(100),
HOLIDAYDATE DATE,HOLIDAYYEAR NUMBER(10));
insert into HOLIDAYDATEMASTER (HOLIDAYDATEID, HOLIDAYNAME, TO_CHAR(HOLIDAYDATE,'DD-MON-YY, HOLIDAYDATE, HOLIDAYYEAR)
values (461, 'Christmas Day', '25-DEC-2012', to_date('25-12-2012', 'dd-mm-yyyy'), 2012);
CREATE OR REPLACE PROCEDURE p_Holiday_DAYS
(V_START_DATE IN DATE, V_END_DATE IN DATE,OC_DUR OUT NUMBER)
IS
[Code]....
View 5 Replies
View Related
Jul 13, 2010
I have table as below :-
Table ABC(
ID Number,
startDate date,
City varchar2(10)
)
I need to write query which will get me all the CityNames for which there are no Startdate differs,
i.e. To get all the city name records for which all of the Startdate are same across all the records.
I dont want to go after Self Join due to performance issues, do we have any better way?
View 2 Replies
View Related
Apr 8, 2012
By mistakenly Oradata file has been deleted and there is I have not any backup when we Startup the database then we get an Error as
ORA-00205: error in identifying control file, check alert log for more info
Now I want to create controlfile as
Microsoft Windows [Version 6.1.7600]
Copyright © 2009 Microsoft Corporation. All rights reserved.
C:\Users\SARASWATIMAA>SQLPLUS
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Apr 8 23:15:09 2012
Copyright © 1982, 2005, Oracle. All rights reserved.
Enter user-name: SYS AS SYSDBA
Enter password:
[code]...
where is My Mistake in Creating Cotrolfile..I want to know that in which condition we use "SET" or "REUSE" in Create Controlfile.
View 3 Replies
View Related
Aug 8, 2012
I am trying to create access control list, but it gives me following error.
SQL> begin
2 dbms_network_acl_admin.create_acl (
3 acl => 'Test_utl_mail.xml',
4 description => 'Allow mail to be sent',
5 principal => 'TEST',
6 is_grant => TRUE,
7 privilege => 'connect'
8 );
9 end;
10 /
dbms_network_acl_admin.create_acl (
*
ERROR at line 2:
ORA-06550: line 2, column 3:
PLS-00201: identifier 'DBMS_NETWORK_ACL_ADMIN.CREATE_ACL' must be declared
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
View 14 Replies
View Related
Jul 12, 2012
I am trying to create a new controlfile. I used "alter database backup controlfile to trace;" and then I copied and pasted the contents of the trace file into the .sql file. My sql script is
CREATE CONTROLFILE SET DATABASE "FIVESTAR" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
[code]....
Actually, the name of my database was 'STAR' and I changed it to "FIVESTAR" int this .sql script. Now when I run this script with SQL> @ <path of my sql script>, it gives me the following errors:
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01504: database name 'FIVESTAR' does not match parameter db_name 'STAR'
View 2 Replies
View Related
Jun 3, 2010
I am not able to create control file from scrip . it showing following error
ORA-01081: cannot start already-running ORACLE - shut it down first
CHARACTER SET WE8ISO8859P1
*
ERROR at line 19:
ORA-02236: invalid file name
View 4 Replies
View Related
Mar 8, 2011
I tried a lot to load data to table from excel(.csv) using sql*loader the oracle version of sql*loader doesn't support the control file created using notepad(.ctl).Though i given a filename with extension as .ctl it seems as a .txt file. Is there any alternate way to create it?
View 3 Replies
View Related
Oct 22, 2013
I want to create binary copy of control file every time I do backup. I am using sql "alter database backup controlfile to ''+FRADG/TESTDB/controlfile/controlfile.ctl'' "; in my rman backup script. If I run it second time I got errors as it does does not allow to overwrite existing one.
View 5 Replies
View Related
Dec 21, 2011
how to create control file and how to load the data through command window in our database using sql * loader.i am having structure in my database and .csv file in my desktop.
View 20 Replies
View Related
Jul 4, 2012
What is difference when you issue a create controlfile with "standby" keyword on the primary database
ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/path/db_stby.ctl';
vs. creating a control using
ALTER DATABASE BACKUP CONTROLFILE to '/path/db_control.ctl';
what does ORACLE put into the standby control that is "extra"? ie. what is the difference between a standby control file and a normal control file?
View 7 Replies
View Related
Jul 24, 2010
I have a multi record control block (basically a text item displaying 6 records) where user enters values and I want to process the values using pre-insert trigger.
I want to read value in each record and then do some tasks using a pre-insert trigger before I commit the values. To navigate between the records I was using first_record, next_record, clear_record built-ins but it gives errors like "40737-illegalrestricted procedure next_record in pre-insert trigger".
View 3 Replies
View Related
Jan 28, 2013
how to create the trigger that count the last 7 day about from sale table if the last 7 day amount is greater then 10000 then update the commission 2% other wise do nothing
View 19 Replies
View Related
May 9, 2013
I cant create a trigger for the following problem "write a trigger to change the "hiredate"(in emp tale) in the default format even if the user enters it in some other format, say year/mon/date..."
View 7 Replies
View Related
Aug 13, 2010
Create a trigger that stamps the date_created and the date_updated column with current date on new and updated records?
View 2 Replies
View Related
Apr 16, 2010
How do I create a trigger for the age. I want an alert to appear when the date of birth field is less than the age of 17. The formula is age=sysdate-dateofbirth
View 11 Replies
View Related
Apr 12, 2013
i would like to create a sequence inside a dml trigger. Is it possible? I created a trigger and it is compiled sucessfully.
create or replace trigger tri_update_test
after delete on test
declare
pragma autonomous_transaction;
[code]...
trigger created sucessfully.And i try to delete data from the test
delete from test where id=5;
Output:
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SCOTT.TRI_UPDATE_TEST", line 4
ORA-04088: error during execution of trigger 'SCOTT.TRI_UPDATE_TEST'
View 4 Replies
View Related
May 11, 2010
I'm trying to create a trigger and procedure to go along with my DDL. Everything is created just fine, but when I try to execute an update on the table monitored by the trigger I get the following error:
update housing set group_num = 1 where room_num = 10
ERROR at line 1:
ORA-00937: not a single-group group function
ORA-06512: at "YANKEEFAN146.VIOLATION_CHK", line 6
ORA-04088: error during execution of trigger 'YANKEEFAN146.VIOLATION_CHK'
/* DDL */
create table violation_type
(violation_num number(1) primary key,
violation_def varchar2(100) not null)
organization index
tablespace mi257_data;
[code]....
View 9 Replies
View Related
Jun 20, 2012
I'm looking to create an after logon trigger... my question is - can this trigger be created by any user (i.e. other than sys) and - if so - what's required to ensure it fires for EVERY other user that log's on to the database?
View 2 Replies
View Related
Feb 1, 2013
Is it possible to create table using trigger?
I tried but failed...
CREATE OR REPLACE TRIGGER tri1
AFTER UPDATE
ON dept
FOR EACH ROW
declare
pragma AUTONOMOUS_TRANSACTION;
BEGIN
execute immediate 'create table dept_dum as select * from dept';
END;
/
SQL> update dept set deptno=23 where deptno=10;
update dept set deptno=23 where deptno=10
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SCOTT.TRI1", line 6
ORA-04088: error during execution of trigger 'SCOTT.TRI1'
I am running this as scott user
My requirement is to
create table as select * from table_name where flag=1
This has to be done parallel for all the tables for which this flag is enabled and by that trigger delete all those rows which were backed up as table.
View 4 Replies
View Related
Nov 28, 2011
We have an application is must be connected to our database for specific requirements in our company but this application has a very bug thing as we must write the super DB password "Like HR password as example" clear in some files and these files must be shared so developers can use the HR password to do any action !!! I know that this application is a problem but we have to install
I can do this by creating trigger on each table will restrict DML. As example: if the operating system user is XXX, the trigger restrict the action. But not logic at all to create more than 1000 triggers on schema (This will impact badly on DB performance).
So, i need to create one trigger to fire before doing any DML on all schema tables. As example: If "MMM" the administrator operating system user trying to do insert action, he can do the action. BUT If "DEV" the developer operating system user trying to do insert action, the trigger must fire here to restrict this action.
Be noted also, i need this trigger not depend on any specific tool like Toad as any user can simply rename the exe file for toad then he can pass the trigger. At least, trigger must depend on (Operating system user & Action_type)
View 11 Replies
View Related
Aug 16, 2013
i want to give privilege of create trigger,procedures and functions privileges to a user "A"on the schema "B". how can i do it. i've already given select,insert,update,delete privilege to user "A"
how can user "A" create trigger(etc.) on tables of user "B".
View 1 Replies
View Related
Oct 14, 2010
I Created a form just for testing purpose [Which is i attached]
My Table is TEST0
Structure of table :
---------------------------
NOVARCHAR2(5)
NAME VARCHAR2(10)
FLG VARCHAR2(1)
My Task is When i added a record, e.g if on form, i add name - AAD But its must save on TEST0 Table like this way EMPAAD...means always concate with 'EMP'||:Block.name while saving on database..
I know how to do with front end application, but i want to achieve this task by using trigger on backend databse...how to create a Trigger on backend....i try a one trigger but it give me error- Unable to insert Record...
View 12 Replies
View Related
Jun 12, 2013
I have make a new trigger.Create a trigger that inserting a new job_id MAX_SALARY assigned as the employee's salary more than 80 departmental charges
I have that code, is that correct?
CREATE OR REPLACE
TRIGGER TR27
AFTER INSERT ON JOBS FOR EACH ROW
BEGIN
(SELECT MAX(SALARY) FROM EMPLOYEES WHERE DEPARMENT_ID=80);
:NEW.MAX_SALARY := :OLD.MAX_SALARY;
END;
What I need to complete it?
View 2 Replies
View Related
May 25, 2011
I have following schemas in my database scott,sh,hr...I created a triger on a schema scott with the following method
1. sqlplus / as sysdba
2. CREATE TABLE LOGIN_AUDIT_INFO_ALL (
operation VARCHAR2(30),
obj_owner VARCHAR2(30),
object_name VARCHAR2(30),
sql_text VARCHAR2(64),
attempt_by VARCHAR2(30),
attempt_dt DATE);
3.CREATE OR REPLACE TRIGGER login_audit_prod_schemas
AFTER CREATE OR ALTER OR DROP
ON SCOTT.SCHEMA
[code]....
But it don't fulfill my requirement. trigger is fired when scott perform any action. but my requirment is that trigger should be fired when create action is performed on scott by hr,sh or scott. i also want a single trigger which fulfill the requirement.
View 8 Replies
View Related
Apr 28, 2011
i would like to trace some connexions on database, once compile the code , i have the issus following:
10/2 PL/SQL: SQL Statement ignored
11/20 PL/SQL: ORA-00942: table or view does not exist
this is the
DROP TABLE connect_user;
CREATE TABLE connect_user
(
nom_ora varchar2(15),
naom_os varchar2(15),
programme varchar2(20),
poste varchar2(20),
[code]...
View 3 Replies
View Related
Apr 16, 2013
i have created a trigger on a table after update. i am using if condition if the condition is true i am passing a value and then inserting into audit table.
if(condtion)
L_change_type='value'
end if;
if(condtion)
L_change_type='value'
end if;
if(condtion)
L_change_type='value'
end if;
if(condtion)
L_change_type='value'
end if;
Then i am inserting
Insert into audit_table(change_type.....)
values(..L_change_type)...)
If i want to skip the insert statement for particular condition wt i have to do.
View 7 Replies
View Related
Dec 3, 2010
I have created a procedure to build trigger dynamically using Dynamic SQL. Here procedure created successfully, when we execute the procedure to build trigger getting the following error.
Note: We are able to create a Trigger, but it is INVALID. if we get the code of a trigger and execute, trigger created a successfully with Valid Status.
ERROR:
ORA-24344: success with compilation error
ORA-06512: at "APPS.CREATE_TRIGGER", line 28
ORA-06512: at line 2
SQL*Plus internal error state 2087, context 47:0:0
Unsafe to proceed
View 2 Replies
View Related
Dec 30, 2010
table
CREATE TABLE "TEST"
("CONTRACT_REF_NO" VARCHAR2(20 BYTE) primary key,
"CHG_GL" VARCHAR2(9 BYTE),
"CHG_GL_1" VARCHAR2(9 BYTE),
"CHG_GL_2" VARCHAR2(9 BYTE),
[code]...
10 rows selected.
create or replace view test_view
as
select 1 id,CONTRACT_REF_NO,chg_gl
from test
union all
[code]...
11 rows selected.
I have done only for one id.
so the problem is the front end is showing this test_view that people will modify.but they have to actually modify the table ,so I can think of an instead of trigger(instead of insert and instead of update ones).
View 16 Replies
View Related
May 10, 2013
Im trying to create a trigger to prevent transactions like insert, update and delete based on two conditions:
1) Friday
2) Between 5pm to 8am
View 5 Replies
View Related