Unable to called out a trigger properly via my java program
hi all
i got this error msg "java.sql.SQLException: ORA-06550: line 1, column 7. PLS-00221: 'PARTIAL_FILLED_TRIGGER' is not a procedure or is undefined."
Pls help~! btw i've written a trigger and not a procedure with the java program.
I've written in the 1st line of the trigger as
"CREATE OR REPLACE TRIGGER"ITRADESYS"."PARTIAL_FILLED_TRIGGER"
".
Why did it identify it as a procedure? I have compile this trigger on oracle Enterprise Manager Console as well as on the SQL*PLUS and it compiled perfectly fine!
This is how i called the trigger in my java program:
privatestatic String SQL_RUN_SP =
"{call PARTIAL_FILLED_TRIGGER(?)}";
and
csPartialFillSp = conn.prepareCall(SQL_RUN_SP);
csPartialFillSp.setString(1,xchgID);
eventlog.writeln(SQL_RUN_SP+", xchg_id=["+xchgID+"]");
psPartialFillAlert = conn.prepareStatement(SQL_TRADE_ALERT);
eventlog.writeln(SQL_TRADE_ALERT);
psPartialFillUpdate = conn.prepareStatement(SQL_UPDATE_TRADE_ALERTED);
eventlog.writeln(SQL_UPDATE_TRADE_ALERTED);
psPartialFillUserDetails = udConn.prepareStatement(SQL_GET_USER_DETAILS);
eventlog.writeln(SQL_GET_USER_DETAILS);
kindly help pls! Thank you
[1457 byte] By [
peachteaa] at [2007-11-27 7:29:11]

# 3
> What kind of trigger should that be.
> Normally a trigger is fired by a database- event, not
> called from program.
>
> What I mean is if I create an update- trigger on a
> table and I
> update a row from my program, the trigger is
> automaticly executed.
>
> I never heared about calling a trigger from program...
I've written the trigger in such a way it shud get fired when it insert or update on a particular table.
this trigger will automatically get fired when u insert or update through ur java code
something along that line...
# 4
actually im not sure if problem lies with my java code
Can someone help me to vet if i have get the trigger fired through insertion/update via my java program?
This is my code:
private static String SQL_RUN_SP ="{call PARTIAL_FILLED_TRIGGER(?)}";
and
csPartialFillSp = conn.prepareCall(SQL_RUN_SP);
csPartialFillSp.setString(1,xchgID);
eventlog.writeln(SQL_RUN_SP+", xchg_id=["+xchgID+"]");
psPartialFillAlert = conn.prepareStatement(SQL_TRADE_ALERT);
eventlog.writeln(SQL_TRADE_ALERT);
psPartialFillUpdate = conn.prepareStatement(SQL_UPDATE_TRADE_ALERTED);
eventlog.writeln(SQL_UPDATE_TRADE_ALERTED);
System.out.println ("going to poll?");
psPartialFillUserDetails = udConn.prepareStatement(SQL_GET_USER_DETAILS);
eventlog.writeln(SQL_GET_USER_DETAILS);
System.out.println ("going to poll?2");
emailAlert = Boolean.valueOf(mac.getEmailAlert()).booleanValue();
smsAlert = Boolean.valueOf(mac.getSMSAlert()).booleanValue();
System.out.println ("going to poll?3");
I got the following erro msg when i run my java program:
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.T4CCallableStatement.doOall8(T4CCallableStatement.
java:212)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableSta
tement.java:951)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1160)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
aredStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
ement.java:3390)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStat
ement.java:4223)
at PartialFillAlerter.trigger(PartialFillAlerter.java:278)
at PartialFillAlerter.poll(PartialFillAlerter.java:202)
at PartialFillAlerter.<init>(PartialFillAlerter.java:178)
at MainAlerter.main(MainAlerter.java:14)
[2007-06-14 10:58:08] Error in trigger [Error] java.sql.SQLException: ORA-06550:
line 1, column 7:
PLS-00221: 'PARTIAL_FILLED_TRIGGER' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored