Use of sql group function in orcl:query-database - urgent

All,
Version: 10.1.3.4
Two requirements for me:
1. I want to use sum function in orcl:query-database. How to use it?
For ex: I tried the following
<xsl:value-of select='orcl:query-database("select sum(salary) from emp",false(),false(),"jdbc/DB1")'/>
I got the following error
oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an XML tag name.
When I tried without sum function, it works fine
2. I used the same table, but without the sum function as below
<xsl:value-of select='orcl:query-database("select salary from emp",false(),false(),"jdbc/DB1")'/>
This time, it returns the first employees salary!! I dont understand this logic. I expected either the query returns all the rows else it throws error, but none of them were true!
Can anyone pls explain what is the behavior? I want your reply for both the queries!
Currently I'm in a project where I'm working in the similar scenario, so please guru's let me know ASAP.
Thanks,
Sen

Hi Sen,
Create a normal variable variable in XSLT.
Then use that variable.
I mean variable name='Var_1' select='Your Query'
Now use Var_1/yourcollection/...
I am giving some example
<xsl:variable name="Stopdetails" select="/ns0:MyEBM/ns0:DataArea/ns0:MyEBO/ns0:Stops/ns0:Stop[ns0:StopID=$TempStopId]"/>
            <xsl:variable name="AccStopTypeVar">
                    <xsl:value-of select="$Stopdetails/ns0:StopType"/>
</xsl:variable>If you want you can loop on the created variable.
You can do these in XSL.
But DB calls those things ...it would be better , if u take them out. Spme debugging problems are there with XSL.
Regards
PavanKumar.M

Similar Messages

  • Orcl:query-database gives error when using to_char function in select stmt

    hi
    Use Case : We get a csv file ("bank_import_<MMDDYYYYY>.csv") from the bank containing the transactions occured for the month. The date in the filename is retrieved into string and i need to convert this string to the format "MON-DD-YYYY". This is the required format for an header table which takes this string as primary key.
    Code:
    statement_name = '11302206'.........
    <copy>
    <from expression="concat("'select to_char(to_date('",bpws:getVariableData('statement_name') ,"','MMDDYYYY'),'MON-DD-YYYY') from dual'")"/>
    <to variable="xpath"/>
    </copy>
    <copy>
    <from expression="orcl:query-database(bpws:getVariableData('xpath'),false(),false(),'jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI')"/>
    <to variable="statement_name"/>
    </copy>
    Error:
    [2006/12/06 19:13:04] Updated variable "xpath" less
    <xpath>'select to_char(to_date('10302006','MMDDYYYY'),'MON-DD-YYYY') from dual'</xpath>
    [2006/12/06 19:13:04] "XPathException" has been thrown. less
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI")", the reason is .
    Please verify the xpath query.
    Log Message:
    <2006-12-06 19:13:04,595> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::evaluate> XPathQuery[concat("'select to_char(to_date('", bpws:getVariableData("statement_name"), "','MMDDYYYY'),'MON-DD-YYYY') from dual'")], XPath Result: class=java.lang.String value='select to_char(to_date('10302006','MMDDYYYY'),'MON-DD-YYYY') from dual'
    <2006-12-06 19:13:04,595> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::initXPath> namespaceMapping is: rootMap: {bpws=http://schemas.xmlsoap.org/ws/2003/03/business-process/, xp20=http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20, ns4=http://xmlns.oracle.com/pcbpel/adapter/db/top/BAIBankUpload, ldap=http://schemas.oracle.com/xpath/extension/ldap, xsd=http://www.w3.org/2001/XMLSchema, ns5=http://xmlns.oracle.com/pcbpel/adapter/file/, client=http://xmlns.oracle.com/BAI_BankUpload, ora=http://schemas.oracle.com/xpath/extension, ns1=http://xmlns.oracle.com/pcbpel/adapter/file/readBAIBankImportCSV/, ns3=http://TargetNamespace.com/readBAIBankImportCSV, ns2=http://xmlns.oracle.com/pcbpel/adapter/db/Insert_SI_CE_STATEMENT_LINES_INT/, bpelx=http://schemas.oracle.com/bpel/extension, orcl=http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc, =http://schemas.xmlsoap.org/ws/2003/03/business-process/}
    scopedMap: {}
    <2006-12-06 19:13:04,751> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::evaluate> XPathQuery :orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croakercom:1529:RSICMI")
    org.collaxa.thirdparty.jaxen.FunctionCallException
         at org.collaxa.thirdparty.jaxen.FunctionCallException.fillInStackTrace(FunctionCallException.java:124)
         at java.lang.Throwable.<init>(Throwable.java:195)
         at java.lang.Exception.<init>(Exception.java:41)
         at org.collaxa.thirdparty.jaxen.saxpath.SAXPathException.<init>(SAXPathException.java:83)
         at org.collaxa.thirdparty.jaxen.JaxenException.<init>(JaxenException.java:82)
         at org.collaxa.thirdparty.jaxen.FunctionCallException.<init>(FunctionCallException.java:86)
         at oracle.tip.pc.services.functions.ExtFuncFunction$QueryDatabaseFunction.call(ExtFuncFunction.java:190)
         at org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:184)
         at org.collaxa.thirdparty.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:724)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodes(BaseXPath.java:253)
         at org.collaxa.thirdparty.jaxen.BaseXPath.evaluate(BaseXPath.java:210)
         at com.collaxa.cube.xml.xpath.XPathUtil.evaluate(XPathUtil.java:93)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.evalFromValue(BPELAssignWMP.java:501)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:122)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
         at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Root cause:
    java.lang.ClassCastException
         at oracle.tip.pc.services.functions.ExtFuncFunction$QueryDatabaseFunction.call(ExtFuncFunction.java:158)
         at org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:184)
         at org.collaxa.thirdparty.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:724)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodes(BaseXPath.java:253)
         at org.collaxa.thirdparty.jaxen.BaseXPath.evaluate(BaseXPath.java:210)
         at com.collaxa.cube.xml.xpath.XPathUtil.evaluate(XPathUtil.java:93)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.evalFromValue(BPELAssignWMP.java:501)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:122)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
         at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-12-06 19:13:04,751> <ERROR> <UAT.collaxa.cube.xml> ORABPEL-09500
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI")", the reason is .
    Please verify the xpath query.

    Hi,
    QAbdul wrote:
    when I tried to execute the followingin XMLQuery by calling TO_CHAR() whithin this query I am getting this error"ORA-19237: XP0017 - unable to resolve call to function - fn:TO_CHARTO_CHAR is a SQL function, XQuery is unaware of it.
    XPath 2.0 specifications define a fn:format-date function but Oracle has not included yet in its XQuery implementation.
    Easiest way to go is A_Non's solution, but if you need to format at multiple places in the query, you can declare a local XQuery function.
    For example, to format to "DD/MM/YYYY" from the canonical xs:date format "YYYY-MM-DD" :
    {code}
    declare function local:format-date($d as xs:date) as xs:string
    let $s := xs:string($d)
    return concat(
    substring($s, 10, 2), "/",
    substring($s, 7, 2), "/",
    substring($s, 2, 4)
    {code}
    and an example of use :
    {code}
    SQL> CREATE TABLE test_xqdate AS SELECT sysdate dt FROM dual;
    Table created
    SQL> SELECT *
    2 FROM XMLTable(
    3 'declare function local:format-date($d as xs:date) as xs:string
    4 {
    5 let $s := xs:string($d)
    6 return concat(
    7 substring($s, 10, 2), "/",
    8 substring($s, 7, 2), "/",
    9 substring($s, 2, 4)
    10 )
    11 }; (: :)
    12 for $i in ora:view("TEST_XQDATE")/ROW/DT
    13 return element e {
    14 attribute xs_date_format { $i/text() },
    15 attribute local_format { local:format-date($i) }
    16 }'
    17 COLUMNS
    18 xs_date_format VARCHAR2(10) PATH '@xs_date_format',
    19 local_format VARCHAR2(10) PATH '@local_format'
    20 )
    21 ;
    XS_DATE_FORMAT LOCAL_FORMAT
    2010-10-28 28/10/2010
    {code}

  • XPath function orcl:query-database usage

    According to the limited documentation I can find for this XPath function, I should be able to return a nodeset enclosed in xml elements -
    "Returns a node-set by executing the sql-query against the specified database. The second parameter rowset indicates if the rows should be enclosed in a element. The third parameter row indicates if each row should be enclosed in a element."
    However, whatever second and third parameters I pass in to this function, it always returns a single string consisting of the selected fields and rows concatenated together.
    Does anyone know how (or if) I can use this function to return a resultset as an XML nodeset? (All the examples I've been able to find for this function set the second & third parameters = false())

    Try this example (it uses internal orabpel table):
    orcl:get-content-as-string(orcl:query-database('select id, process_instance from bpel_variable_sensor_values where id < 30',true(),true(),'jdbc/BPELServerDataSourceWorkflow'))
    it generates something like this (string):
    <ROWSET> <ROW num="1"> <ID>23.0</ID> <PROCESS_INSTANCE>21.0</PROCESS_INSTANCE> </ROW> <ROW num="2"> <ID>25.0</ID> <PROCESS_INSTANCE>21.0</PROCESS_INSTANCE> </ROW> <ROW num="3"> <ID>27.0</ID> <PROCESS_INSTANCE>21.0</PROCESS_INSTANCE> </ROW> <ROW num="4"> <ID>29.0</ID> <PROCESS_INSTANCE>21.0</PROCESS_INSTANCE> </ROW> </ROWSET>
    or define this element type in your wsdl file (or your xsd):
    <element name="ROWSET">
    <complexType>
    <sequence>
    <element name="ROW">
    <complexType>
    <sequence>
    <element name="ID" type="string"/>
    <element name="PROCESS_INSTANCE" type="string"/>
    </sequence>
    <attribute name="num"/>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    and try to assign the output to variable of that type(without orcl:get-content-as-string). It should work.

  • Query Syntax Bug in orcl:query-database function

    Hi,
    I have a 'Transform' process activity, I have a Description and I intend to get the corresponding Id on the basis of the "text Description".
    e.g.
    Input: "Jack"
    table: EMP [i.e. Employee Table]
    Expected Query: SELECT EMP_ID FROM EMP WHERE EMP_NAME = "Jack"
    <SNIP>
    <ns0:empId>
    <xsl:value-of select="orcl:query-database('SELECT EMP_ID FROM EMP WHERE EMP_NAME="Jack"', false(), false(), 'jdbc:oracle:thin:soaadmin/soaadmin@localhost:1521:XE')"/>
    </ns0:empId>
    </SNIP>
    Presently Resulting as:
    oracle.xml.sql.OracleXMLSQLException: ORA-00904: "Jack": invalid identifier
    Details:
    It seems that it is not accepting quotes in the query.
         - I tried escaping quote however it did not work.
         - I tried giving " or amp;quot; or " - nothing worked.
    Please Suggest me something on this.
    regards
    Joy

    How about:
    <ns0:empId>
    <xsl:value-of select="orcl:query-database('SELECT EMP_ID FROM EMP WHERE EMP_NAME=&amp;apos;Jack&amp;apos;', false(), false(), 'jdbc:oracle:thin:soaadmin/soaadmin@localhost:1521:XE')"/>
    </ns0:empId>
    ?

  • Orcl:query-database ERROR

    I am getting following error when I use orcl:query-database() function. JNDI name is correct and working for DB adapters. I dont knwo whats wrong with this..
    <subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>XPathExecutionError</code>
    </part><part name="summary"><summary>XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:query-database('select testan_s.nextval from dual',false(),false(),'eis/DB/TEST)", the reason is message can't be null.
    Please verify the xpath query.
    </summary>
    </part></subLanguageExecutionFault>

    Using JNDI name gives this freak error. If you use jdbc url string then it works in the last parameter.
    It is really sad that these kind of simple functions are not working even in 10.1.3.3 which makes it very difficult to design the process in a simple way.
    When will these will be fixed? is there any workaround? I need to use this in XSL transformations. any one has a clue?

  • Orcl:query-database in transform

    Hi,
    Suppose I am assigning the result of following to a field EmpId on the right had side of the transformation.
    orcl:query-database(concat("select empno from emp where empno=",/tns:Root-Element/tns:Data/:tns:Empno),false(),false(),"jdbc/DbConnection")
    Couple questions.
    1) Can I use the above result in any subsequent queries in transformation, say get salary for this EmpID?
    2) I am also worried about performance with this, as it doesn't look like the Empno is passed as a bind variable.
    3) Is it possible to get the above query into a variable to be able to reuse later?
    Appreciate your help.
    Thanks

    1) You cannot use for subsequent queries in transformation. Every time you need to define this function....
    2) Performance may be an issue if transaction load is higher. You can see the time it takes for transform activity on BPEL Console.
    3) You should be able to. Just go to Expression Builder in Assign activity and write orcl and ctrl+space. You should be able to view the options. This may help you http://blogs.oracle.com/rammenon/2007/05/passing_bpel_variable_contents.html

  • PL/SQL equivalent of T-SQL - "group function is not allowed here"

    Hi all, hope someone can give me a hand as I'm pretty stuck! I have been trying to convert some MS SQL Server T-SQL statements into Oracle PL/SQL and am stuck on the below one:
    SELECT
    CA.AssessmentID,
    (SELECT ProductName + ISNULL(' - ' + PrincipalBenefit,'')
    FROM rptPolicySnapshot WHERE PolicyID = MAX(CA.PolicyID)
    AND SnapshotID = 1),
    MAX(CA.PolicyID)
    FROM rptClaimInvoiceLineSnapshot CIL
    INNER JOIN rptClaimAssessmentSnapshot CA
    ON CIL.AssessmentID = CA.AssessmentID
    AND CIL.SnapshotID = CA.SnapshotID
    WHERE CIL.SnapshotID = 1
    GROUP BY CA.AssessmentID
    This works fine in MSSQL but returns the below error in Oracle:
    'ORA-00934: group function is not allowed here'
    If I take out the subquery the query works fine.
    Any ideas as to the syntax? I am new to Oracle so not sure as to how I should go about writing this.
    Thanks in advance!
    Leo

    WITH x AS (SELECT   ca.assessmentid,
                        MAX (ca.policyid) policy_id
               FROM rptclaiminvoicelinesnapshot cil
                    INNER JOIN rptclaimassessmentsnapshot ca
                        ON cil.assessmentid = ca.assessmentid
                       AND cil.snapshotid = ca.snapshotid
               WHERE cil.snapshotid = 1
               GROUP BY ca.assessmentid
    SELECT x.assessment_id,
           x.policy_id,
           productname + decode(principalbenefit,null,null,' - ' || principalbenefit ) prodname
    FROM   rptpolicysnapshot, x
    WHERE  policyid = x.policy_id
    AND    snapshotid = 1I think that's in the neighbourhood.

  • Sql group function

    I am trying to calculate the average cost of the books for each customer. The output should contain the customer#, name and the average order.
    This is the code I have:
    SELECT AVG(SUM((retail-cost)*quantity))
    FROM orders JOIN orderitems USING (order#)
    JOIN books USING (isbn)
    JOIN customers USING (customer#)
    GROUP BY order#, customer#;
    I get either, over 8000 for the average order or about 33 for the average order when I don't include the name, customer number or anything else in the code. If I add any other information, I get:
    SELECT customer#, AVG(SUM((retail-cost)*quantity))
    ERROR at line 1:
    ORA-00937: not a single-group group function
    I'm sure there is something small that I am missing, but cannot see it.

    Hi,
    Whenever you have a question, you should post a little sample data and the results you want to get from that data.
    I don't know where you're coming from, or where you want ot go, so it's hard to give you good directions. All I have is your current route plan, which must be incorrect, or else you wouldn't be asking anything.
    I see you are nesting aggregate functions. That's very rare in real life, and the result is always to produce one row of output, regardless of what's in the GROUP BY clause.
    I suspect you want to do a SUM in a sub-query, and then do AVG on the results in the main query. Without seeing your sample data and desired results, I'm just guessing.

  • Query used by SQL Server Management Pack for monitoring database backups

    I use SCOM 2012 R2 and the SQL Server Management Pack to monitor SQL Server database backups. I believe I am getting false positives. SCOM reports database are not backuped, while in fact they are. So I need to troubleshoot this. I suspect SCOM is querying
    the backup history in the msdb database. I want to know which query SCOM uses.
    I have tried looking in the monitor's definition but I suspect the query is embedded in the management pack files which are binary. I have also tried running a trace using the SQL Server Profiler on my test environment and overriding the interval to 60 seconds,
    but I don't see a relevant query being executed. I also don't see the alert reappear so I suspect SCOM does not honor the interval in a way I would expect.
    What query, or other method, does SCOM use to check database backups?
    Thanks in advance.

    Thank you both Ivan and Michael,
    I only saw your messages by email and didn't see your screen shot before I extracted the query myself. In my own queries I calculate the backup age in hours instead of days because of daily full backups. Perhaps It will be a good idea to create my own monitors
    from scratch like I used to do with Nagios.
    I will study the vbscripts and might create my own version which allows the query to be entered as an parameter and move all code to a .Net class which can be called from vbscript as an COM object. This way I hope to reduce the vbscript code to an minimum
    while keeping the flexibility of the SCOM Operations Console and the robustness of .Net. I suspect I want to make more non standard monitors in the future.
    Regards,
    Arjen

  • Use a SQL SERVER get date in query

    I want to constrain my returned data by a change date to just return the last rolling 30 days of data. When I use sysdate, I find the plan is to retreive ALL data across the dblink, and then filter it on the Oracle side.
    Is there any way I can use the Sql Server getdate() function, something like
    select * from remote@ss_link
    where upd_date >= getdate() - 30
    Problem - how do I get Oracle to pass the Sql Server specific function call to Sql Server? [BTW I'm on an old version of Oracle...]

    It depends on the product you are using.
    If you are using a gateway you can call remote functions using the getdate@<db link> syntax as described in the Heterogeneous Admin Guide.
    For gateways and generic connectivity you can also use PASSTHROUGH which allows you to pass a statement as it is to the remote database.
    Or at least you can create a view at the SQL Server side which returns the last 30 days and then just select from this view.

  • Use of SQL COLLATE functionality in IS

    Hi!
    In the developing of our Business Rules we have a validation that checks that the NAME1 for Customers is always entered in Upper Case letters.
    The issue is that not all our customers are entered in Latin Characters, so we use to have a function in our WHERE condition in SQL to handle this
    NAME1 COLLATE Latin1_General_CS_AS <> UPPER(NAME1)
    Is there any way to do this or something similar to this inside Information Steward? We would love to be able to handle this inside the Rule development in IS and don't have to handle it by Data Base view or something similar.
    Thanks!!
    Alberto Páez

    Hello Alberto ,
    Did you manage to find solution to the above issue ? I do have a similar scenario with vendor master where I am trying to fail all vendors which do not have all letters in upper cases .
    Please advise .

  • Problem with "&#34" using PL/SQL extract function ( XMLTYPE)

    Hi,
    When I use extract function (PL/SQL), it does not transform well "&#34". Insted of returning ' " ' , it returns ' &quot '.
    I know this works changing the code replacing xml.extract for SELECT extractvalue(xml,'//A/text()') into v from dual;
    But Is there another way to do this using PL/SQL? any patch, option..?
    Regards

    Hi,
    cursor proct is select * from proc22;
    cursor proct5 is select *from proc24;
    fetch proct into proctval;
    fetch proct5 into proctval5;
    if proct.symbol=proct5.symbolThat's strange to join two tables like this. You will have chance if you enter in your if condition.
    Why not create only one cursor with this join condition on the two tables ?
    re5:=re5/proctval.previousprice5;Furthermore, what do you make with r5 variable ? It seems nothing to do. Your proc does no much job.
    What do you want to achieve exactly ?
    Nicolas.

  • Group function in a query

    Hi all,
    I am practising on EBS vision installation, could you help me solve this error . .
    select
    ||
    || < some columns >
    ||
         pha.segment1 "PO Num",
         decode(pha.TYPE_LOOKUP_CODE,'BLANKET',pla.UNIT_PRICE*sum(plla.QUANTITY),null) "Rel",
         pla.LINE_NUM "Line",
    ||
    || < some columns >
    ||     
    from
         po_headers_all pha,
         po_lines_all pla,
    || <some tables>
    ||     
         po_line_locations_all plla
    where
         < Some Where Conditions . .. >
    Order by < do i have to mention all the other columns here....as many as they are >
    I am just not knowing how to handle the[b] sum(plla.quantity) in the decode function.
    do i have to use a funtion instead, or any other way ?
    Kindly help.

    If we want to include an aggregated value in a query we need to GROUP BY all the other columns. This is a pain, and ought to be unnecessary because SQL ought to be smart enough to derive the non-aggregated columns for itself, but that's not the way the standard is specified.
    You could think about putting the sum() in an inline view, but I suspect the WHERE clause will necessitate even more typing.
    Cheers, APC

  • Using orcl:query-database to return a number of Columns

    I have a BPEL process that is pulling data from some Database tables everything is working fine.
    I now need to perform a lookup on the database to pull in some additional information (3 additional attributes) within the stylesheet, where each attribute comes from a separate table.
    i.e.
    select a.col1, b.col1, c.col1
    from tab1 a
    ,tab2 b
    , tab3 c
    where a.col2 = b.col2
    and .......blah blah blah....
    I have used the orcl:database-query successfully to retrieve a single column and a single row and it works great.
    However i'd like to run the above query as one statement, rather than 3 separate queries.
    I've googled the fucntion for examples where it returns a nodelist or XML snippet, but to no avail.
    I've tried it before and couldn't get it to work.
    Does anyone have any examples.
    Thanks in advance.
    Stuart

    I have a BPEL process that is pulling data from some Database tables everything is working fine.
    I now need to perform a lookup on the database to pull in some additional information (3 additional attributes) within the stylesheet, where each attribute comes from a separate table.
    i.e.
    select a.col1, b.col1, c.col1
    from tab1 a
    ,tab2 b
    , tab3 c
    where a.col2 = b.col2
    and .......blah blah blah....
    I have used the orcl:database-query successfully to retrieve a single column and a single row and it works great.
    However i'd like to run the above query as one statement, rather than 3 separate queries.
    I've googled the fucntion for examples where it returns a nodelist or XML snippet, but to no avail.
    I've tried it before and couldn't get it to work.
    Does anyone have any examples.
    Thanks in advance.
    Stuart

  • Problem in using query-database() function in Transformation

    Hi All,
    I am using JDev and SOA 10.1.3.4.
    I have an async process.
    In that I am doing a transformation in which source is InputVariable and target is result.
    In Transformation I am using query-database function to fetch a record from DB and am assigning that to result.
    *<xsl:value-of select='orcl:query-database(concat("select ename from emp where empid=",/ns1:DBXSLProcessRequest/ns1:input),false(),false(),"jdbc:oracle:thin:scott/tiger@localhost:1521:abcd")'/>*
    I am not getting any error but query-database is not returning any thing I maen it is returning null.
    If i run that query in SQL prompt it is returning the empname.
    Please help me out.
    Regards
    PavanKumar.M

    Hi Pavan
    I tried following in BPEL transform actvity's XSL file, and it works fine and returns the sysdate for me.
    <xsl:value-of select='orcl:query-database("select sysdate from dual",false,false,"jdbc/myDS")'/>
    Can you try above in new XSL file of Transform activity and let me know its gives you the result? if it works you can start making changes according to your requirement.
    steps to follow:
    1.create connection pool in EM, and make sure its working fine by using test on connection pool.
    2.create Datasource and point to above created connection pool. and restart the oc4j_soa
    3.rename the xsl file name of transform activity in BPEL and use above query-database function.some times xsl files are cached even if you make changes it will not take effect so for testing if you rename it will be good.
    Thanks
    Seshagiri.Rayala
    http://soabpel.wordpress.com/

Maybe you are looking for

  • How can I successfully reapply the thermal paste in my MacBook Pro? (2008)

    I'm having issues with keeping my computer cool, mainly while playing games like SC2 that require a good amount of power. I've downloaded fan control apps, bought cooling pads (usb powered) and still no luck in cooling this thing down. I recently lea

  • ERP_H Component is not having Payment Card funtionality in CRM 7.0 Web UI

    Hi Experts, In ECC 6.0 while creating sales order in header we have "Payment Card" tab which can be used to enter credit card details and some authorization functionlity.  But this functionality is not available in ERP_H component.  I hope the Paymen

  • Fcp 7 - soundtrack pro 3.0.1

    trying to get my separate audio tracks into stp for a mix. I've exported for soundtrack. exported to aiff while locking out all the tracks I don't want at this time. I want two tracks @ a time and have dozens in some places. How do I get my separate

  • 2 questions about connection to hyper-v in windows 8

    hi, I can connect to my virtual machine from hyper-v manager  ,but when I try the other option --- connect with hyper-v virtual machine(option)  I see  on the log on wizard telling me that I don't have  the right to run this job.  take contact with t

  • Adobe Flash Player, will not work. Crashes EVERYTIME.

    I'm not a huge computer person, so this explanation will suck: Okay, I have a Toshiba laptop, OS is Windows and I use Mozilla Firefox as my browser. About 3 days ago, I opened Youtube and tried to play a video, and it said I need to update Adobe. I u