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.
Similar Messages
-
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 -
How to operate multiple querys using DB Adapter and 'Execute Custom SQL'
I have a requirment that I need to create database adapter in your BPEL process with 'Execute Custom SQL' to operate multiple query in DB in one atomic
here are the details:
inbound request:
<ns1:Query_bpelProcessRequest>
<ns1:input>
<ns1:ItemDetail>
<ns1:ItemID>1123DDDS</ns1:ItemID>
</ns1:ItemDetail>
<ns1:ItemDetail>
<ns1:ItemID>1126EWWA</ns1:ItemID>
</ns1:ItemDetail>
<ns1:ItemDetail>
<ns1:ItemID>11208FSAA</ns1:ItemID>
</ns1:ItemDetail>
</ns1:input>
</ns1:Query_bpelProcessRequest>
I use for-each fuction in XSLT to mapping the all ItemID value:
<xsl:template match="/">
<xsl:for-each select="/tns:Query_bpelProcessRequest/tns:input/tns:ItemDetail">
<ns1:QueryFromDB_Input>
<ns1:ItemID>
<xsl:value-of select="tns:ItemID"/>
</ns1:ItemID>
</ns1:QueryFromDB_Input>
</xsl:for-each>
</xsl:template>
and in DB Adapter I use the 'Execute Custom SQL' to query the CONTENT value according the ItemID value:
select distinct CONTENT from agile.item where ITEM_NUMBER=’<ItemID>’
However, in the result, It only query the first item value for <ns1:ItemID>1123DDDS</ns1:ItemID>
<<QueryFromDB_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="QueryFromDB_Input_msg">
<QueryFromDB_Input xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/QueryFromDB" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/QueryFromDB">
<ns1:ItemID>1123DDDS</ns1:ItemID>
</QueryFromDB_Input>
</part></QueryFromDB_InputVariable>
<QueryFromDB_OutputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="QueryFromDB_OutputCollection">
<QueryFromDB_OutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/QueryFromDB">
<QueryFromDB_Output>
<ITEM_NUMBER>1123DDDS</ITEM_NUMBER>
<CONTENT >SJIFESSFFJ</CONTENT >
</QueryFromDB_Output>
</QueryFromDB_OutputCollection>
</part></QueryFromDB_OutputVariable>
the other two querys are not operated.
what can I do to operate multiple querys??
ThanksHi Rod,
I are using while loop and assign array inputvalue to the inputvarable of DBadapter now, but actually it doesn't work.
Throw expection
<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>XPath query string returns multiple nodes.
According to BPEL4WS spec 1.1 section 14.3, The assign activity part and query /client:ItemsQuery_bpelProcessRequest/client:input/client:inputDetail/client:ProductID["ItemIndex"] should not return multipe nodes.
Please check the BPEL source at line number "89" and verify the part and xpath query /client:ItemsQuery_bpelProcessRequest/client:input/client:inputDetail/client:ProductID["ItemIndex"].
Possible reasons behind this problems are: some xml elements has maxOccurs > 1 or the xml data is invalid according to XML Schema.
To verify whether XML data received by a process is valid, user can turn on validateXML switch at the domain administration page.
</summary>
</part></selectionFailure>
my inbound XSD:
<element name="ItemsQuery_bpelProcessRequest">
<complexType>
<sequence>
<element name="input" type="tns:inputType"/>
</sequence>
</complexType>
</element>
<complexType name="inputType">
<sequence>
<element name="inputDetail" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="ProductID" type="string" minOccurs="0"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<element name="ItemsQuery_bpelProcessResponse">
<complexType>
<sequence>
<element name="result" type="tns:outputType"/>
</sequence>
</complexType>
</element>
<complexType name="outputType">
<sequence>
<element name="ItemOutput" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="item_id" type="string" minOccurs="0"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
DB Adapter XSD:
<xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/QueryItem" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/QueryItem" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="QueryItem_Input" type="QueryItem_Input"/>
<xs:complexType name="QueryFrom_Input">
<xs:sequence>
<xs:element name="ProductID" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element name="QueryItem_OutputCollection" type="QueryItem_OutputCollection"/>
<xs:complexType name="QueryItem_OutputCollection">
<xs:sequence>
<xs:element name="QueryItem_Output" type="QueryItem_Output" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QueryItem_Output">
<xs:sequence>
<xs:element name="item_id" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
the bpel assign:
<assign name="Initial_Index">
<copy>
<from expression="0"/>
<to variable="ItemIndex"/>
</copy>
</assign>
<while name="While_1"
condition="bpws:getVariableData('ItemIndex')<ora:countNodes('inputVariable','payload','/client:ItemsQuery_bpelProcessRequest/client:input/client:inputDetail/client:ProductID)">
<sequence name="Sequence_1">
<assign name="Assign_QueryInput">
<copy>
<from variable="inputVariable" part="payload"
query='/client:ItemsQuery_bpelProcessRequest/client:input/client:inputDetail/client:ProductID{bpws:getVariableData('ItemIndex')}'/>
<to variable="QueryItem_InputVariable"
part="QueryItem_nput_msg"
query="/ns2:QueryItem_Input/ns2:ProductID"/>
</copy>
</assign>
<invoke name="Invoke_QueryDB" partnerLink="QueryItem"
portType="ns1:QueryItem_ptt"
operation="QueryItem_PSFT"
inputVariable="QueryItem_InputVariable"
outputVariable="QueryItem_OutputVariable"/>
<assign name="Assign_Output">
<copy>
<from variable="QueryItem_OutputVariable"
part="QueryItem_OutputCollection"
query="/ns2:QueryItem_OutputCollection/ns2:QueryItem_Output/ns2:item_id"/>
<to variable="outputVariable" part="payload"
query='/client:ItemsQuery_bpelProcessResponse/client:result/client:ItemOutput/client:item_id{bpws:getVariableData('ItemIndex')}'/>
</copy>
<copy>
<from expression="bpws:getVariableData('ItemIndex')+1"/>
<to variable="ItemIndex"/>
</copy>
</assign>
</sequence>
</while>
I use {} instead of [] for array, because [] seams not reveal in this message board
seems I can't assign array values to the DB inputvalue, Are there any solutions for this ?
I still haven't found any way for operating multiple querys using DB Adapter.
Thanks
Edited by: user1065212 on 07-Jan-2010 19:39
Edited by: user1065212 on 07-Jan-2010 19:41
Edited by: user1065212 on 07-Jan-2010 19:44
Edited by: user1065212 on 07-Jan-2010 19:45 -
Using information from ItResource for executing custom sql in OIM 11g
I need executing a custom sql query using a connection of a ItResource. How can I get the instance of connection for to execute the sql query ? Someone have a idea of how i make this ? Help me ...
TksHashMap itAttribute = new HashMap();
itAttribute.put("IT Resources.Name","IT-DB01");
tcITResourceInstanceOperationsIntf itResource=null;
tcResultSet resItResKey;
resItResKey = itResource.findITResourceInstances(itAttribute);
long iTesourceKey = resItResKey.getLongValue("IT Resource.Key");
tcResultSet resItRes = itResource.getITResourceInstanceParameters(iTesourceKey);
Append following lines:-
HashMap<String, String> hashMap = new HashMap<String, String>();
int countResultGetITResourceInstanceParameters = resItRes .getRowCount();
for(int i = 0; i < countResultGetITResourceInstanceParameters; i++) {
resultGetITResourceInstanceParameters.goToRow(i);
hashMap.put(
resItRes .getStringValue(ZAPConstants.IT_RESOURCES_TYPE_PARAMETER_NAME),
resItRes .getStringValue(ZAPConstants.IT_RESOURCES_TYPE_PARAMETER_VALUE)
return hashMap; -
Execute custom SQL in DB Adpater errors out in Production - urgent please.
Hi,
I get this error when running the process in PROD at invoking delete operation that I'm doing by selecting the execute custom SQL option while defining the DB adapter. It worked fine in TEST environment but errors out in PROD env.
Any suggestions on why? Its urgent.
Thanks
-Prapoorna
The state of this instance is Faulted
<messages><input><InvokeDelete_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DeleteDataInput_msg"><DeleteDataInput xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/DeleteData"/>
</part></InvokeDelete_InputVariable></input><fault><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>17410</code>
</part><part name="summary"><summary>file:/prod/app/bpel/as/bpel/domains/verint/tmp/.bpel_SynchOTLLoad_1.0_0259c5f142631959ec0fb067d23fe98e.tmp/DeleteData.wsdl [ DeleteData_ptt::DeleteData(DeleteDataInput_msg) ] - WSIF JCA Execute of operation 'DeleteData' failed due to: Pure SQL Exception.
Pure SQL Execute of delete from xxhxc_timeattend_to_otl where report_date >= TRUNC(ADD_MONTHS(sysdate, -1),'MM') failed. Caused by java.sql.SQLException: No more data to read from socket.
; nested exception is:
ORABPEL-11633
Pure SQL Exception.
Pure SQL Execute of delete from xxhxc_timeattend_to_otl where report_date >= TRUNC(ADD_MONTHS(sysdate, -1),'MM') failed. Caused by java.sql.SQLException: No more data to read from socket.
The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead.
</summary>
</part><part name="detail"><detail>No more data to read from socket</detail>
</part></remoteFault></fault></messages>Looks like in production you have much more data than you do in your test environments.
It could be something wrong with your rollback segments. Is there any other activity happening when this is running?
What happens when you run this command inside SQLPlus?
cheers
James -
Possible to execute custom SQL query?
Is it possible to execute a custom SQL query and get back a collection of
objects with Kodo JDO? Query expression languages like JDOQL are all very
well (I actually think JDOQL is pretty messy), but sometimes when you've
got a complex query (and you know you're using a RDBMS) it is best
accomplished in a SQL statement. I see Kodo has extended JDOQL, which is
good, but developing custom extensions seems to be limited to implementing
kodo.jdbc.query.JDBCFilterListener where you can customise the where
clause. What I want to be able to do is to specify the entire SQL string.
I am looking into using Kodo JDO for my organisation, and being able to
use custom SQL is something i would expect (and something we can do with
our current O/R mapping product (TopLink)).
Regards,
AlexPatrick Linskey wrote:
On Tue, 30 Sep 2003 10:57:13 +0000, Alex wrote:
being able to use custom SQL is something i would expect
We absolutely agree. Take a look at the samples/customSQL example in the
Kodo distribution.
-Patrick
Patrick Linskey
SolarMetric Inc.Hi Patrick,
I have downloaded kodo-jdo-3.0.0RC1 for windows for evaluation, but there
is no samples/customSQL directory.
Alex. -
Execute custom SQL query in OIM11g
Hi,
Can you please provide me some java code snippet to execute a custom sql query and also to get db connection to execute this query in OIM 11g. I am going to run this query in an adapter.
Thanks a lot for ur help.
MikeHey Mike,
Use the below sample code to get db connection and then to execute a query in OIM11g.
String query = "SELECT UD_ADUSER_EMAIL FROM UD_ADUSER WHERE upper(UD_ADUSER_UID) like '%TESTU%'";
Connection con = Platform.getOperationalDS().getConnection();
PreparedStatement preparedStatement = con.prepareStatement(query);
ResultSet resultSet = preparedStatement.executeQuery();
while(resultSet.next())
System.out.println("Output:"+resultSet.getString(1));
} -
Execute Dynamic SQL statement using procedure builder
i want to execute a dynamic SQL statment using procedure builder not using forms
because my statement depending on a variable table name
i know that i can do that from forms using
FORMS_DDL('SQL_STAT');
but i wanna to use the procedure builder
which function i should use and how?
please explain in example if you don't mind.
thanksHi,
You can very well use DBMS_SQL Package supplied by Oracle for doing this.
Search for DBMS_SQL in OTN. You will get all info regarding this.
Regards.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by itslul:
i want to execute a dynamic SQL statment using procedure builder not using forms
because my statement depending on a variable table name
i know that i can do that from forms using
FORMS_DDL('SQL_STAT');
but i wanna to use the procedure builder
which function i should use and how?
please explain in example if you don't mind.
thanks<HR></BLOCKQUOTE>
null -
Unable to retreive the return value of pl/sql function using DB Adapter
Dear Experts,
I am using DB Adapter in my BPEL Process. Using DB Adapter I am invoking a PL / SQL function. I am able to send two input parameters for the pl/sql function. But I dont know how to retrieve the return value from the function. Please suggest me.
Thanks,
RajeshYes I am returning a value from PL/SQL function.
Please see the code segments below,
FUNCTION "TD_INSERT" (a TDINIT_TYPE, stops TDDETAIL_TABLE )
RETURN VARCHAR2
AS
td_no Number;
td_id Number;
stop TDDETAILFULL_TYPE;
length number;
BEGIN
insert into TD_INIT values( ----passing all the values here --------- );
select max(tdno) into td_no from TD_INIT ;
length := stops.count;
for i in 1.. length loop
stop := stops(i);
insert into TD_DETAIL_FULL values(
td_no, ------- );
end loop;
commit;
RETURN td_no;
END;
Thanks,
Rajesh -
How to specify custom SQL in polling db adapter with logical delete option
Hi all,
I am writing a SOA composite app using JDeveloper SOA Suite 11.1.1.4 connecting to a SQL Server db using a polling DB Adapter with the logical delete option to send data to a BPEL process.
I have requirements which go beyond what is supported in the JDeveloper UI for DB Adapter polling options, namely:
* update more than one column to mark each row read, and
* specify different SQL for the logical delete operation based on whether bpel processing of the data polled was successful or not.
A complicating factor is that the polling involves two tables. Here is my full use-case:
1) Polling will select data derived from two tables: e.g. 'headers' and 'details' simplified for this example:
table: headers
hid - primary key
name - data label
status - 'unprocessed', 'processed', or 'error'
processedDate - null when data is loaded, set to current datetime when row is processed
table: details
hid - foreign key pointed at header.hid
attr - data attribute name
value - value of data attribute
2) There is a many:1 relationship between detail and header rows through the hid columns. The db adapter polling SELECT shall return results from an outer join consisting of one header row and the associated detail rows where header.status = 'unprocessed' and header.hid = details.hid. (This is supported by the Jdeveloper UI)
3) The polled data will be sent to be processed by a bpel process:
3.1) If the bpel processing succeeds, the logical delete (UPDATE) operation shall set header.status = 'processed', and header.processedDate = 'getdate()'.
3.2) If bpel processing fails (e.g. hits a data error while processing the selected data) the logical delete (UPDATE) operation shall set header.status = 'failed', header.processedDate = 'getdate()', and header.errorMsg = '{some text returned from bpel}'.
Several parts of #3 are not supported by the JDeveloper UI: updating multiple columns to mark the row processed, using getdate() to populate a value of one of those column updates, doing different update operations based on the results of the BPEL processing of the data (success or error), and using data obtained from BPEL processing as a value of those column updates (error message).
I have found examples which describe specifying custom SQL using the polling delete option to create a template then modifying the toplink file(s) to specify custom select and update SQL to implement a logical delete. (e.g. http://dlimiter.wordpress.com/2009/11/05/advanced-logic-in-oracle-bpel-polling-database-adapter/ and http://myexperienceswithsoa.blogspot.com/2010/06/db-adapter-polling-tricks.html). But none of them match what I've got in my project, in the first case because maybe because I'm using a higher version of JDeveloper, and in the second I think because in my case two tables are involved.
Any suggestions would be appreciated. Thanks, JohnHi John,
You've raised a good scenario.
First of all let me say that the purpose of the DB polling transaction, is to have an option to initiate a process from a DB table/view and not to update multiple fields in a table (or have other complex manipulation on the table).
So, when choose to update a field in a record, after reading it, you are "telling" the engine not to poll this record again. Sure, i guess you can find a solution/workaround for it, but I don't think this is the way....
The question now is what to do?
You can have another DB adapter where you can update the data after finishing the process. In that case, after reading the data (on polling transaction) - update the header.status = 'processed' for example, and after processing the selected data update the rest of the fields.
Hope it make some sense to you.
Arik -
Can we call and execute a request set using db adapter or oracle apps adapt
Hi,
Can we call and execute a request set(which executes a set of packages in a sequence) using db adapter or oracle apps adapter similar to calling a stored procedure and concurrent program?
thanks,
RV1) In BPEL call the DBAdapter in a sequence, make sure you set the partnerlink 'property' to transaction=participate.
2) Or create a package that calls the other packages in a sequence
Marc
http://orasoa.blogspot.com -
Parameter passing to custom SQL query using PL/SQL FUNCTION
Hi
In order to pass a parameter to the query in custom folder of a business area I created a function and mapped it to the Custome query using Discoverer Desktop. There is no error in mapping as the system does not throw any error. When I am inputting the Parameter for the input values everytime the query doesnot return any rows.
Can anybody help in this regardHi,
I need to take the request Id as input from the user and then fetch only the data pertaining to that requet Id. As a lot of complex joins are involved I need to pass request id as parameter to the custome folder.
The package i greated:
CREATE OR REPLACE PACKAGE SETPARAM
AS
param1 varchar2(25);
param2 varchar2(25);
FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER ;
FUNCTION GET_PARAM1 RETURN varchar2;
END SETPARAM;
CREATE OR REPLACE PACKAGE BODY SETPARAM AS
FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER IS
BEGIN
fnd_client_info.set_org_context('138');
param1 := p1;
dbms_output.put_line(param1);
RETURN 1;
END;
FUNCTION GET_PARAM1 RETURN varchar2 AS
BEGIN
RETURN param1;
END;
END SETPARAM;
I registered the set_param1 function as a pl/sql function in discoverer admin.
This function is called on the condition associated with the parameter in Discoverer Desktop when i run the report.
In the custom folder query i have this piece in the where clause
WHERE tnfo.request_id = NVL(APPS.SETPARAM.GET_PARAM1,7383588)
And everytime i get the data pertaining to request id =7383588,
Please suggest where i went wrong
thanks
Ashwini -
How to execute the *.sql when using occi and vc
help me!
i must to initialize the remote database using the file of sql,
for example:
the file is ss.sql;
and it is
"DECLARE
row integer := 0;
user varchar2(256);
BEGIN
user := '&1';
dbms_java.grant_policy_permission('PUBLIC', 'SYS',
'java.lang.RuntimePermission', 'loadLibrary.*', row);
dbms_java.grant_permission(user, 'SYS:java.lang.RuntimePermission',
'loadLibrary.orawcom10', null);
dbms_java.disable_permission(row);
dbms_java.delete_permission(row);
EXCEPTION
WHEN OTHERS THEN
IF row > 0 THEN
dbms_java.disable_permission(row);
dbms_java.delete_permission(row);
END IF;
RAISE;
END;"
i use the occi statement
Environment * env;
Connection * conn;
Statement * stmt;
env=Environment::createEnvironment(Environment::DefaultEnvironment);
conn=env->createConnect(user_name,pwd,db_name);
string sqlstmt=''BEGIN ss.sql;END";
stmt=conn->createStatement(sqlstmt);
it is wrong
how do i change the sql statement???Hi,
Instead of having the PL/SQL code as an anonymous block, you can create
a procedure and then execute it through OCCI.
For example:
create or replace procedure my_proc
is
row integer := 0;
user varchar2(256);
begin
--code here...
end;
I assume this code will be in ss.sql. Compile this procedure in
your schema and then form the sqlstmt in OCCI this way:
Statement *stmt = con->createStatement("BEGIN my_proc; END;") ;
Rgds.
Amogh -
Unable to execute an update statement using CallableStatement
Hi there,
I'm trying to run an update statement from JUnit using java.sql.CallableStatement and oracle.jbo.server.DBTransaction.
String updateSql =
"update footable set barcol=TO_DATE('12-SEP-09','dd-MM-yy') where bazcol = 505";
try {
statement =
applnModule.getDBTransaction().createCallableStatement(updateSql,
2);
int executeUpdate = statement.executeUpdate();
AppsLogger.write(this,
"# records UPDATED ------------------>" + executeUpdate,
AppsLogger.SEVERE);
} catch (SQLException s) {
s.printStackTrace();
Assert.fail("Encountered SQL Exception: " + s);
} finally {
try {
if (statement != null)
statement.close();
} catch (SQLException s) {
}Below is the exception I get when I run the above code. There is no problem with the SQL - it works fine from SQLDeveloper.
java.lang.AssertionError: Encountered SQL Exception: java.sql.SQLDataException: ORA-01858: a non-numeric character was found where a numeric was expected
org.junit.Assert.fail(Assert.java:91)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.invokeTestMethod(AtfJUnit4JTestCaseClassRunner.java:362)
oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.runMethods(AtfJUnit4JTestCaseClassRunner.java:272)
oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner$1.run(AtfJUnit4JTestCaseClassRunner.java:265)
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.run(AtfJUnit4JTestCaseClassRunner.java:262)Edited by: 911023 on Oct 2, 2012 11:28 AM
Edited by: 911023 on Oct 2, 2012 11:30 AMUsing case statement.
UPDATE gor_gold_post
SET hoov_flag = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 304
OR
(TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
THEN 1
ELSE 99
END,
b49n = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 121.6
OR
(TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
THEN 1
ELSE 99
END
WHERE tariff_code IN (169, 135, 136);Note: Code not tested. -
How to dynamically execute generated SQL statements using 11gR2 ?
Hello,
I'd like to know if it is possible to do what the following statement intended to do:
select * from (select replace('select empno from emp',
'') from dual);in other words, is it possible to dynamically generate and execute a select statement in a from clause ?
thank you for your help,
John
Edited by: 440bx on Jul 16, 2010 3:57 PM changed "generate" to "generated" in subjectHello Aketi,
That is totally WICKED !!
I've been playing with the code you posted, pretty much since you did, trying to figure out how it works. I have some idea of how it works now but, I cannot figure out why I get the set of results, not once but TWICE.
When I run the query you posted above, this is what I get:
SQL> @getxml2
TABLE_NAME count
CLOB_EXAMPLE 1
D42 1
DEPT 4
DEPT_2 0
DEPT_ACCIDENTS 6
DEPT_EAST 2
... some tables deleted to shorten the output
T1 1
T10 10
T100 0
22 rows selected.
TABLE_NAME count
CLOB_EXAMPLE 1
D42 1
DEPT 4
DEPT_2 0
DEPT_ACCIDENTS 6
DEPT_EAST 2
... some tables deleted to shorten the output
T1 1
T10 10
T100 0
22 rows selected.
SQL>The result is shown TWICE. I cannot figure out why. Any ideas as to why the result is shown twice ? (I ran the statement from SQL*Plus and started a fresh instance of SQL*Plus to ensure that no settings from previous scripts would be the cause).
Thank you for your help, great little piece of code!
John.
Edited by: 440bx on Jul 16, 2010 5:30 PM
Edited by: 440bx on Jul 16, 2010 5:31 PM - corrected name in Hello greeting
Edited by: 440bx - 11gR2 on Jul 17, 2010 2:55 AM - corrected misspelling
Edited by: 440bx - 11gR2 on Jul 17, 2010 2:56 AM - corrected another misspelling
Maybe you are looking for
-
Error during deploying PDK 6.0 sp14
HI, I am geeting error while deploying PDK (Portal Development Kit 6.0) <u><b>ERROR:</b></u> Caught exception during application deployment from SAP J2EE Engine's deploy service: java.rmi.RemoteException: Cannot deploy application sap.com/TestSuiteUU
-
File download element in confirmation dialog box
Hi, Can I use File Download elements in Confirmation Dialog Box?Please raply me as early as possible. Regards Aniruddha
-
After installing arch linux I noticed laggy responce with the console. For instance, when I type ls in my home directory it'll sometimes take 2-5 seconds before it'll list the contents. Is this because it's using reiserfs or devfs? I assumed they
-
Netra t1 105 install solaris9 from terminal session
I have quite a problem, I am using a windows box hyper terminal into a netra t1 105 box and am able to boot up and log into the system, however as i am on a windows box i dont have the stop-a button to press when i power it down so as to boot from cd
-
HR data transfer toolkit_ SAP Best practice
Hi All, I got to know the New toolkit for HR Data Transfer in which SAP has provided the Built in Excel sheets for the certain Infotypes..I got the document through online. But am not able to use the transactions ..can any one help me out ..from w