Parrallel SQL Operations
Hi,
Is it possible in oracle to fire off two seperate SQL statements in parrellel using the same transaction. However the tables the SQL were acting on are different. The reason I want to use two separeate SQL statements using the same transaction is because I will be using a two phase commit strategy using Database links. For my implementation this means that I can not have separate inserts working under different transactions.
Any ideas?
Thanks,
Gavin Barton
This operation is done using Oracle 8.1.7.
Thanks,
Gavin Barton
Hi,
Is it possible in oracle to fire off two seperate SQL
statements in parrellel using the same transaction.
However the tables the SQL were acting on are
different. The reason I want to use two separeate
SQL statements using the same transaction is because
I will be using a two phase commit strategy using
Database links. For my implementation this means
that I can not have separate inserts working under
different transactions.
Any ideas?
Thanks,
Gavin Barton
Similar Messages
-
SQL operations are not allowed with no global transaction by default for X
Hi All,
I am getting the above mentioned error.
java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA driver supports performing SQL operations with no global transaction, explicitly allow it by setting "SupportsLocalTransaction" JDBC connection pool property to true. In this case, a
lso remember to complete the local transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
I am developing a web application. I have jsp, servlets, JDBC classes.
I am using DataSource and Connection pools.
I am on WLS 8.1 sp3 and Oracle 10.1.
Part of My Config file looks as follows:
<JDBCConnectionPool DriverName="weblogic.jdbcx.oracle.OracleDataSource" KeepLogicalConnOpenOnRelease="true" KeepXAConnTillTxComplete="false" Name="AUMDataSource" NeedTxCtxOnClose="false" NewXAConnForCommit="false" Password="{3DES}AKRkWgdzXN8WrXSRtSvJ6g==" Properties="user=pibsrmgr;portNumber=1521;SID=pibsrdod;serverName=pibsrdod.dtu.mlam.ml.com" RollbackLocalTxUponConnClose="true" SupportsLocalTransaction="false" Targets="myserver" TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:bea:oracle://pibsrdod.dtu.mlam.ml.com:1521" XAEndOnlyOnce="false" />
<JDBCTxDataSource EnableTwoPhaseCommit="true" JNDIName="jdbc/AUMDataSource" Name="AUMDataSource" PoolName="AUMDataSource" Targets="myserver" />
Any help will be appreciated.
Thanks
---RadheHi,
Regarding Transactions , the following link can helpful to you .
Regards,
Prasanna Yalam -
hi experts,
I want to clear my basic concepts here.
I want to know the order of the sql operation.
actually the problem with me that i have read from different blog and websites
about the order of operation of the sqkl queries , hence i am confused here.
what i think the order of operation iis
-----------MY assumptuion---------------------
From
|
where
|
group
|
having
|
select
|
order by
is my assupmtion is correct?
if yes , then if suppose there is rownum clause in my selection criteria,at which timing
will it apply?
on some site i have seen below criteria
1. The FROM/WHERE clause goes first.
2. ROWNUM is assigned and incremented to each output row from the FROM/WHERE clause.
3. SELECT is applied.
4. GROUP BY is applied.
5. HAVING is applied.
6. ORDER BY is applied.
is this correct or my assumption is correct?
thanks a lot in advance..!!
regards,
prashantHi Prashant,
Instead of memorizing, why not check the query plan -
-->-- Creating a test table
CREATE TABLE test_tbl as
SELECT 'A' name, 100 sal FROM dual UNION ALL
SELECT 'A' name, 120 sal FROM dual UNION ALL
SELECT 'B' name, 66 sal FROM dual UNION ALL
SELECT 'C' name, 20 sal FROM dual UNION ALL
SELECT 'C' name, 50 sal FROM dual UNION ALL
SELECT 'C' name, 60 sal FROM dual UNION ALL
SELECT 'D' name, 90 sal FROM dual UNION ALL
SELECT 'D' name, 110 sal FROM dual;
-->-- Query explain plan
EXPLAIN PLAN for
SELECT name, SUM(sal) sm
FROM test_tbl
GROUP BY name
HAVING Sum(sal) > 150
ORDER BY sm;
-->-- Fetching the plan from cursor pool
SELECT *
FROM TABLE(dbms_xplan.display);
-->-- Query plan
PLAN_TABLE_OUTPUT
Plan hash value: 3401269832
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 8 | 128 | 5 (40)| 00:00:01 |
| 1 | SORT ORDER BY | | 8 | 128 | 5 (40)| 00:00:01 |
|* 2 | FILTER | | | | | |
| 3 | HASH GROUP BY | | 8 | 128 | 5 (40)| 00:00:01 |
| 4 | TABLE ACCESS FULL| TEST_TBL | 8 | 128 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter(SUM("SAL")>150)
Now, how to read the plan?
Start reading the plan - with the line "Operation" indented towards extreme right. Line-4 in this case.
Note: If two lines are indented similarly i.e. on same vertical line... read normally as-in order.
Like this:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 8 | 128 | 5 (40)| 00:00:01 |
| 1 | SORT ORDER BY | | 8 | 128 | 5 (40)| 00:00:01 |
|* 2 | FILTER | | | | | |
| 3 | HASH GROUP BY | | 8 | 128 | 5 (40)| 00:00:01 |
| 4 | TABLE ACCESS FULL| TEST_TBL_1 | 8 | 128 | 3 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL| TEST_TBL_2 | 8 | 128 | 3 (0)| 00:00:01 |
Read: line 4 and then line 5, since both are on same vertical level.
Final sequence:
1- (Line 4) Table Access : FROM clause
2- (Line 3) GROUP BY
3- (Line 2) Filtering : WHERE clause
4- (Line 1) Sorting : ORDER BY clause
5- (Line 0) SELECT
Hope this helps.
-- Ranit -
How to add custom sql operations in Database adapters?
I have a database adapter in ESB configured with insert, update and select operations.
I wanted to add another select operation with pure sql. When I added the operation it gave me error "Start of the root element expected" while registering the service.
Can't we do like this?
I use SOA suite 10.1.3.4.
- SamHi Thanks for reply.
There is an option while configuring the DB adapter "Execute Custom SQL" where you can specify the query you want to execute. It will generate the schema as per the query you enter in the wizard.
I have created adapters with this type of custom SQLs and even I have put multiple operations in the same adapters where all use Custom SQL and they are working fine.
Thease custom SQL operations can be anything insert, update, select and they even work with other operations using procedures in the same adapter. But yes we need to modify the WSDL manuallly.
My problem was that when I try to add the custom SQL operation in the adapter which is configured with normal select, insert and update operation, I was getting the error mentioned.
- Sam -
"SQL Operation failed" When deleting forms EPMA
V11.1.2.1 - Planning through EPMA.
I have a form which I made to test something that I cant get rid of. I can edit it, I can hide it and I can change any normal setting you would expect on it. When I open it, everything appears as expected. This is happening for just one form, I can create and delete others in the same folder. I've tried renaming it and deleting and that still doesn't work.
I just cant select it and click "Delete": I get an error message saying "The SQL Operation failed. Check logs for details.
Does anyone know which logs in particular might point me to the cause of the problem?
Has anyone had and resolved this before?
Regards
EdCheck the user_projects/<instancename>/diagnostics/logs/starter or services depending on linx/windows. Check the Hyperion Planning log to see what errors are generated in the log when you attempt the delete. You should see an sql error message.
If you don't see any messages you want to set planning property debug_enabled TRUE (the instructions for this are in the troubleshooting documentation for EPM) and restart the server.
Retry and reexamine the logs. -
Hi,<BR>While adding/Changing member in planning it gives the error "The SQL operation failed with an error code: 0" and not allowing any of the changes. I am not able to open the forms giving the error as "Fiscal Days Input - is invalid". Interestingly one form was opening, when the Page selection is changed it also started giving error as like "Fisacal Days Input(form name) - is invalid check log for details". <BR>Pls advice us that what is this error and how to resolve this.<BR><BR>And Which log is to be referred for the details.<BR><BR>Thanks<BR>Ravi
If a form is invalid it generally means that one of the dimension references is missing.<BR><BR>Can you get in to edit the form?<BR>If you can, see if you can preview it. I suspect you will not be able to.<BR><BR>If not, check all dimension boxes have at least one member against them.<BR>If you have multiple rows and/or columns check all of them too.<BR><BR>I've had a couple of forms in dev "drop" a dimension reference but only once or twice so not enough to reproduce or find out what is causing it. Each time I got the "form invalid" error message and managed to fix it.<BR><BR>Hope this helps.<BR>
-
Avoid procedure or function calls between a SQL operation and an implicit cursor test
when i analyse this code with code expert
atpidgeon wrote:
when i analyse this code with code expert
UPDATE P_PM_CONTROL_COUNT
SET AVAIL_SEG = AVAIL_SEG -1,
ALLOCATION = ALLOCATION -1
WHERE PM_UNIT_TYPE_ID = vrectab(1)
AND USAGE_DATE = vrectab(2)
AND SEGMENT_CODE = vrectab(5)
AND ALLOCATION - UNITS_RESERVED > 0;
IF sql%rowcount = 0 then --Added block and exception to prevent invetory going negative when placing multi units in same unit type out of service.
vErrMsg := 'Could not process your out of service request because your selection for unit '|| vrectab(3) || ' at ' || pvPropertyId || ' for ' || vrectab(2) || ' would cause segment ' || vrectab(5) || ' to be over allocated.';
RAISE SegOverAllocated;
END IF;
i get "Avoid procedure or function calls between a SQL operation and an implicit cursor test.",as far has i know
iff you're doing a sql%rowcount after an update.. trying to see how many rows were updated... you dont want procedure or function calls between the update and the sql% line
correct me if im wrong and how would i fix it?or maybe i shouldnt
You correct it by NOT executing function calls as part of the UPDATE statement.
1. Issue the function calls BEFORE the update statement
2. save the function results into variables
3. use those variables in the UPDATE statement.
v_rectab1 := vrectab(1);
v_rectab2 := vrectab(21);
v_rectab5 := vrectab(5);
UPDATE P_PM_CONTROL_COUNT
SET AVAIL_SEG = AVAIL_SEG -1,
ALLOCATION = ALLOCATION -1
WHERE PM_UNIT_TYPE_ID = v_rectab1
AND USAGE_DATE = v_rectab2
AND SEGMENT_CODE = v_rectab5
AND ALLOCATION - UNITS_RESERVED > 0; -
SQL operation failed when new creating form ?
Dear All,
When I create a new form in workspace 11.1.2.1 , it occur an error and returns "SQL operation failed". So, how to solve it ?
Thank you all.
EvaTry to restart planning. Have you used admin account to create form?
Look at the logs <MIDDLEWARE_HOME>\user_projects\epmsystem1\diagnostics\logs\services\HyS9Planning-sysout.log and HyS9Planning-syserr.log -
How to use ALL operator in SQL query. I need something like students who have passed in both maths and science. Please help.
Thanks.SQL> CREATE TABLE STUDENT
2 (
3 SNAME VARCHAR2(6),
4 SNO CHAR(2)
5 );
Table created.
SQL> ALTER TABLE STUDENT ADD (
2 CONSTRAINT SNO_PK PRIMARY KEY (SNO));
Table altered.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('L Tree','S1')
2 ;
1 row created.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('D Pond','S2');
1 row created.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('M Lake','S3');
1 row created.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('J Bond','S4');
1 row created.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('S Bark', 'S5');
1 row created.
SQL> INSERT INTO STUDENT(SNAME,SNO) VALUES('L Leaf','S6');
1 row created.
SQL> CREATE TABLE COURSE
2 (
3 CNAME VARCHAR2(6),
4 CNO CHAR(2)
5 );
Table created.
SQL> ALTER TABLE COURSE ADD (
2 CONSTRAINT CNO_PK PRIMARY KEY (CNO));
Table altered.
SQL> INSERT INTO COURSE(CNAME,CNO) VALUES('Comp 1','C1')
2 ;
1 row created.
SQL> INSERT INTO COURSE(CNAME,CNO) VALUES('Math 2','C2');
1 row created.
SQL> INSERT INTO COURSE(CNAME,CNO) VALUES('Phys 3','C3');
1 row created.
SQL> INSERT INTO COURSE(CNAME,CNO) VALUES('Comp 3','C4');
1 row created.
SQL> CREATE TABLE RESULT
2 (
3 SNO CHAR(2),
4 CNO CHAR(2),
5 MARK INTEGER
6 );
Table created.
SQL> ALTER TABLE RESULT ADD (
2 CONSTRAINT CNO_FK FOREIGN KEY (CNO)
3 REFERENCES COURSE (CNO));
Table altered.
SQL> ALTER TABLE RESULT ADD (
2 CONSTRAINT SNO_FK FOREIGN KEY (SNO)
3 REFERENCES STUDENT (SNO));
Table altered.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S1','C1',77)
2 ;
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S1','C2',80);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S2','C2',93);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S2','C3',88);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S2','C4',91);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S3','C2',74);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S3','C3',89);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S4','C2',75);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S4','C3',85);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S4','C4',55);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S5','C1',50);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S5','C4',61);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S6','C2',77);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S6','C3',88);
1 row created.
SQL> INSERT INTO RESULT(SNO,CNO,MARK) VALUES('S6','C4',54);
1 row created.
SQL> commit;
Commit complete.With the above, I need to find
1. Names of students who have passed ALL courses that J Bond passed (this should give students who have passed both in C2 and C3)
2. Names of students who have got better mark than J Bond in ALL courses that J Bond recevied marks
3. Passmark is >= 60
BTW how do i post sql codes in different text
Thanks. -
Newbie question: SQL operations automatically reordered so a DELETE comes first?
Hi -
I have two objects that are related to each other by a one-to-many relationship. In my test case
there's a single A object that is related to a single B object. I want to sever the relationship
between the two objects (a SQL UPDATE behind the scenes) and then delete one of them (a SQL
DELETE).
What I'm seeing is that the SQL DELETE is issued before the SQL UPDATE. I'm running Kodo 2.3.2.
Here's the Java code:
// sever A's relationship to B, which issues a SQL UPDATE
objectA.getBs().remove(objectB);
// sever B's relationship to A
objectB.setA(null);
m_pm.makePersistent(objectB);
// delete object A, which issues a SQL DELETE
m_pm.deletePersistent(objectA);
If this Java code is in a single transaction, the DELETE occurs before the UPDATE and fails because
of a foreign key constraint. If the deletePersistent call is moved to a separate transaction, all
work is completely successfully.
Is this behavior by design? Did I miscode something?
Thanks in advance,
LesThanks Abe. I actually thought I was ordering the operations but I can see now that I wasn't
thinking about the order that the objects joined the transaction.
And thanks for posting a quick reply; that's a big help.
Les
"Abe White" <[email protected]> wrote in message news:aoi7p0$euu$[email protected]..
Kodo will performs database operations on a per-object basis, and orders each
object's database operations according to when that object joined the
transaction.
In your case, objectA is joining the transaction as soon as you call
objectA.getObjectBs ().remove (objectB);
So even though the explicit deletion of objectA doesn't happen until later,
Kodo places it at the point where objectA joined the transaction. To work
around this, just change your code:
objectB.setObjectA (null);
objectA.getObjectBs ().remove (objectB);
pm.deletePersistent (objectA);
Note that internal builds of Kodo have support for automatic foreign key
analysis and INSERT/UPDATE/DELETE ordering, but the feature probably won't
be debuted publicly for a couple of months. -
CF search using "LIKE" SQL operator
I've been doing limited keyword searches of selected fields
in both MS Access and SQL Server for several years now. My searches
have always been in this format: "WHERE Title LIKE '%#sKeyword#%'."
They seem to always work. The only downside to this method is than
any word that contains the sKeyword is returned because there is a
% on both ends.
What I discovered today was that this form will also work:
WHERE Title LIKE '%#sKeyword#'; i.e. returns any word that ends in
the Keyword. But that the other variant (WHERE Title LIKE
'#sKeyword#%'), where the % is on the end, will not work.
Anyone have any idea why the version with the % on the end
will not work???
As a related item, does anyone have any idea how you would
search a long text field for just the sKeyword; i.e., it would be
like doing a WHERE Title LIKE '#sKeyword#'. I know that a LIKE
search without any %'s will not return anything and I'm already
doing Verity searchs so I know about that method. I'm just looking
for a simple way to find a whole word within a group of words in a
single field.The Title field is a text field that is 100 characters long.
The sKeyword is any word that is entered in a 35 character long
textarea and then placed into the sKeyword var. The word I have
been testing with is 'ratio'. It return words like 'ratio',
'frustration' and 'operation' when used with #1 below. Returning
'frustration' and 'operation' is somewhat confusion to some users
so I was trying to find a way to only return 'ratio', but so far I
haven't figured out a way to do so. But I digress...
The queries that return values are: 1) WHERE Title LIKE
'%#sKeyword#%' and 2) WHERE Title LIKE '%#sKeyword#'. I have four
reference books that say that WHERE Title LIKE '#sKeyword#%' should
also work, but it doesn't. -
I am selecting the list of sql queries issued using FLASHBACK_TRANSACTION_QUERY . (Oracle 10g XE)
The below is query...
select operation,START_SCN,undo_sql from FLASHBACK_TRANSACTION_QUERY where logon_user='SHARMA' AND table_owner='SHARMA' AND TABLE_NAME='EMPLOYEE';
Output is..
operation START_SCN undo_sql
DELETE 1000896 insert into "SHARMA"."EMPLOYEE"("ID","NAME") values ('103','Shiva');
UPDATE 966271 update "SHARMA"."EMPLOYEE" set "NAME" = 'Fernandas' where ROWID = 'AAADeIAABAAAKlaAAD';
INSERT 966222 delete from "SHARMA"."EMPLOYEE" where ROWID = 'AAADeIAABAAAKlaAAD';
From the above o/p
Sql query is "Delete from.." for that Operation is INSERT and vice versa.
Update is correct format only.
How to rectify this?
ThanksThanks for yor reply..
I am trying to get when the INSERT,UPDATE and DELETE query is issued..
For this i had created a table with 'ROWDEPENDENCIES'.
Then i issue a query
SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN),ID,NAME FROM emptest;
It shows except DELETED quey information..
I need to get DELETED query details also..
Using FLASHBACK we can retrive the deleted query info know?
For that only i tried in FLASHBACK_TRANSACTION_QUERY table.
It wont give full information..
I had tried AS OF clause
SELECT * FROM emptest AS OF TIMESTAMP
TO_TIMESTAMP('25-JAN-08 07.53.17 PM', 'DD-MON-YY HH:MI:SS AM')
The above query also doesn't display DELETED query details..
How to get when the record is got deleted?
Thanks -
Applying stylesheet to XMLType using SQL operator
How can I apply a stylesheet to a XMLType in the database using a SQL query?
I am using Oracle 9i Release 2.
I have seen it referenced in many different PDF's from Oracle but haven't
seen any code examples.
Any help would be very appreciated!
Best regards
Christer Nordvik
System DeveloperJust read the fabulous manual (in this case, A96616-01: Oracle9i API Reference - XDK and Oracle XML DB, page 24-9); or search for "transform". One of my working examples:
select data1.transform(xdburitype('/age/default.xslt').getxml(), NULL) from data1 data1; Make sure you use an alias for the table name (I just use the same name as the real table).
Age Jan -
Unable to execute Custom SQL operation using DB Adapter
The SQL function i used is
insert into QueueTable1 (select * from TQueueTable2)
I executed this successfully in PL/SQL developer But while using DBadapter in BPEL. Its failing. No instance is created.
I think the query is executed but haven't received response from DB.Seems like a bug.
tried with DB Adapter using Procedure, Function , eving using inserrt and update.
The data is not getting copied to second queue table. The query is running for a long time and instance also not getting created. -
I am doing a query where I need to use the operator IN. I do not know the syntax. If anyone have some samples to show me I will be grateful.
Thank youAlso ...... some more samples ..
select * from table_A where id IN (1,2,3) in case of integer
select * from table_A where id IN ('1','2','3') in case of varchar
Kris
Maybe you are looking for
-
Change Docs & VB02 Condition Types
Does anyone know of a way to enable change docs on VB02 condition records?? I see this is easily done via BADI's & ES on the VK** tcodes/Progs, but I have been unsuccessful at finding anything that ties to VB02 Listing/Exclusion condition types. Reg
-
with itunes installed on my computer it freezes/works slowly/it freezes trying to get to itunes store/it freezes working on word or excel....all in all it makes my laptop horrible. when i uninstall it the computer works just fine.......help
-
[CS2 JS] String Type Test
Below is a part of a script wherein I want to be able to test if the character is a number or letter. Anybody know how? Thanks... var myChar = myStory.paragraphs.item(h).characters.firstItem(); if (myChar.contents == "\d"){
-
Ipod touch charger work with a Kindle 3?
Will my Ipod touch charger work with a Kindle 3 3G?
-
I can not get my ipod touch slide button to unlock. I have turned on & off. I have rebooted. Nothing works.