Query failed after insert
Hi everybody
I'm using Oracle 11g Release 11.2.0.3.0.
I have created this table (the schema also) :
CREATE TABLE DATA_XML (
NOUVEAUX_CODES_DATA XMLTYPE)
XMLTYPE NOUVEAUX_CODES_DATA STORE AS BINARY XML
XMLSCHEMA "chgt_codes_clients.xsd" ELEMENT "codes_clients"
DISALLOW NONSCHEMA;
I have inserted this row :
update snf_xml set nouveaux_codes_data = XMLType('<codes_clients><modif><ancien_code>TOTO - 000</ancien_code><nouveau_code>UNTEL - 000</nouveau_code><date>2008-07-23</date> <user>P.DUPONT</user><commentaire>PREMIER CHANGEMENT</commentaire></modif></codes_clients>');
No problem
I make this query :
select XMLQuery('for $i in /codes_clients/modif where $i/user="P.DUPONT" return <ok>{$i/date}</ok>'
passing nouveaux_codes_data returning content) DATE_MODIF from data_xml;
No problem, data is returned
I insert a new record, like this :
update snf_xml set nouveaux_codes_data = XMLQuery('copy $p := .modify (for $i in $p/codes_clients return insert node <modif><ancien_code>UNTEL - 000</ancien_code><nouveau_code>MACHIN - 000</nouveau_code><date>2008-07-23</date><user>J.DURAND</user><commentaire>DEUXIEME CHANGEMENT</commentaire></modif> into $i) return $p' passing nouveaux_codes_data returning content)
No problem
But the query : select XMLQuery('for $i in /codes_clients/modif where $i/user="J.DURAND" return <ok>{$i/date}</ok>'
passing nouveaux_codes_data returning content) DATE_MODIF from data_xml;
failed, no result
But the first query is still OK.
Where is the problem ?
Thanks in advance
Sounds like "déjà-vu", unfortunately...
This is not the first time we see bugs related to fragment insertion in schema-based documents.
I can reproduce the problem now :
begin
dbms_xmlschema.registerSchema(
schemaURL => 'chgt_codes_clients.xsd'
, schemaDoc => '<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="codes_clients" type="modif_code"/>
<xs:complexType name="modif_code">
<xs:sequence>
<xs:element name="modif" type="new_code" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="new_code">
<xs:sequence>
<xs:element name="ancien_code" type="xs:string"/>
<xs:element name="nouveau_code" type="xs:string"/>
<xs:element name="date" type="xs:date"/>
<xs:element name="user" type="xs:string"/>
<xs:element name="commentaire" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>'
, local => true
, genTypes => false
, genTables => false
, enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
, options => dbms_xmlschema.REGISTER_BINARYXML
end;
CREATE TABLE DATA_XML of xmltype
XMLSCHEMA "chgt_codes_clients.xsd" ELEMENT "codes_clients" ;
insert into data_xml
values (
xmlparse(document
'<codes_clients>
<modif>
<ancien_code>TOTO - 000</ancien_code>
<nouveau_code>UNTEL - 000</nouveau_code>
<date>2008-07-23</date>
<user>P.DUPONT</user>
<commentaire>PREMIER CHANGEMENT</commentaire>
</modif>
</codes_clients>')
commit;
SQL> alter session set nls_date_format = "DD/MM/YYYY";
Session altered.
SQL> select XMLCast(
2 XMLQuery(
3 'for $i in /codes_clients/modif
4 where $i/user="P.DUPONT"
5 return $i/date'
6 passing object_value
7 returning content
8 )
9 as date
10 ) DATE_MODIF
11 from data_xml;
DATE_MODIF
23/07/2008
SQL> update data_xml
2 set object_value =
3 XMLQuery(
4 'copy $p := .
5 modify (
6 insert node $modif into $p/codes_clients
7 )
8 return $p'
9 passing object_value
10 , xmlparse(content
11 '<modif>
12 <ancien_code>UNTEL - 000</ancien_code>
13 <nouveau_code>MACHIN - 000</nouveau_code>
14 <date>2013-04-25</date>
15 <user>J.DURAND</user>
16 <commentaire>DEUXIEME CHANGEMENT</commentaire>
17 </modif>') as "modif"
18 returning content
19 )
20 ;
1 row updated.
SQL> select XMLCast(
2 XMLQuery(
3 'for $i in /codes_clients/modif
4 where $i/user="J.DURAND"
5 return $i/date'
6 passing object_value
7 returning content
8 )
9 as date
10 ) DATE_MODIF
11 from data_xml;
DATE_MODIF
----------Checking the serialized document shows that the new item is really there :
SQL> set long 5000
SQL> set pages 100
SQL> select xmlserialize(document object_value) from data_xml ;
XMLSERIALIZE(DOCUMENTOBJECT_VALUE)
<codes_clients>
<modif>
<ancien_code>TOTO - 000</ancien_code>
<nouveau_code>UNTEL - 000</nouveau_code>
<date>2008-07-23</date>
<user>P.DUPONT</user>
<commentaire>PREMIER CHANGEMENT</commentaire>
</modif>
<modif>
<ancien_code>UNTEL - 000</ancien_code>
<nouveau_code>MACHIN - 000</nouveau_code>
<date>2013-04-25</date>
<user>J.DURAND</user>
<commentaire>DEUXIEME CHANGEMENT</commentaire>
</modif>
</codes_clients>Workaround : disable XQuery DML rewrite...
It'll prevent Oracle from using a piecewise update on the underlying storage. I suppose you won't see the difference on small docs.
SQL> roll;
Rollback complete.
SQL> update /*+ no_xml_dml_rewrite */
2 data_xml
3 set object_value =
4 XMLQuery(
5 'copy $p := .
6 modify (
7 insert node $modif into $p/codes_clients
8 )
9 return $p'
10 passing object_value
11 , xmlparse(content
12 '<modif>
13 <ancien_code>UNTEL - 000</ancien_code>
14 <nouveau_code>MACHIN - 000</nouveau_code>
15 <date>2013-04-25</date>
16 <user>J.DURAND</user>
17 <commentaire>DEUXIEME CHANGEMENT</commentaire>
18 </modif>') as "modif"
19 returning content
20 )
21 ;
1 row updated.
SQL> select XMLCast(
2 XMLQuery(
3 'for $i in /codes_clients/modif
4 where $i/user="J.DURAND"
5 return $i/date'
6 passing object_value
7 returning content
8 )
9 as date
10 ) DATE_MODIF
11 from data_xml;
DATE_MODIF
25/04/2013
Similar Messages
-
"Refresh after" insert fails for DB-View with INSTEAD OF Triggers
Hi,
I have a database view with INSTEAD OF triggers defined for INSERT, UPDATE, DELETE.
For some EO attributes the refresh after insert and update is defined.
Posting to database fails.
According to Database 9.2 Manual and a previous thread (BC4J and Updatable Views the RETURNING clause is not allowed for database views with INSTEAD OF triggers.
Is there a workaround so the refresh after is done, but without the RETURNING feature?
I only need to refresh some values. The PK i can set in the create method of the EO so refresh via a additional SELECT would be possible.
If not Feature Request:
Add the possibility to do the "refresh after ..." with a 2nd SELECT using the PK instead of using the RETURNING clause.
Of course then it is not possible to set the PK in the database trigger. PK has to be set in the create method of the EO.
Thanks,
Markus
GEMS ITHi Markus,
Turning on the stack trace (-Djbo.debugout put=Console - in the Project/runner) did help and I should have done it sooner. Turns out that when I constructed my EO based upon a database view - I should have left out the PKs of the base tables.
In my case, I am using an "Instead Of Trigger" to populate a multi-table arrangement (parent - child - grandChild - greatGrandChild relationship) where all base tables are using dbSequence/dbTriggers.
Final analysis - I would like to see BC4J handle this situation. I do not want to use View-Links and I should * not * have to resort to stored procedures and BC4J/doDML. If I construct a DB View this is participating in an parent - child - grandChild - greatGrandChild relationship that are using dbSequence/dbTriggers, then BC4J should be smart enough to construct VO knowing that I want to do insert, update, delete, selects - based upon this structure.
Thanks Markus,
Bill G... -
Hi All
Does anyone know how to make a form do a query just after a
commit? Any help would be appreciated.
Regards
HermanThanks Jeremy. I looked through that thread and, unfortunately, it did not help.
On that thread Rick mentioned being able to do multiple SQL statements from a single Fixed Query. I have never done that. How do you separate them? Even if that can be done, you can't execute an insert statement from a Fixed Query so I think you would still need to go to PLSQL--unless you can somehow accomplish it using multiple statements in a Command query.
Any insights would be appreciated. I still think there must be a cleaner way to get the id back without using a cursor but so far I don't know what it is.
Thanks,
Mike -
Hi,
i have created an Trigger After Insert According to me, It's correct But it show me Error Can Not Insert Null in to code.
CREATE OR REPLACE TRIGGER "AFT_INS_CRM_CUSTOMER_CONTACTS"
AFTER INSERT ON FH_TAPROD.CRM_SALES_CUSTOMER_CONTACTS
FOR EACH ROW
DECLARE
custo_id NUMBER;
var_code varchar2(8);
cont_code varchar2(5);
BEGIN
SELECT CUSTOMER_ID INTO custo_id FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =:NEW.ID;
select CODE into var_code from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=custo_id ;
SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') into cont_code FROM vendor_customer_contact
insert into VENDOR_CUSTOMER_CONTACT(SBU_CODE ,CODE,CONTACT_CODE, CONTACT_NAME ,PHONE_NO1 ,MOBILE_NO ,EMAIL, ADDRESS1,CUST_ID,UPLOAD_CRM)
values('0002',var_code,cont_code,:NEW.CONTACT_NAME,:NEW.CONTACT_PHONE,:NEW.CONTACT_CELL,:NEW.CONTACT_EMAIL,:NEW.CONTACT_ADDRESS,custo_id,'CRM');
END;
CREATE TABLE "CRM_SALES_CUSTOMER_CONTACTS"
( "ID" NUMBER,
"CUSTOMER_ID" NUMBER,
"CONTACT_NAME" VARCHAR2(255),
"CONTACT_EMAIL" VARCHAR2(255),
"CONTACT_PHONE" VARCHAR2(255),
"CONTACT_CELL" VARCHAR2(255),
"CONTACT_ADDRESS" VARCHAR2(4000),
PRIMARY KEY ("ID") ENABLE
INSERT INTO CRM_SALES_CUSTOMER_CONTACTS VALUES (204414862717175278810736770347803084847, 204232590877603599356756434170666837075, 'SANJAY', '[email protected]', 1246456, 57152357,'Near Post Office');
CREATE OR REPLACE TRIGGER "BIU_CRM_SALES_CUST_CONTACTS"
BEFORE INSERT OR UPDATE ON CRM_SALES_CUSTOMER_CONTACTS
FOR EACH ROW
begin
if inserting and :new.id is null then
select to_number(sys_guid(),'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') into :new.id from dual;
end if;
if inserting then
:new.created_by := nvl(v('APP_USER'),USER);
:new.created_on := sysdate;
end if;
if updating then
:new.updated_by := nvl(v('APP_USER'),USER);
:new.updated_on := sysdate;
end if;
end;My After Insert TAble
CREATE TABLE "VENDOR_CUSTOMER_CONTACT"
( "SBU_CODE" VARCHAR2(4) NOT NULL ENABLE,
"CODE" VARCHAR2(8) NOT NULL ENABLE,
"CONTACT_CODE" VARCHAR2(5) NOT NULL ENABLE,
"CONTACT_NAME" VARCHAR2(1000) NOT NULL ENABLE,
"PHONE_NO1" VARCHAR2(100),
"MOBILE_NO" VARCHAR2(25),
"EMAIL" VARCHAR2(1000),
"ADDRESS1" VARCHAR2(4000),
"CUST_ID" NUMBER,
"UPLOAD_CRM" VARCHAR2(10),
CONSTRAINT "VCV_PK" PRIMARY KEY ("SBU_CODE", "CODE", "CONTACT_CODE") ENABLE
ORA-01400: cannot insert NULL into ("FH_TAPROD"."VENDOR_CUSTOMER_CONTACT"."CODE") ORA-06512: at "FH_TAPROD.AFT_INS_CRM_CUSTOMER_CONTACTS", line 30 ORA-04088: error during execution of trigger 'FH_TAPROD.AFT_INS_CRM_CUSTOMER_CONTACTS'How to resolve it.
Thanks
Edited by: 805629 on Jan 14, 2011 1:26 AMThis is your trigger
CREATE OR REPLACE TRIGGER "AFT_INS_CRM_CUSTOMER_CONTACTS"
AFTER INSERT ON FH_TAPROD.CRM_SALES_CUSTOMER_CONTACTS
FOR EACH ROW
DECLARE
custo_id NUMBER;
var_code varchar2(8);
cont_code varchar2(5);
BEGIN
SELECT CUSTOMER_ID INTO custo_id FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =:NEW.ID;
select CODE into var_code from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=custo_id ;
SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') into cont_code FROM vendor_customer_contact;
insert into VENDOR_CUSTOMER_CONTACT(SBU_CODE ,CODE,CONTACT_CODE, CONTACT_NAME ,PHONE_NO1 ,MOBILE_NO ,EMAIL, ADDRESS1,CUST_ID,UPLOAD_CRM) values('0002',var_code,cont_code,:NEW.CONTACT_NAME,:NEW.CONTACT_PHONE,:NEW.CONTACT_CELL,:NEW.CONTACT_EMAIL,:NEW.CONTACT_ADDRESS,custo_id,'CRM');
END;This is the insert who fire it
INSERT INTO CRM_SALES_CUSTOMER_CONTACTS VALUES (204414862717175278810736770347803084847, 204232590877603599356756434170666837075, 'SANJAY', '[email protected]', 1246456, 57152357,'Near Post Office');Then the trigger execute
SELECT CUSTOMER_ID FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =204232590877603599356756434170666837075;
select CODE from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=<result of previous query>;
SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') FROM vendor_customer_contact;
Insert ...And fail.
Execute the select in your sqlplus one by one and post result. -
Refresh LOV after inserting data in correspondent table
Hi all,
I am using Jdeveloper 11.1.1.2 and ADFBC.
I have a page with a table (tableA) with some fields. One of them has a LOV associated to another table(tableB). I have a button (button1) that shows a popup(popup1) and opens a new task flow with a fragment to insert data in the tableB.
After inserting/modifying rows in tableB and after pressing commit (property: end-transaction) or rollback buttons (property: end-transaction and restore save point), LOV does not refresh.
I have tried to set the property partial triggers of the LOV to button1 or popup1 and it does not work.
How can I solve it?
Thank you.
AndreaHow about VO for table B ? Did you refresh that ? I didn't use the same VO for table & LOV.
so in "List data Source" -- VO -- I am using "SQL statement" and statement includes fields from Table B and Table A.
VO for LDS using "Rows populated by a SQL query with read-only access". I didn't use "Updateable Access through Entity Objects".
Sample of VO of LDS:
select A.model_number modelNumber, a.part_number partNumber, b.MODEM_TYPE ModemType
from table A a,Table B b
where a.PART_NUMBER_ID = b.PART_NUMBER_ID
and a.part_number_id =:partID
Edited by: albertpi on Mar 16, 2010 7:26 AM -
Unit test fails after upgrading to Kodo 4.0.0 from 4.0.0-EA4
I have a group of 6 unit tests failing after upgrading to the new Kodo
4.0.0 (with BEA) from Kodo-4.0.0-EA4 (with Solarmetric). I'm getting
exceptions like the one at the bottom of this email. It seems to be an
interaction with the PostgreSQL driver, though I can't be sure. I
haven't changed my JDO configuration or the related classes in months
since I've been focusing on using the objects that have already been
defined. The .jdo, .jdoquery, and .java code are below the exception,
just in case there's something wrong in there. Does anyone have advice
as to how I might debug this?
Thanks,
Mark
Testsuite: edu.ucsc.whisper.test.integration.UserManagerQueryIntegrationTest
Tests run: 15, Failures: 0, Errors: 6, Time elapsed: 23.308 sec
Testcase:
testGetAllUsersWithFirstName(edu.ucsc.whisper.test.integration.UserManagerQueryIntegrationTest):
Caused an ERROR
The column index is out of range: 2, number of columns: 1.
<2|false|4.0.0> kodo.jdo.DataStoreException: The column index is out of
range: 2, number of columns: 1.
at
kodo.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4092)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:82)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:66)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:46)
at
kodo.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:176)
at
kodo.kernel.QueryImpl$PackingResultObjectProvider.handleCheckedException(QueryImpl.java:2460)
at
com.solarmetric.rop.EagerResultList.<init>(EagerResultList.java:32)
at kodo.kernel.QueryImpl.toResult(QueryImpl.java:1445)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:1136)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:901)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:865)
at kodo.kernel.DelegatingQuery.execute(DelegatingQuery.java:787)
at kodo.jdo.QueryImpl.executeWithArray(QueryImpl.java:210)
at kodo.jdo.QueryImpl.execute(QueryImpl.java:137)
at
edu.ucsc.whisper.core.dao.JdoUserDao.findAllUsersWithFirstName(JdoUserDao.java:232)
at
edu.ucsc.whisper.core.manager.DefaultUserManager.getAllUsersWithFirstName(DefaultUserManager.java:252)
NestedThrowablesStackTrace:
org.postgresql.util.PSQLException: The column index is out of range: 2,
number of columns: 1.
at
org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:57)
at
org.postgresql.core.v3.SimpleParameterList.setLiteralParameter(SimpleParameterList.java:101)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.bindLiteral(AbstractJdbc2Statement.java:2085)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.setInt(AbstractJdbc2Statement.java:1133)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at
com.solarmetric.jdbc.PoolConnection$PoolPreparedStatement.setInt(PoolConnection.java:440)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at
com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.setInt(LoggingConnectionDecorator.java:1
257)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at
com.solarmetric.jdbc.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:390)
at kodo.jdbc.sql.DBDictionary.setInt(DBDictionary.java:980)
at kodo.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1299)
at kodo.jdbc.sql.SQLBuffer.setParameters(SQLBuffer.java:638)
at kodo.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:539)
at kodo.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:512)
at kodo.jdbc.sql.SelectImpl.execute(SelectImpl.java:332)
at kodo.jdbc.sql.SelectImpl.execute(SelectImpl.java:301)
at kodo.jdbc.sql.Union$UnionSelect.execute(Union.java:642)
at kodo.jdbc.sql.Union.execute(Union.java:326)
at kodo.jdbc.sql.Union.execute(Union.java:313)
at
kodo.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:98)
at
kodo.kernel.QueryImpl$PackingResultObjectProvider.open(QueryImpl.java:2405)
at
com.solarmetric.rop.EagerResultList.<init>(EagerResultList.java:22)
at kodo.kernel.QueryImpl.toResult(QueryImpl.java:1445)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:1136)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:901)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:865)
at kodo.kernel.DelegatingQuery.execute(DelegatingQuery.java:787)
at kodo.jdo.QueryImpl.executeWithArray(QueryImpl.java:210)
at kodo.jdo.QueryImpl.execute(QueryImpl.java:137)
at
edu.ucsc.whisper.core.dao.JdoUserDao.findAllUsersWithFirstName(JdoUserDao.java:232)
--- DefaultUser.java -------------------------------------------------
public class DefaultUser
implements User
/** The account username. */
private String username;
/** The account password. */
private String password;
/** A flag indicating whether or not the account is enabled. */
private boolean enabled;
/** The authorities granted to this account. */
private Set<Authority> authorities;
/** Information about the user, including their name and text that
describes them. */
private UserInfo userInfo;
/** The set of organizations where this user works. */
private Set<Organization> organizations;
--- DefaultUser.jdo --------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE jdo PUBLIC
"-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
"http://java.sun.com/dtd/jdo_2_0.dtd">
<jdo>
<package name="edu.ucsc.whisper.core">
<sequence name="user_id_seq"
factory-class="native(Sequence=user_id_seq)"/>
<class name="DefaultUser" detachable="true"
table="whisper_user" identity-type="datastore">
<datastore-identity sequence="user_id_seq" column="userId"/>
<field name="username">
<column name="username" length="80" jdbc-type="VARCHAR" />
</field>
<field name="password">
<column name="password" length="40" jdbc-type="CHAR" />
</field>
<field name="enabled">
<column name="enabled" />
</field>
<field name="userInfo" persistence-modifier="persistent"
default-fetch-group="true" dependent="true">
<extension vendor-name="jpox"
key="implementation-classes"
value="edu.ucsc.whisper.core.DefaultUserInfo" />
<extension vendor-name="kodo"
key="type"
value="edu.ucsc.whisper.core.DefaultUserInfo" />
</field>
<field name="authorities" persistence-modifier="persistent"
table="user_authorities"
default-fetch-group="true">
<collection
element-type="edu.ucsc.whisper.core.DefaultAuthority" />
<join column="userId" delete-action="cascade"/>
<element column="authorityId" delete-action="cascade"/>
</field>
<field name="organizations" persistence-modifier="persistent"
table="user_organizations" mapped-by="user"
default-fetch-group="true" dependent="true">
<collection
element-type="edu.ucsc.whisper.core.DefaultOrganization"
dependent-element="true"/>
<join column="userId"/>
<!--<element column="organizationId"/>-->
</field>
</class>
</package>
</jdo>
--- DefaultUser.jdoquery ---------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE jdo PUBLIC
"-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
"http://java.sun.com/dtd/jdo_2_0.dtd">
<jdo>
<package name="edu.ucsc.whisper.core">
<class name="DefaultUser">
<query name="UserByUsername"
language="javax.jdo.query.JDOQL"><![CDATA[
SELECT UNIQUE FROM edu.ucsc.whisper.core.DefaultUser
WHERE username==searchName
PARAMETERS java.lang.String searchName
]]></query>
<query name="DisabledUsers"
language="javax.jdo.query.JDOQL"><![CDATA[
SELECT FROM edu.ucsc.whisper.core.DefaultUser WHERE
enabled==false
]]></query>
<query name="EnabledUsers"
language="javax.jdo.query.JDOQL"><![CDATA[
SELECT FROM edu.ucsc.whisper.core.DefaultUser WHERE
enabled==true
]]></query>
<query name="CountUsers"
language="javax.jdo.query.JDOQL"><![CDATA[
SELECT count( this ) FROM edu.ucsc.whisper.core.DefaultUser
]]></query>
</class>
</package>
</jdo>I'm sorry, I have no idea. I suggest sending a test case that
reproduces the problem to support. -
Oracle BI Office Add-In for Excel (Failed to insert Oracle BI view due to )
Dear all,
I receive the following error message when I change the Prompts in Oracle BI Excel Add-In:
Failed to insert Oracle BI view due to processing query error.
I think it has something to do with the performance of the development database.
Is there a configuration file and a parameter the eliminate this error message?
Regards,
StefanI've seen this error occur when the Flash ActiveX control is not installed on the machine that is viewing the Excel content because the charts views use Flash. You can fix this by downloading the Shockwave Flash control from www.adobe.com
-
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/ -
Print insert result to a printer in TSQL trigger after insert - Need help.
Hi,
I am trying to print a record to a printer whenever a new record is inserted into a table called PrintTickets, using TSQL trigger for insert.
Is it possible to print a new inserted record to a printer?
Here is the trigger tsql statement:
ALTER TRIGGER [dbo].[PrintDeal]
ON [dbo].[PrintTickets]
AFTER INSERT
AS
declare @Id numeric(18,0)
,@DealId char(15)
,@ValueDatePeriod1Currency1 datetime
,@Bank1Name char(56)
,@Currency1 char(3)
,@Currency2 char(3)
,@PaymentInstructionP1C1 char(80)
,@DealerId char(6)
,@DealVolumeCurrency1 float
,@CalVolumeP1C2 float
,@ExchangeRatePeriod1 float
declare @tmp table
Id numeric(18,0)
,DealId char(15)
,ValueDatePeriod1Currency1 datetime
,Bank1Name char(56)
,Currency1 char(3)
,Currency2 char(3)
,PaymentInstructionP1C1 char(80)
,DealerId char(6)
,DealVolumeCurrency1 float
,CalVolumeP1C2 float
,ExchangeRatePeriod1 float
PRIMARY KEY (Id)
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for trigger here
insert @tmp
select
Id
, DealId
, ValueDatePeriod1Currency1
, Bank1Name
, Currency1
, Currency2
, PaymentInstructionP1C1
, DealerId
, DealVolumeCurrency1
, CalVolumeP1C2
, ExchangeRatePeriod1
FROM dbo.PrintTickets
WHERE ID=@@IDENTITY
select @Id=Id
,@DealId=DealId
,@ValueDatePeriod1Currency1=ValueDatePeriod1Currency1
,@Bank1Name=Bank1Name
,@Currency1=Currency1
,@Currency2=Currency2
,@PaymentInstructionP1C1=PaymentInstructionP1C1
,@DealerId=DealerId
,@DealVolumeCurrency1=DealVolumeCurrency1
,@CalVolumeP1C2=CalVolumeP1C2
,@ExchangeRatePeriod1=ExchangeRatePeriod1
from @tmp
-- Code to print to a physical printer if possible
END
The table is called PrintTickets and it contains the following columns:
Id numeric(18,0)
,DealId char(15)
,ValueDatePeriod1Currency1 datetime
,Bank1Name char(56)
,Currency1 char(3)
,Currency2 char(3)
,PaymentInstructionP1C1 char(80)
,DealerId char(6)
,DealVolumeCurrency1 float
,CalVolumeP1C2 float
,ExchangeRatePeriod1 float
PRIMARY KEY (Id)
The dummy records that I am inserting for testing the results in csv format:
Id,DealId,ValueDatePeriod1Currency1,Bank1Name,Currency1,Currency2,PaymentInstructionP1C1,DealerId,DealVolumeCurrency1,CalVolumeP1C2,ExchangeRatePeriod1
696,XXX#33111 ,2014-03-04 00:00:00.000,HSBC ,USD,EUR,XXXXXXXXXXXXXXXXXXXXXXX ,MAT ,342342,87987,0.3123
697,XXX#33113 ,2014-03-04 00:00:00.000,USB ,EUR,USD,9999999999999999999999,ZXY,2334243,32213,0.3245
698,XXX#33114 ,2014-03-03 00:00:00.000,SWISS BANK ,CHF,USD,99999999999999900000,XYZ ,32423424,342,0.83432
699,XXX#33115 ,2014-03-03 00:00:00.000,UK BANK ,USD,PND,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,9809808,0,0.0349
700,XXX#33116 ,2014-03-04 00:00:00.000,USCF BANK ,XXX,XXX,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,89798797,756756,0.734
I appreciate any help.
Thanks in advance.Is it possible to print a new inserted record to a printer?
From SQL Server?
The task of SQL Server is to manage large of data effciently. It is not a general programming environment. It could possibly be done with a CLR procedure that that talks to the printer, but it is not the correct solution.
A possible design could be to post a message on a Service Broker queue, and then the printing server would poll the queue and print the ticket.
By the way, there are more flaws in your trigger. To find the inserted rows, you need to query the virtual table "inserted" which holds a copy of these rows. Furthermore, since a trigger fires once per statement, the trigger must handle the fact
that multiple rows are inserted.
Erland Sommarskog, SQL Server MVP, [email protected] -
I create trigger but not display massage after insert in oracle 10g
I create trigger but not display massage after insert in oracle 10g
**CREATE OR REPLACE TRIGGER TableName**
**AFTER INSERT OR DELETE OR UPDATE ON test**
**BEGIN**
**if inserting then**
**dbms_output.put('Message');**
**end if;**
**END;**What user interface are you using?
If the tool doesn't support the SQL*Plus syntax (set serveroutput on), it probably has an option somewhere to enable DBMS Output. Not even knowing what tool you're using, it's impossible for us to guess where that option might be configured.
As others have suggested, using DBMS Output to test code is less than ideal because you're dependent on the application you're using to display it to you and not every application can or will do that. If you want to use DBMS_Output, you may need to switch to a different GUI (SQL Developer or SQL*Plus are both free utilities from Oracle). Otherwise, you'd probably be better off having the trigger do something that you can subsequently query (i.e. write a row to a log table).
Justin -
Mutating table exception on trigger with After Insert but not with before
Hi
I need to maintain some constraint on the table to have only one row for values of the columns but not by primary key constraint.
Because in case of primary key the insert would fail and the rest of the operation would be discontinued, I cannot change in the somponent that inserts the row so I have to prevent that on the table I have.
I created a before insert trigger on the table which checks if any row exists in the table with same column values as the one being inserted. if found I delete the rows and let the insert happen (w/o raising any error). if the rows do not exist then the insert shall be continued.
I read at place that modifying the dame table in the trigger body shall raise a mutating table exception, but I donot get the exception when the trigger is fired.
Just when I change the trigger to after insert trigger then the nutating table exception is thrown.
Is it the right behavior i.e. the Before insert trigger does not raise the exception and only after insert does that, since I could not find the example for before insert triggers throwing such exception so I think it is better to confirm it before finalizing the implementation.
Thanks
Sapansapan wrote:
Hi Tubby
I cannot user unique constraint because that would raise an exception upon violation and the third party component that is inserting in the table would fail.
That component does some other tasks as well after this insert and if an exception is raised then those tasks would not be performed.
Also I cannot change the component to ignore this exception.Well then, you're in a bit of a pickle.
I'm guessing the trigger you have been working on isn't "safe". By that i mean that it doesn't account for multi-user scenarios. You'll need to serialize access to the data elements in question and implement some sort of locking mechanism to ensure that only 1 session can work with those values.
After you work out how to do that it sounds as though you would be better served using an INSTEAD OF trigger (you'd need to implement this on a view which is made off of your base table).
Here's one way you can work on serializing access to your table on a relatively fine grained level (as opposed to locking the entire table).
Re: possible to lock stored procedure so only one session may run it at a time?
Cheers, -
Hi all,
Recently, I'm receiving these two alerts from one WSA S370:
Report Query Failed
query_id: wsa_monitor_overview_web_proxy_summary
data_source: WSASimpleTotalRDS
error: <type 'type'> ('egg/command_client.py send_message|555', "<class 'Commandment.DaemonUnresponsiveError'>", 'S370B.NAME.net: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|265] [reportdatasource/CounterReportDataSource.py _parse_overall_interval|581] [query/merged_result.py range|85] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
AND
Report Query Failed
query_id: wsa_monitor_overview_clients_by_blocked_transactions
data_source: WSACommonRDS
error: <type 'type'> ('egg/command_client.py call|238', "<class 'reporting.query.exceptions.DatabaseQueryFailure'>", '', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|251] [reportdatasource/CounterReportDataSource.py _run_api_query|482] [query/client.py time_merge_query|454] [query/client.py _call|235] [egg/command_client.py call|238]')
The code I'm using is 7.1.1-038
I started receiving the alerts only after upgrading to this code. Have you noticed something similar?
Thanks a lot for your help!!!
FernandoHello Everyone,
I am in Australia (Melbourne) and i am using ironport s160 web security appliance version: 7.1.2-80. Reecently i have started receiving the following warning from ironport proxy.
The Warning message is:
Report Query Failed
query_id: wsa_monitor_overview_malware_categories
data_source: WSACommonRDS
error: ('egg/command_client.py send_message|555', "", 'proxymel3.sportsbet.com.au: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|265] [reportdatasource/CounterReportDataSource.py _parse_overall_interval|581] [query/merged_result.py range|85] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
Report Query Failed
query_id: wsa_monitor_overview_suspect_transactions_detected
data_source: CounterReportDataSource
error: ('egg/command_client.py send_message|555', "", 'proxymel3.sportsbet.com.au: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|272] [reportdatasource/CounterReportDataSource.py _parse_api_results|506] [reportdatasource/CounterReportDataSource.py _parse_interval_result_set|525] [query/result.py next|112] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
Report Query Failed
query_id: wsa_monitor_overview_suspect_transactions_summary
data_source: WSASimpleTotalRDS
error: ('egg/command_client.py send_message|555', "", 'proxymel3.sportsbet.com.au: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|265] [reportdatasource/CounterReportDataSource.py _parse_overall_interval|581] [query/merged_result.py range|85] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
Report Query Failed
query_id: wsa_monitor_overview_top_application_types
data_source: CounterReportDataSource
error: ('egg/command_client.py send_message|555', "", 'proxymel3.sportsbet.com.au: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|265] [reportdatasource/CounterReportDataSource.py _parse_overall_interval|581] [query/merged_result.py range|85] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
Report Query Failed
query_id: wsa_monitor_overview_top_url_categories
data_source: CounterReportDataSource
error: ('egg/command_client.py send_message|555', "", 'proxymel3.sportsbet.com.au: The daemon is not responding.', '[database/ReportCatalog.py run_report_queries|332] [reportdatasource/CounterReportDataSource.py query|265] [reportdatasource/CounterReportDataSource.py _parse_overall_interval|581] [query/merged_result.py range|85] [query/client.py _call|235] [egg/command_client.py call|233] [egg/command_client.py send_message|555]')
Product: IronPort S160 Web Security Appliance
Model: S160
Version: 7.1.2-080
Serial Number: 0025643CFD42-4GQYHL1
Timestamp: 14 Jun 2012 14:00:21 +1000
Thank you for your help.
Lovedeep -
Resultset after insertion is the same before insertion
hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after insertion and also the data, this is the code prove what i say
int currentRow = resultset.getRow();
display(resultset);
resultset.moveToInsertRow();
for (int i = 0; i < fields.size(); i++) {
updateCurrentRow(resultset, fields.getField(i));
resultset.insertRow();
display(resultset);the display function body is
int currentRow = res.getRow();
res.first();
while (true)
System.out.println("CountyCode= " + res.getInt(1));
System.out.println("CountyName= " + res.getString(2));
if (!res.next())
break;
res.absolute(currentRow);Please help me
N.B.
the type of resultset after creation it is res.getConcurrency() == ResultSet.CONCUR_UPDATABLE?????
Thanks for your effortsthnaks for your reply, but when i used
ownInsertsAreVisible() method; returned true, that is
mean that the driver and DB supports the updating of
reultset after insertion. but this is not real at my
case? that was strange. if you have any comment please
do,just checking the row is in fact being inserted into the database? i mean you can't see it right away but you can see it later right?
if the row is being inserted and the ownInsertsAreVisible() returns true then there are two possible scenarios.
1) the cursor type of your result set does not support that method, meaning the method is true in some cases but not yours... for example your query might have a join or something which makes it not possible for the result set do be fully cognizant of changes. and sometimes there are database specific cursors that have to specified as part of your query in a proprietary way to get the "right" cursor. you will need to investigate the docs for your database to figure out if any of this is true.
2) the meta data is lying. -
Business service failed to insert the data in DB2
Hi I have developed a business service through OSB and deployed in to SOB in my local. The business service is trying to insert data in to DB2 table where the primary key column is auto generated in DB2.
When i am testing the business service, in the XML i have removed that tag out of it and tried the execute the service and I end up with the following error. Please let me know where I am going wrong in this.
<Mar 15, 2012 1:35:19 PM CDT> <Error> <JCA_FRAMEWORK_AND_ADAPTER> <BEA-000000> <servicebus:/WSDL/IIRSearch/adapter/IIRA
apterServices/AuditInputDataService [ AuditInputDataService_ptt::insert(SearchAuditIirCollection) ] - Could not invoke
peration 'insert' due to:
BINDING.JCA-11616
DBWriteInteractionSpec Execute Failed Exception.
insert failed. Descriptor name: [AuditInputDataService.SearchAuditIir].
Caused by java.sql.BatchUpdateException: [IBM][CLI Driver][DB2/LINUXX8664] SQL0798N A value cannot be specified for co
umn "SEARCH_ID" which is defined as GENERATED ALWAYS. SQLSTATE=428C9
Please see the logs for the full DBAdapter logging output prior to this exception. ConnectionFactory property platform
lassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecti
g to is DB2/LINUXX8664. Please validate your platformClassName setting. This mismatch can cause the adapter to trigge
runtime exceptions or execute SQL that is invalid for the database you are connected to. This exception is considered
not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCo
es with value "--798" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these
omposite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties ar
integers.
at oracle.tip.adapter.db.exceptions.DBResourceException.createNonRetriableException(DBResourceException.java:68
at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:648)
at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:696)
at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:236)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:544)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:353)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.j
va:312)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:29
at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:345)
at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.post(JCABindingReferenceImpl.java:195)
at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invokeOneWay(JCATransp
rtOutboundOperationBindingServiceImpl.java:109)
at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendOneWay(JCATransportEndpoint.java:191)
at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:168)
at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:598)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
at $Proxy128.sendMessageAsync(Unknown Source)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.
ava:603)
at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:
38)
at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:380)
at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)I am assuming that the primary key that you were referring to is the SEARCH_ID.
Caused by java.sql.BatchUpdateException: [IBM][CLI Driver][DB2/LINUXX8664] SQL0798N A value cannot be specified for column "SEARCH_ID" which is defined as GENERATED ALWAYS. SQLSTATE=428C9Looks like when you generated the JCA DBAdapter WSDL, all the columns were selected. And hence the insert queries that were generated to be used by the JCA DBAdapter have this field.
Can you reconfigure the DBAdapter with a custom query to insert in to the table, without the primary key column selected. This should resolve your issue.
If this still does not solve your issue. Lets start to debug further by capturing the exact SQL query being executed.
Enable the debug mode for the JCA framework. Edit the alsbdebug.xml file in the domain directory and set the category alsb-jca-framework-adapter-debug flag to true. Then restart the servers.
Refer - http://download.oracle.com/docs/html/E15867_01/app_debugging.htm for more details.
Hope this helps.
Thanks,
Patrick -
Analyze table after insert a large number of records?
For performance purpose, is it a good practice to execute an 'analyze table' command after inserting a large number of a records into a table in Oracle 10g, if there is a complex query following the insert?
For example:
Insert into foo ...... //Insert one million records to table foo.
analyze table foo COMPUTE STATISTICS; //analyze table foo
select * from foo, bar, car...... //Execute a complex query whithout hints
//after 1 million records inserted into foo
Does this strategy help to improve the overall performance?
Thanks.Different execution plans will most frequently occur when the ratio of the number of records in various tables involved in the select has changed tremendously. This happens above all if 'fact' tables are growing and 'lookup' tables stayed constant.
This is why you shouldn't test an application with a small number of 'fact' records.
This can happen both with analyze table and dbms_stats.
The advantage of dbms_stats is, it will export the current statistics to a stats to table, so you can always revert to them using dbms_stats.import_stats.
You can even overrule individual table and column statistics by artificial values.
Hth
Sybrand Bakker
Senior Oracle DBA
Maybe you are looking for
-
It's a MBP mid 2010. Last year it had some problems and an Apple authorised shop changed the HD and upgraded the OS from Snow Leopard to Lion. After that it seemed fine. Recently it started getting very slow and apps (e.g. Chrome, Flash) would crash.
-
I lost my iPod touch (4th generation) over a week ago and did not think I installed the icloud on it. When I was setting up my new iPod touch (4th generation), I saw that it automatically shows an option for icloud. That made me realize that I probab
-
Issues with exporting video from MacBook Pro to flash drive
I cannot sucessfully transfer [export] video taken on my gopro camera, from my MacBook Pro to any flash drive and play them on other computers. For some reason the files are not playable, even with quicktime. They will not play with ANY of my video
-
Can't open my PB on my Windows PC anymore!
Interesting. I've been doing this for a while and now suddenly I can't open it. It shows up in the network list... but gives a file/path error. Tried rebooting everything of course. Turned WiFi sharing on/off (which dropped the icon and then it reapp
-
Hi! (iPhone4s) I have a problem with Mail.
Hi all! I have a problem with Mail. I added my Gmail account. iPhone tells me that there are more than 42949670 mails. Obviously this number doesn't appear on the icon; I see it only when I open Mail. (Ah, I have already read all of these mails). The