Trigger - Delete Account Through A Java Interface Using JDBC - Get Error?
Dec 10, 2012
Here are the relevant tables to the triggers I'm having trouble with.
create table profile
(
userID number(10),
uname varchar2(64),
email varchar2(32),
password varchar2(32),
date_of_birth date,
[code]...
Here's the triggers I currently have that doesn't work.
create or replace trigger DropAccount
after delete on profile
FOR EACH ROW
BEGIN
delete from groupMembership where (userID = :old.userID);
END;
The DropAccount trigger's purpose is to delete all the records from groupMembership that contains the userID of the person deleting his/her own account. It appears to work when I run the following statements in sqlplus:
delete from profile where (userID = '1');
select * from groupMembership where (userID = '1');
But when I try to delete an account through a java interface using JDBC I get the following error:
Machine Error: java.sql.SQLException: ORA-04091: table *****.GROUPMEMBERSHIP is mutating, trigger/function may not see it
ORA-06512: at "*****.DROPACCOUNT", line 2
ORA-04088: error during execution of trigger '*****.DROPACCOUNT'
The java function basically just executes a delete statement.
View 1 Replies
ADVERTISEMENT
Aug 17, 2012
In the below code, the application is crashing @ free(svcname). should we delete the out variable or not?
{
char* svcname;
if (OCIAttrGet(eventhp, (ub4) OCI_HTYPE_EVENT, (dvoid *) &svcname, (ub4 *) &sizep, OCI_ATTR_SERVICENAME, dm_infop->errhp) != OCI_SUCCESS) {
pinlog(PIN_FILE_SOURCE_ID, __LINE__, LOG_FLAG_ERROR, " Unable to get service name.
");
return;
}
free(svcname);
}
View 1 Replies
View Related
Nov 23, 2008
I gave this a shot on my own, and failed, so I am putting the question to you:
I am looking to create a trigger on the "Account" table
CREATE TABLE Account(Acct_no number, BillAmt number, OpenDate Date, SSN number,
Primary Key (Acct_no),
Foreign Key(SSN) references ResponsibleParty(SSN));
which will update the BillAmt field whenever one of the account's respective records is inserted/updated/deleted from the following tables:
CREATE TABLE Plan(Plan_id number, Cost number, Minutes number,
primary key(Plan_id));
CREATE TABLE Feature(Feature_id number, Description varchar(20), Cost number,
primary key(Feature_id));
These tables are linked through the following table:
CREATE TABLE Phone_Line(MTN number, cStart Date, cEnd Date,
rDate Date, Status char, ESN number, Acct_no number, Plan_id number,
primary key(MTN),
foreign key(ESN) references Equiptment(ESN), foreign key( Acct_no) references Account(Acct_no),
foreign key(Plan_id) references Plan(Plan_id));
View 26 Replies
View Related
May 23, 2012
I would like to add another filed into the Employee Self Service page (OAF) Expense claim portion.Basically the field would require to grab an existing GL account code based on the element link setup from expense element.
The main point to add this additional field is to capture the expenses type and displaying its GL account code based on element link account code setup.
View 1 Replies
View Related
Jun 27, 2013
java.sql.SQLException: ORA-04054: database link GMAIL.COM does not exist
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1615)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1580)
at com.jdbc.pack.Lab1.main(Lab1.java:31)
View 7 Replies
View Related
Aug 21, 2013
I am not able to connect to ORACLE ODA 11g. but using sqlplus its getting connected with below credential.
URL------------------- jdbc:oracle:thin:sacblmdbuser/sacblmdbuser@10.66.12.229:1521:OVPINHA
Oracle JDBC driver loaded ok.
Unable to create connection
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647296)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
View 2 Replies
View Related
Oct 3, 2012
we have a prod application which use oracle database 11g as backend and .NET technology as front end . There is a user TESTUSER in database.
Issue is that we can login in to the application, but when we try to login in database through toad or Db visualizer then it gives an error of 'user account locked'.
View 5 Replies
View Related
Sep 15, 2012
I am getting Oracle odbc ora-28000 account locked error
View 1 Replies
View Related
Jul 11, 2013
I am using OCI and instant_client (11.2.0.3.0) in my C++ program (on Windows 7) to connect remotely to 11G database. While doing a connection using server name as well as servername:port/service_name as connection strings, I am getting error of ORA-12504 TNS:listener was not given the SERVICE_NAME in CONNECT_DATA. According to instant client FAQ & white paper at [URL]..., no tnsnames.ora is required for instant client. Then why could I be getting this error? I ensured that only the instant client directory is in Path environment variable. There was a ODBC driver installed on this same host.
View 3 Replies
View Related
Jun 5, 2013
In event of sys account locked and system account is already deleted also no other user is having dba privilege, how to unlock the sys user??
View 5 Replies
View Related
Jul 11, 2012
I'm trying to compile an hello world example on my computer. I've read the documentation for requirements occi on the site
[URL]....
It says that the g++ compiler 3.4.6 or later is supported. I have:
Ubuntu 12.04
gcc 4.6.3
oracle instant client 11.2
g++ main.cpp -c -I/home/tim/skrivbord/bin/oracle/instantclient_11_2/include/ -D_REENTRANT -g -Wall
g++ -o pippo -L/home/tim/skrivbord/bin/oracle/instantclient_11_2/ -locci -lclntsh -lociei -lnnz11 main.o
main.o: In function `main':
/home/tim/skrivbord/dev/cpp/main.cpp:21: undefined reference to
[code]....
View 1 Replies
View Related
Jun 11, 2013
Well I need to make a trigger that don't allow delete departments in the next 3 month.
I dont know how to start it :/
View 23 Replies
View Related
May 24, 2012
the following case is successfully done with mssql databases.
Case:
Table UserGroup
Columns id, name, handshake
When the handshake is set to 'd', this record should be deleted. I know it is bad behaviour by design.
What have I done so far:
- created an after update trigger (mutual error) Caused by trying a delete action in the update action, not possible.
- created a view in combination of instead of update trigger.
This causes also mutual error, or if ignored (PRAGMA AUTONOMOUS_TRANSACTION), an deadlock.
Code so far:
create or replace procedure Delete_UserGroup_sp(p_groupId in USER_GROUP.HMIUSERGROUPID%TYPE, p_handshake in USER_GROUP.HANDSHAKE%TYPE)
is
begin
if p_handshake = 'd' then
delete USER_GROUP WHERE HMIUSERGROUPID = p_groupId;
commit;
end if;
end;
create or replace view USERGROUP_V as select * from USER_GROUP
create or replace trigger USER_GROUP_T1
instead of update on USERGROUP_V
for each row
declare
PRAGMA AUTONOMOUS_TRANSACTION;
begin
Delete_UserGroup_sp(:new.HMIUSERGROUPID, :new.HANDSHAKE);
end;
View 5 Replies
View Related
Feb 6, 2009
I am trying to write a trigger that will do an insert/delete/update into a audit table when a change has occurred on the primary table. The change will be recorded in the audit table by a incemental sequence number and the updated data.
there will be an extra column in the audit table
how to get a simplified version of this trigger.
the primary table will look like so
Id_num varchar (20)
code Integer
desc varchar(20)
sequence_num Integer
audit table
Id_num varchar(20)
code Integer
desc varchar(20)
timestamp date
sequence_num Integer
View 6 Replies
View Related
Jul 27, 2008
I'm trying to simulate a delete operation through using an update on a trigger my tables are
CREATE TABLE EMPLOYEE (
LNAME VARCHAR(15) NOT NULL,
SSN CHAR(9) NOT NULL,
salary FLOAT,
dno INT NOT NULL,
vst DATE,
vet DATE,
PRIMARY KEY (Ssn));
[code]....
What I want to do is whenever there is an update on vet( valid end time) in employee, delete the values from the employee table and insert the old values from employee into the emp_history table along with the new value for vet. Here's my trigger
CREATE TRIGGER trig4
AFTER UPDATE OF VET ON EMPLOYEE
FOR EACH ROW
BEGIN
INSERT INTO EMP_HIST VALUES( : old.LNAME, : old.SSN, : old.salary, : old.dno, : old.vst, :new.vet);
DELETE FROM EMPLOYEE WHERE(SSN = :NEW.ssn AND vet IS NOT NULL);
END trig4;
//ignore the space between : and o as it makes a smily
The problem is I get an error for a mutating change, what I'd like to know is if the above trigger is possible, and if so how to implement it without giving me an error. I mean it makes sense syntactically and logically(at least to me).
View 1 Replies
View Related
May 4, 2010
How can I delete a record by writing code in when_button_pressed trigger.
View 8 Replies
View Related
Aug 30, 2012
i have one table ot_ins_item where user will enter the details of item, grade,item qty , later on user will go and update the same table the details of different grades received for the same item in different columns with qty breakup in 3 different fields it_qty_01 , it_qty_02,it_qty_03 respectively with different grades , what i need is i want is whenever he updates this table with different grades based on data entered in 3 different fields , a procedure or trigger should delete the initial record saved and insert three different rows based on newly updated values , it may be 3 or it may be 2 sometime depending upon input values that many records should be inserted same time controlling the qty's entered in breakup not exceeding the main qty.
CREATE TABLE ot_ins_item (it_ins_no NUMBER,it_no NUMBER,it_grade VARCHAR2(12),
it_code VARCHAR2(12),it_qty NUMBER,it_flex_01 VARCHAR2(12),
it_01_qty NUMBER,it_flex_02 VARCHAR2(12),it_02_qty NUMBER,it_flex_03 VARCHAR2(12),
it_03_qty NUMBER);
create sequence s_it_no start with 1 ;
INSERT INTO OT_INS_ITEM VALUES (1,s_it_no.NEXTVAL,'A','ITEM1',NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO OT_INS_ITEM VALUES (1,s_it_no.NEXTVAL,'B','1TEM2',NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO OT_INS_ITEM VALUES (1,s_it_no.nextval,'C','ITEM3',NULL,NULL,NULL,NULL,NULL,NULL);
SELECT * FROM OT_INS_ITEM;
[code]....
View 5 Replies
View Related
Sep 6, 2010
I'm attempting to write some SQL to delete a record where it doesn't exist in one of three other tables. My SQL is below:
SELECT COUNT(*) FROM GAZETTEER_ADDRESSES
WHERE NOT EXISTS (
SELECT MEDICALS.*, REVIEWS.*, ADDRESS_HISTORIES.*
FROM MEDICALS INNER JOIN REVIEWS
ON MEDICALS.GADDRE_IDENTIFIER = REVIEWS.GADDRE_IDENTIFIER
JOIN ADDRESS_HISTORIES
ON REVIEWS.GADDRE_IDENTIFIER = ADDRESS_HISTORIES.GADDRE_IDENTIFIER
WHERE GAZETTEER_ADDRESSES.IDENTIFIER = MEDICALS.GADDRE_IDENTIFIER);
When I attempt to run this I receive the following error: ORA-00600: internal error code, arguments: [qcopcovm2], [0], [], [], [], [], [], []
I know it's not generally a good idea to delete records but in this case a large number of cases are incorrect and need to be reinserted and this is the quickest way of doing it.
View 2 Replies
View Related
Feb 19, 2012
Declare
Cursor Cur_Emp Is
Select Empno,Ename
From Emp;
Type Type_Emp Is Table Of Cur_Emp%Rowtype Index By Binary_Integer;
[code].......
View 4 Replies
View Related
Mar 23, 2005
I got an error while trying to install Oracle 9i on a Win XP machine. So, I decided to wipe out Oracle completely and starting again. I deleted all the Oracle entries from the registry and then tried deleting the folder. But while doing that, I am getting the following error - "Cannot delete oci:Access denied"
The disk is neither write-protected nor is the oci.dll file in use.
View 18 Replies
View Related
Mar 30, 2012
This error keeps on comming in my welogic forms server window many often....can any one tell me why it is so ?
<Error> <oracle.forms.servlet> <FRM-91230> <fatal
error in runtime process: timeout on connection to Java client>
View 2 Replies
View Related
Apr 18, 2010
I have two different java process trying to insert in the same time in the same table for the same trade. The structure of the table Report is
create table report
( TRADE_ID NUMBER,
VERSION NUMBER,
MESSAGE_TIME TIMESTAMP)
There is a unique key on (TRADE_ID and VERSION) So if a new trade_id is inserted, the version is set to 1 and the second becomes 2 and so on. The version is calculated as last version of the trade_id ie. version + 1. It was woking fine till a new Java process was build that fired inserts through ten different java instances at the same time resulting in unique key error. So in detail what is hapenning is if three records of trade_id's comes in at the same time it should allocate versions in a first come first serve basis and there should be three versions of trade id 1,2 and 3. Now due to the multiple instances they all seems to get fired at once and all ending up with version one and thus resulting in unique key constrain error while trying to insert into the table.
View 3 Replies
View Related
Jul 17, 2013
I am trying to install the 11GR2 on HPUX 11.31 U ia64 with silent option.while tried to launch runinstaller, I hit the below issue.
dfltest> ./runInstaller -ignoreSysPrereqs -force -silent -responseFile > /db/dfltest/oracle/product/11.2.0/database/db_install.rsp.mainStarting Oracle Universal Installer... Checking Temp space: must be greater than 240 MB. Actual 475 MB PassedChecking swap space: must be greater than 150 MB. Actual 23189 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2013-07-17_12-01-18PM. Please wait ...oradev1 oradflts /db/dfltest/oracle/product/11.2.0/databasedfltest> Error: could not find libjava.soError: could not find Java 2 Runtime Environment. ----extracted from following files -----p10404530_112030_HP64_2of6.zipp10404530_112030_HP64_1of6.zip
View 15 Replies
View Related
Mar 13, 2012
I'm working on a Java Web Application
(User input(jsp)<-->Controller<----->DAO<----->Database) project where the user submits certain fields (partyId, DocId, cbrxPath, cbrValue, nodeId, TRANSLATION_Class and so on)and they are saved in 3 different tables (Party_Document_Node table, Routing and Routing_Node table).
Here's the portion of the DAO code below where the problem is:
public class AssociationsDAOOracleImpl implements AssociationsDAO {
private static final String PARTIES_WITH_ASSOCIATIONS = " Select distinct(party_id) from PARTY_DOCUMENT ORDER BY 1";
private static final String ASSOCIATION_FETCH_QUERY = " Select PARTY_ID, DOCUMENT_ID, NODE_ID, APPLICATION_CONTEXT_XPATH, DOCUMENT_LOGGING FROM PARTY_DOCUMENT_NODE WHERE PARTY_ID = ? ORDER BY PARTY_ID ";
private static final String ROUTING_FETCH_QUERY = " Select CONTENT_ROUTING_PATH FROM ROUTING WHERE PARTY_ID = ? AND DOCUMENT_ID =? ORDER BY PARTY_ID ";
private static final String ROUTINGNODE_FETCH_QUERY = " Select CONTENT_ROUTING_VALUE, TRANSLATION_CLASS FROM ROUTING_NODE WHERE PARTY_ID = ? AND DOCUMENT_ID =? AND NODE_ID =? ORDER BY PARTY_ID ";
private static final String CONTEXT_FETCH_QUERY = " Select CONTEXT_VALUE, CONTEXT_INSTANCE, CONTEXT_KEY FROM APPLICATION_CONTEXT where party_id = ? and document_id = ? and node_id = ? ";
private static final String NODEID_FETCH_QUERY = " Select NODE_ID FROM PARTY_DOCUMENT_NODE WHERE PARTY_ID = ? AND DOCUMENT_ID =? AND NODE_ID =? ORDER BY PARTY_ID ";
[code]....
View 1 Replies
View Related
Apr 18, 2006
On a Windows 2003 64 bits server I have installed Oracle Application Server 10gR2 10.1.2.0.2 (Infrastructure + Business Intelligence and Forms option). I also upgraded to Portal 10.1.4. All components are up and running.
I wanted to test if Forms services are functional using the test form provided by OAS at installation (test.fmb/.fmx).
Steps executed:
1) Start -> Programs ->Oracle Application Server 10g -> Forms Services -> Run a form on the web for form=test.fmx
or in the IE browser:
2) [URL]
The applet is not starting and I receive the following error:
java.lang.ClassNotFoundException: oracle.forms.engine.Main
What does this mean? What should I do to make it work?
View 11 Replies
View Related
Dec 23, 2009
I am connecting to Oracle 9i using JDBC in my JSP/Servlets web pages. I am closing all my connections in Finally blocks.
Everything works great during the day with JDBC and Oracle.But after a Web crawler runs through our web server at 3 AM the next morning a v$session check shows several lines of JDBC Thin Client inactive status. find exactly what sql statement or program that could be causing the JDBC Thin Client to show up?
View 1 Replies
View Related
Feb 23, 2011
I have 2 tables used in this problem: ODETAILS and ORDERS.
ODETAILS has the following columns: ONO, PNO, QTY, COST
ORDERS has the following columns: ONO, CNO, ENO, RECEIVED, SHIPPED, ORDER_COST
UPDATE ORDERS
SET ORDER_COST= 1 * ( select SUM(
SELECT COST
FROM ODETAILS
WHERE ORDERS.PNO=ODETAILS.PNO
)
);
In ODETAILS there can be more than 1 row for 1 order. So I'm trying to add all the COSTs in ODETAILS.
View 3 Replies
View Related
Jun 30, 2011
my java program i am executing a pl/sql function using callable statement i checked everything in the function and the function is created without compilation errors in sql*plus environment, and i gave all DBA permissions to the user, but i got the error like below
java.sql.SQLException: ORA-06550: line 1, column 28: PLS-00201: identifier 'NAME' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored
and i wrote the function like below for the below table
create table student(regno number(6),name varchar2(15),dob date,phone number(10),
address varchar2(30),cat varchar2(2),password varchar2(12),hallno number(6),
fee_paid varchar2(3),constraint student_pk primary key(regno))
create table fee(regno number(6), branch varchar2(15),amount number(4), ddno number(12), fee_paid varchar2(3),
dddate date, dd_received_date date default sysdate, constraint fee_pk primary key(regno))
[code]...
and the java program is like below
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection=DriverManager.getConnection(dbURL,dbUserName,dbPassword);
CallableStatement st=connection.prepareCall("{?=call
[code]...
View 5 Replies
View Related
Jul 20, 2011
I just create a trigger to fire whenever the quantity on hand for a books table has been updated.when the quantity on hand become zero ,it should call 'insert_reorder' procedure and pass the ISBN for the books. This is my code
CREATE OR REPLACE TRIGGER books_qty_on_hand_trg
AFTER UPDATE OF on_hand_quantity ON books
FOR EACH ROW
BEGIN
IF :NEW.on_hand_quantity = 0 THEN
insert_reorde_pp (:NEW.isbn)
END IF;
END;
But i m getting this error
LINE/COL ERROR
4/3 PLS-00103: Encountered the symbol "END" when expecting one of the following: := . ( % ; The symbol ";" was substituted for "EN D" to continue.
View 5 Replies
View Related
Jan 11, 2005
I'm trying to connect to multiple Oracle 10g databases (failover) over the JDBC thin client, and when I run the following, I get: java.sql. SQLException: Io exception: NL Exception was generated
connection = DriverManager.getConnection("jdbc:oracle:thin:@DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = dbdev) (PORT = 1521))) (CONNECT_DATA = (INSTANCE_NAME = orcldev)))", "scott", "tiger");
I eventually want to put multiple ADDRESSes in that string, but right now I'm trying to get it to work with just one! I've tried multiple variations of this, like changing INSTANCE_NAME to SID or SERVICE_NAME, and using the internal IP address for the HOST dbdev (see below). Here's the tnsnames.ora file used by SQL*Plus on the same client machine:
ORCLDEV.world =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))
(CONNECT_DATA =
(SID = orcldev)
)
)
View 7 Replies
View Related