DB Adapter Pure Sql Option urgent

Hi All,
I have query like this .
select
supp.segment1 supplier_number,
supp.vendor_name supplier_name,
ph.segment1 po_number,
ph.org_id,
ph.creation_date po_date,
pl.line_num po_line_number,
pl.unit_price,
pl.quantity line_quantity,
pl.line_type,
pl.item_number,
pl.item_description,
pl.UNIT_MEAS_LOOKUP_CODE UOM,
pll.shipment_num po_shipment_number,
pll.shipment_type,
pll.ship_to_organization_code,
pll.ship_to_location_code,
pll.quantity shipment_quantity,
pll.QUANTITY_ACCEPTED shipment_quantity_accepted,
pll.QUANTITY_BILLED shipment_quantity_billed,
pll.QUANTITY_CANCELLED shipment_quantity_cancelled,
pll.QUANTITY_RECEIVED shipment_quantity_received,
pll.QUANTITY_REJECTED shipment_quantity_rejected,
pll.need_by_date,
nvl(pll.inspection_required_flag,'N'), -- if its Yes then ites 4 Way Matching
nvl(pll.receipt_required_flag,'N'), -- If Its Yes then its 3 Way Matching
decode(nvl(pll.inspection_required_flag,'N'),'Y','4 WAY MATCHING',
decode(nvl(pll.receipt_required_flag,'N'),'Y','3 WAY MATCHING', '2 WAY MATCHING'))
matching_type,
pll.qty_rcv_tolerance,
pll.qty_rcv_exception_code,
pll.category item_category,
decode(pll.match_option,'P','Purchase Order','Receipt') Invoice_matching_option,
pll.AMOUNT_RECEIVED shipment_amount_received,
pll.AMOUNT_BILLED shipment_amount_billed,
pll.amount_cancelled shipment_amount_cancelled,
pll.amount_accepted shipment_amount_accepted,
pll.amount_rejected shipment_amount_rejected,
pd.distribution_num po_distribution_number,
pd.amount_billed dist_amount_billed,
pd.destination_context dist_destination,
pd.DESTINATION_SUBINVENTORY,
pd.quantity_ordered dist_quantity_ordered,
pd.quantity_delivered dist_quantity_delivered,
pd.quantity_cancelled dist_quantity_cancelled,
pd.quantity_billed dist_quantity_billed,
pd.amount_ordered dist_amount_ordered,
pd.amount_delivered dist_amount_delivered,
pd.amount_cancelled dist_amount_cancelled
from
po_headers_v ph,
po_lines_v pl,
po_line_locations_v pll,
po_distributions_v pd,
ap_suppliers supp,
ap_supplier_sites_all supp_site
where
ph.authorization_status = 'APPROVED' -- Po Must be Approved
and ph.po_header_id = pl.po_header_id
and ph.closed_code = 'OPEN' --PO is still Open
and pl.po_line_id = pll.po_line_id
and pll.line_location_id = pd.line_location_id
and ph.vendor_id = supp.vendor_id
and ph.vendor_site_id = supp_site.vendor_site_id
and pl.cancel_flag = 'N' --PO Line is not Cancelled
and pl.closed_flag = 'N' --PO Line is Still Open
and pll.approved_flag = 'Y' --Shipment is Approved
and nvl(pll.cancel_flag,'N') = 'N' --Shipment is not cancelled
and pll.closed_code = 'OPEN' --Shipment is still Open
Iam trying to use pure sql option , i have pasted the modified query in this way below >
select
supp.segment1 supplier_number,
supp.vendor_name supplier_name,
ph.segment1 po_number,
ph.org_id,
ph.creation_date po_date,
pl.line_num po_line_number,
pl.unit_price,
pl.quantity line_quantity,
pl.line_type,
pl.item_number,
pl.item_description,
pl.UNIT_MEAS_LOOKUP_CODE UOM,
pll.shipment_num po_shipment_number,
pll.shipment_type,
pll.ship_to_organization_code,
pll.ship_to_location_code,
pll.quantity shipment_quantity,
pll.QUANTITY_ACCEPTED shipment_quantity_accepted,
pll.QUANTITY_BILLED shipment_quantity_billed,
pll.QUANTITY_CANCELLED shipment_quantity_cancelled,
pll.QUANTITY_RECEIVED shipment_quantity_received,
pll.QUANTITY_REJECTED shipment_quantity_rejected,
pll.need_by_date,
nvl(pll.inspection_required_flag,'N'), -- if its Yes then ites 4 Way Matching
nvl(pll.receipt_required_flag,'N'), -- If Its Yes then its 3 Way Matching
decode(nvl(pll.inspection_required_flag,'N'),'Y','4 WAY MATCHING',
decode(nvl(pll.receipt_required_flag,'N'),'Y','3 WAY MATCHING', '2 WAY MATCHING'))
matching_type,
pll.qty_rcv_tolerance,
pll.qty_rcv_exception_code,
pll.category item_category,
decode(pll.match_option,'P','Purchase Order','Receipt') Invoice_matching_option,
pll.AMOUNT_RECEIVED shipment_amount_received,
pll.AMOUNT_BILLED shipment_amount_billed,
pll.amount_cancelled shipment_amount_cancelled,
pll.amount_accepted shipment_amount_accepted,
pll.amount_rejected shipment_amount_rejected,
pd.distribution_num po_distribution_number,
pd.amount_billed dist_amount_billed,
pd.destination_context dist_destination,
pd.DESTINATION_SUBINVENTORY,
pd.quantity_ordered dist_quantity_ordered,
pd.quantity_delivered dist_quantity_delivered,
pd.quantity_cancelled dist_quantity_cancelled,
pd.quantity_billed dist_quantity_billed,
pd.amount_ordered dist_amount_ordered,
pd.amount_delivered dist_amount_delivered,
pd.amount_cancelled dist_amount_cancelled
from
po_headers_v ph,
po_lines_v pl,
po_line_locations_v pll,
po_distributions_v pd,
ap_suppliers supp,
ap_supplier_sites_all supp_site
where
ph.authorization_status = 'APPROVED'
and ph.po_header_id = ?
and ph.closed_code = 'OPEN'
and pl.po_line_id = ?
and pll.line_location_id = ?
and ph.vendor_id = ?
and ph.vendor_site_id = ?
and pl.cancel_flag = 'N'
and pl.closed_flag = 'N'
and pll.approved_flag = 'Y'
and nvl(pll.cancel_flag,'N') = 'N'
and pll.closed_code = 'OPEN'
My Question is : The Pasted modified query is correct ???, and this type of below
nvl(pll.inspection_required_flag,'N'), -- if its Yes then ites 4 Way Matching
nvl(pll.receipt_required_flag,'N'), -- If Its Yes then its 3 Way Matching
decode(nvl(pll.inspection_required_flag,'N')
Is Allowed ???????
Edited by: anantwag on Apr 11, 2011 3:01 AM

yeah , i was getting some error for that "--" but then i changed the query and now it does not have "---"
But i have a question here the xsd generated is like this ...
and query contains nvl(pll.cancel_flag,'N') which in xsd looks like below.
<xs:element name="nvl" type="xs:string" nillable="true"/>
<xs:element name="nvl" type="xs:string" nillable="true"/>
<?xml version = '1.0' encoding = 'UTF-8'?>
<xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/DBSelect" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/DBSelect" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DBSelectInput" type="DBSelectInput"/>
<xs:complexType name="DBSelectInput">
<xs:sequence>
<xs:element name="arg1" type="xs:string" nillable="true"/>
<xs:element name="arg2" type="xs:string" nillable="true"/>
<xs:element name="arg3" type="xs:string" nillable="true"/>
<xs:element name="arg4" type="xs:string" nillable="true"/>
<xs:element name="arg5" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element name="DBSelectOutputCollection" type="DBSelectOutputCollection"/>
<xs:complexType name="DBSelectOutputCollection">
<xs:sequence>
<xs:element name="DBSelectOutput" type="DBSelectOutput" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DBSelectOutput">
<xs:sequence>
<xs:element name="supplier_number" type="xs:string" nillable="true"/>
<xs:element name="supplier_name" type="xs:string" nillable="true"/>
<xs:element name="po_number" type="xs:string" nillable="true"/>
<xs:element name="ph_org_id" type="xs:string" nillable="true"/>
<xs:element name="po_date" type="xs:string" nillable="true"/>
<xs:element name="po_line_number" type="xs:string" nillable="true"/>
<xs:element name="pl_unit_price" type="xs:string" nillable="true"/>
<xs:element name="line_quantity" type="xs:string" nillable="true"/>
<xs:element name="pl_line_type" type="xs:string" nillable="true"/>
<xs:element name="pl_item_number" type="xs:string" nillable="true"/>
<xs:element name="pl_item_description" type="xs:string" nillable="true"/>
<xs:element name="UOM" type="xs:string" nillable="true"/>
<xs:element name="po_shipment_number" type="xs:string" nillable="true"/>
<xs:element name="pll_shipment_type" type="xs:string" nillable="true"/>
<xs:element name="pll_ship_to_organization_code" type="xs:string" nillable="true"/>
<xs:element name="pll_ship_to_location_code" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity_accepted" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity_billed" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity_cancelled" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity_received" type="xs:string" nillable="true"/>
<xs:element name="shipment_quantity_rejected" type="xs:string" nillable="true"/>
<xs:element name="pll_need_by_date" type="xs:string" nillable="true"/>
<xs:element name="nvl" type="xs:string" nillable="true"/>
<xs:element name="nvl" type="xs:string" nillable="true"/>
<xs:element name="matching_type" type="xs:string" nillable="true"/>
<xs:element name="pll_qty_rcv_tolerance" type="xs:string" nillable="true"/>
<xs:element name="pll_qty_rcv_exception_code" type="xs:string" nillable="true"/>
<xs:element name="item_category" type="xs:string" nillable="true"/>
<xs:element name="Invoice_matching_option" type="xs:string" nillable="true"/>
<xs:element name="shipment_amount_received" type="xs:string" nillable="true"/>
<xs:element name="shipment_amount_billed" type="xs:string" nillable="true"/>
<xs:element name="shipment_amount_cancelled" type="xs:string" nillable="true"/>
<xs:element name="shipment_amount_accepted" type="xs:string" nillable="true"/>
<xs:element name="shipment_amount_rejected" type="xs:string" nillable="true"/>
<xs:element name="po_distribution_number" type="xs:string" nillable="true"/>
<xs:element name="dist_amount_billed" type="xs:string" nillable="true"/>
<xs:element name="dist_destination" type="xs:string" nillable="true"/>
<xs:element name="pd_DESTINATION_SUBINVENTORY" type="xs:string" nillable="true"/>
<xs:element name="dist_quantity_ordered" type="xs:string" nillable="true"/>
<xs:element name="dist_quantity_delivered" type="xs:string" nillable="true"/>
<xs:element name="dist_quantity_cancelled" type="xs:string" nillable="true"/>
<xs:element name="dist_quantity_billed" type="xs:string" nillable="true"/>
<xs:element name="dist_amount_ordered" type="xs:string" nillable="true"/>
<xs:element name="dist_amount_delivered" type="xs:string" nillable="true"/>
<xs:element name="ph" type="xs:string" nillable="true"/>
<xs:element name="pl" type="xs:string" nillable="true"/>
<xs:element name="pll" type="xs:string" nillable="true"/>
<xs:element name="pd" type="xs:string" nillable="true"/>
<xs:element name="supp" type="xs:string" nillable="true"/>
<xs:element name="OPEN" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Please help me out as, if the same thing will not work then i have to wrap the same query in the stored Procedure.

Similar Messages

  • How to build dynamic query strings in the query using DB adapter 'Pure SQL'

    Dear Forum,
    I am building an application which will access DB to fetch some result set. The query involves retrieving data from multiple tables(nearly 10 tables). So I have created a DB adapter using 'execute pure sql' option. With this query works fine, but my inputs parameters will vary. So I need to make my query dynamic to append the query strings at runtime depending on the inputs.
    For example I have 3 input variables - input1,input2 and input3 (in my request xsd) which are used in the pure sql query. Now if I get a 4th input parameter input4 in the request, I need to append this to query string as 'AND input4=[some value]' at runtime. Otherwise my query should have only 3 parameters. Please suggest how this can be achieved.
    Regards,
    Satya.

    This is a strange requirement, depending on the columns you have and what are optional in them, one way is to have separate operations and each opeartion will have different inputs and for each operation , a different DB Adapter is called. But this way, it results in more number of operations for the service as well as more number of references in the composite. Even if you pass the column inputs to the SQL procedure, it will result in a large number of if-else cases..
    Thanks,
    N

  • Using variables in DB Adapter's Execute Pure SQL option

    Hi everyone,
    Typically if i wanted to declare a variable in a SQL query in a DB Adapter I would use the # character, however, I have the need to reference the same variable multiple times in the query but for every parameter found in the query (regardless if it has the same name) a corresponding XML element is created in the resulting XSD. So, for example, if I have three #project_id variables in the query, there will be three project id elements in the XSD when I really only want one. Modifying the XSD to only define one doesn't work either, it will throw a runtime exception because it's looking for the other IN parameters. How can this be done?
    I'm using JDeveloper 11.1.1.7.
    Thanks,
    Bill

    Hi,
    I don't think that is possible (although stand to be corrected). The best is to modify your query using JOINs in such a way that only one parameter is exposed or assign multiple parameters.
    There's query-database function also described here that you may want to follow.
    Regards,
    Neeraj Sehgal

  • Pure SQL and Border Use Cases?

    Hi Gurus
    I was developing a DB Adapter to select data from Shipping tables. I did it by polling as well as with Custom SQL. While using the custom SQL I got the following error in my domain.log
    (my query that I wrote) failes, Caused by java.sql.SQLException: Invalid column index.
    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.
    What is a border use case, how do I decide that. So BPEL support the custom sql option very loosely?
    Thx

    The thing is that XSLT often doesn't deliver the functionality required when it comes to times.
    You suggest appening "Z" to the time but this means that the time is now in UTC time. What if the system from where the date is being converted is running in NZ using local time? Other systems that recieve the date (and correctly handle the time zone) will now have a time that is out by a number of hours.
    You often can't ignore the time zone (drop the 'Z') as if you send the time to a system it has to either assume the time is local to it (which may not be the case... the other system coudl be in a different time zone) or assume the time is UTC (I think crossfire does this by default).
    Typically can't just append a time zone (e.g. +11:00) either as many places have daylight savings so the value to appended is variable (you then need some way of determining what the value is... either Java Embedding or a Service).
    As you mention it does depend on the use case but in many circumstances using Jaba Embedding, not as suggested above but with the appropriate Java.util.Calendar classes, is the best way to handle date and time in BPEL. Even still you need to ascertain the format of times external to the system and ensure you parse them correctly.
    ANd even if you do all this you can still run into problems. I've seen a real world example where two systems which both handled time zones correctly and had previously been working together for quite a while, satrted reporting different times. It turns out that only one of them had had the most recent Java Time Zone patches applied and there had been a change in the dates for daylight savings here (Australia). Be warned!

  • Pure SQL to partition date-time occurrences into non-overlapping windows?

    i've a question that so far, i've never been able to solve via a pure SQL option.
    it's hard to explain in words, but it's something like this:
    given a set of date-time, i would like to partition the data into non-overlapping windows of 30 minutes each.
    the data is supposed to be partitioned into windows of 30 minutes, meaning when the data is within 30 minutes of the first occurrence, only the first occurrence will be returned. in the next second after the 30th minute, the record will be considered as the start of a new window and is also returned. so those data that occurs within the window period are suppressed. the first occurrence is not necessarily occurring on the 00th minute, so the window start will never be constant.
    run the below query to look at the dummy data.
    SELECT     'A' AS ID
              , TRUNC(SYSDATE) + 7 / 24 + 1 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 50
    UNION ALL
    SELECT     'A' AS ID
              , TRUNC(SYSDATE) + 9 / 24 + 8 / 1440 + 1 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 35
    UNION ALL
    SELECT     'B' AS ID
              , TRUNC(SYSDATE) + 7 / 24 + 5 *(ROWNUM - 1) / 1440 AS datetime
          FROM DUAL
    CONNECT BY ROWNUM <= 15this is supposed to be the output.
    ID     DATETIME
    A     5/19/2010 07:00:00
    A     5/19/2010 07:30:00
    A     5/19/2010 09:08:00
    A     5/19/2010 09:38:00
    B     5/19/2010 07:00:00
    B     5/19/2010 07:30:00
    B     5/19/2010 08:00:00so far, i'm using a PL/SQL to pipe the records. but i would like to know if this is achievable via SQL or not.
    i've tried looking at analytics, width_bucket, ntile and alll options i can think of, but i just can't solve this at all.

    hey Bob,
    your answer is most definitely correct and does what i want. i've verified it again my data set and it returns the results as required!
    you've definitely proven me wrong. i was always under the impression that this wasn't possible. thanks!
    just a small note:
    i need the windows to be binned by seconds, so have changed the numtodsinterval to raw numbers.
    WITH t AS
         (SELECT 'A' AS ID
                , TRUNC(SYSDATE) +(6.75 / 24) AS datetime
            FROM DUAL
          UNION ALL
          SELECT 'A' AS ID
                , TRUNC(SYSDATE) +(6.75 / 24) AS datetime
            FROM DUAL
          UNION ALL
          SELECT     'A' AS ID
                    , TRUNC(SYSDATE) + 7 / 24 + 1 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 50
          UNION ALL
          SELECT     'A' AS ID
                    , TRUNC(SYSDATE) + 9 / 24 + 8 / 1440 + 1 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 35
          UNION ALL
          SELECT     'B' AS ID
                    , TRUNC(SYSDATE) + 7 / 24 + 5 *(ROWNUM - 1) / 1440 AS datetime
                FROM DUAL
          CONNECT BY ROWNUM <= 15)
        ,a AS
         (SELECT ID
                ,datetime
                ,LAG(datetime) OVER(PARTITION BY ID ORDER BY datetime) AS prevtime
                ,LAST_VALUE(datetime) OVER(PARTITION BY ID ORDER BY datetime RANGE BETWEEN CURRENT ROW AND 30 / 1440 + 1 / 86400 FOLLOWING) AS interval_end
            FROM t)
        ,b AS
         (SELECT ID
                ,datetime
                ,LEAD(datetime) OVER(PARTITION BY ID ORDER BY datetime) AS nexttime
            FROM t)
        ,ab AS
         (SELECT a.ID
                ,a.datetime
                ,a.prevtime
                   ,a.interval_end
                   ,b.datetime as b_datetime
                ,b.nexttime
            FROM a JOIN b ON(a.ID = b.ID
                             AND a.interval_end = b.datetime)
    SELECT     ID
              ,datetime
          FROM ab
    START WITH prevtime IS NULL
    CONNECT BY ID = PRIOR ID
           AND datetime = PRIOR nexttime
      ORDER BY ID
              ,datetime;this most definitely proves that i'm still not sure of how to use hierarchy queries.
    Edited by: casey on May 20, 2010 11:20 AM

  • Pure sql in DB adapter

    Hi All,
    Here is my scenario:
    I wnat to take teh dat from the database tables and generate teh reports in BAM. Al;ready I have SQL queries to generate the report. I want to pool the db tables for every 2 mins and generate the report .
    My question is :
    Is there is any way to trigge teh pure SQL in DB adapter for every certain intervat of time? Please help me on this. also suggest me best approach..
    Thanks
    Venkat

    Hi Venkat
    1. Hope you are familiar with BAM Reports architecture and how it works. Its pretty straight forward.
    2. First you create a DataSource to any external Database giving the db host, port, sid, username/password. This database contains like Tables, Views, etc etc.
    3. You create a DataObject that References any component of this database like Table, View etc. So you have a SQL that joins multiple tables and fetches data. Simply Create a View for that SQL Query on database side like database View. Then create a BAM Data Object for that View. It shows all Columns from that View. Simply Rename them if you want or just leave as it is. Just run the View and it shows all the data records. Remember this is dynamic. There is no need to refresh or trigger. Say if the table had a new row, the View will just show that new row.
    4. Now create a Report (Web or excel format) for the above Data Object. Report by default will show all the column from Data Object. Pick the columns you want to add to that Report.
    Run the Report. Data in Report is 100% Dynamic. If backend tables had new rows or deleted rows, just run the Report and you will see the results.
    Thanks
    Ravi Jegga

  • Database Adapter Configuration Execute Pure SQL

    Hii
    I have following scenario in my Project.
    I have ERRORCODE Details Table in Database which has following columns.
    1)ERRORCODE VARCHAR2
    2)PRIORITY VARCHAR2
    3)QueueName Varchar2
    I have one web service which takes errorcode as input parameter of string type in which i have to pass values like 1,2,3.
    Web service treated these values as complete one string value but i want it should be treated like seperately.Beacuse i have to pass these values to the query.
    I have configured database adapter for the following query using Execute Pure SQL.
    SELECT DISTINCT QueueName FROM ErrorCodeDetails where priority= (select min (priority) from ErrorCodeDetails where ErrorCode In(#ERRORCODE))
    So can anyone please help me what changes i have to make in this query so the sql query treat the errorcode string value as three different value rather than one single value??
    Thanks in advance.
    Regards,
    Priyanka

    Change the query like this.
    SELECT DISTINCT QueueName FROM ErrorCodeDetails where priority= (select min (priority) from ErrorCodeDetails where ErrorCode In(select csv from xmltable(#ERRORCODE)))
    In case it is required to treat the individual comma separated values in #ERRORCODE as number use the to_number function.
    SELECT DISTINCT QueueName FROM ErrorCodeDetails where priority= (select min (priority) from ErrorCodeDetails where ErrorCode In(select to_number(csv) from xmltable(#ERRORCODE)))
    In case this helps , please mark the answer as correct/helpful.
    Regards.

  • DB Adapter Package call vs Pure SQL call

    Hi ,
    We need to call few SQL select statements from BPEL via DB adapter. The SQL may fetch few thousands (1k to 50k possibly) records. We are now analyzing the possible pros and cons in terms of performance of DB Adapter package call vs direct pure SQL call.
    Can you pleas give us any suggestion on it.
    Regards,
    Debanjan

    you can use the code as per your requirement
    but you need to do some performance tuning
    http://biemond.blogspot.com/2010/08/things-you-need-to-do-for-owsm-11g.html

  • Pure SQL of Select query on multiple tables in DB Adapter

    I am trying use pure sql approach for a custom sql query on multiple tables for a DB adapter by modifying toplink_mappings.xml. But i am not getting other tables in my xsd. Please help.

    hi Ravi,
    can you pls be a bit clear? what is this about? where you are using?
    thanks,
    sneha.

  • Pure SQL query

    I am trying to execute a pure SQL statement. But my DB adapter is not fetching any output.
    select installation_type from oid_staa_desc_mapping where Acode in ('A','B')
    I am not sure why this doesn't work.
    Regards,
    Balaji

    Hi,
    Read the following blog post:
    http://soa-howto.blogspot.com/2009/05/how-to-use-sql-query-having-in-clause.html
    Regards.
    D

  • Pure SQL Select

    Hi ,
    I have configued DB Adapter to Pure SQL Select, passing input parameter CART_KEY to select line items. There 10 line items for accart key. In my case there are 10 different records for CART_KEY = 607340. it is selecting 10 records but same record of 10 times(not unique).
    I am not sure, is it caching the record ? do i need to turn caching off ?
    I have excuted the query from logs, it is selecting 10 rows.
    <2006-07-11 10:46:26,009> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.TopLinkLogger log> SELECT ACTIVE_FLAG_H, ACTIVE_FLAG_L, ANNUAL_FLAG, CART_LINE_KEY FROM CMGT.VW_QMT_TO_OTM_SPR_DATA WHERE (CART_KEY = ?)
         bind => [607340]

    <bump>
    No one has a clue about how to make this work?

  • Calculating values from row to row with pure sql?

    Hello,
    I'm searching for a way to calculate values from row to row with pure sql. I need to create an amortisation table. How should it work:
    Known values at start: (they can be derived with an ordinary sql-statement)
    - redemption amount RA
    - number of payment terms NT
    - annuity P (is constant in every month)
    - interest rate IR
    What has to be calculated:
    First row:
    RA1 = RA - P
    Z1 = (RA1 * (IR/100/12))
    T1 = P - Z1
    2nd row
    RA2 = RA1 - T1
    Z2 = (RA2 * (IR/100/12))
    T2 = P - Z2
    and so on until NT has reached.
    It should look like
    NT
    P
    Tn
    Zn
    RAn
    1
    372,17
    262,9
    109,27
    22224,83
    2
    372,17
    264,19
    107,98
    21961,93
    3
    372,17
    265,49
    106,68
    21697,74
    4
    372,17
    266,8
    105,38
    21432,25
    5
    372,17
    268,11
    104,06
    21165,45
    6
    372,17
    269,43
    102,75
    20897,34
    7
    372,17
    270,75
    101,42
    20627,91
    8
    372,17
    272,09
    100,09
    20357,16
    9
    372,17
    273,42
    98,75
    20085,07
    10
    372,17
    274,77
    97,41
    19811,65
    11
    372,17
    276,12
    96,06
    19536,88
    12
    372,17
    277,48
    94,7
    19260,76
    13
    372,17
    278,84
    93,33
    18983,28
    14
    372,17
    280,21
    91,96
    18704,44
    15
    372,17
    281,59
    90,59
    18424,23
    16
    372,17
    282,97
    89,2
    18142,64
    17
    372,17
    284,36
    87,81
    17859,67
    18
    372,17
    285,76
    86,41
    17575,31
    19
    372,17
    287,17
    85,01
    17289,55
    20
    372,17
    288,58
    83,59
    17002,38
    21
    372,17
    290
    82,18
    16713,8
    22
    372,17
    291,42
    80,75
    16423,8
    23
    372,17
    292,86
    79,32
    16132,38
    24
    372,17
    294,3
    77,88
    15839,52
    25
    372,17
    295,74
    76,43
    15545,22
    26
    372,17
    297,2
    74,98
    15249,48
    27
    372,17
    298,66
    73,52
    14952,28
    28
    372,17
    300,13
    72,05
    14653,62
    29
    372,17
    301,6
    70,57
    14353,49
    30
    372,17
    303,09
    69,09
    14051,89
    31
    372,17
    304,58
    67,6
    13748,8
    32
    372,17
    306,07
    66,1
    13444,22
    33
    372,17
    307,58
    64,6
    13138,15
    34
    372,17
    309,09
    63,08
    12830,57
    35
    372,17
    310,61
    61,56
    12521,48
    36
    372,17
    312,14
    60,04
    12210,87
    37
    372,17
    313,67
    58,5
    11898,73
    38
    372,17
    315,21
    56,96
    11585,06
    39
    372,17
    316,76
    55,41
    11269,85
    40
    372,17
    318,32
    53,85
    10953,09
    41
    372,17
    319,89
    52,29
    10634,77
    42
    372,17
    321,46
    50,71
    10314,88
    43
    372,17
    323,04
    49,13
    9993,42
    44
    372,17
    324,63
    47,55
    9670,38
    45
    372,17
    326,22
    45,95
    9345,75
    46
    372,17
    327,83
    44,35
    9019,53
    47
    372,17
    329,44
    42,73
    8691,7
    48
    372,17
    331,06
    41,11
    8362,26
    I would appreciate every help and idea to solve the problem solely with sql.
    Thanks and regards
    Carsten

    It's using Model Clause and / or Recursive With (sometimes maybe both)
    Regards
    Etbin
    with
    rec_proc(nt,i,ra,p,ir,z,t) as
    (select nt,i,ra - p,p,ir,round((ra - p) * 0.01 * ir / 12,2),p - round((ra - p) * 0.01 * ir / 12,2)
       from (select 48 nt,22597 ra,372.17 p,5.9 ir,0 z,0 t,1 i
               from dual
    union all
    select nt,i + 1,ra - t,p,ir,round((ra - t) * 0.01 * ir / 12,2),p - round((ra - t) * 0.01 * ir / 12,2)
       from rec_proc
      where i < nt
    select * from rec_proc
    try to adjust initial values and rounding please
    NT
    I
    RA
    P
    IR
    Z
    T
    48
    1
    22224.83
    372.17
    5.9
    109.27
    262.9
    48
    2
    21961.93
    372.17
    5.9
    107.98
    264.19
    48
    3
    21697.74
    372.17
    5.9
    106.68
    265.49
    48
    4
    21432.25
    372.17
    5.9
    105.38
    266.79
    48
    5
    21165.46
    372.17
    5.9
    104.06
    268.11
    48
    6
    20897.35
    372.17
    5.9
    102.75
    269.42
    48
    7
    20627.93
    372.17
    5.9
    101.42
    270.75
    48
    8
    20357.18
    372.17
    5.9
    100.09
    272.08
    48
    9
    20085.1
    372.17
    5.9
    98.75
    273.42
    48
    10
    19811.68
    372.17
    5.9
    97.41
    274.76
    48
    11
    19536.92
    372.17
    5.9
    96.06
    276.11
    48
    12
    19260.81
    372.17
    5.9
    94.7
    277.47
    48
    13
    18983.34
    372.17
    5.9
    93.33
    278.84
    48
    14
    18704.5
    372.17
    5.9
    91.96
    280.21
    48
    15
    18424.29
    372.17
    5.9
    90.59
    281.58
    48
    16
    18142.71
    372.17
    5.9
    89.2
    282.97
    48
    17
    17859.74
    372.17
    5.9
    87.81
    284.36
    48
    18
    17575.38
    372.17
    5.9
    86.41
    285.76
    48
    19
    17289.62
    372.17
    5.9
    85.01
    287.16
    48
    20
    17002.46
    372.17
    5.9
    83.6
    288.57
    48
    21
    16713.89
    372.17
    5.9
    82.18
    289.99
    48
    22
    16423.9
    372.17
    5.9
    80.75
    291.42
    48
    23
    16132.48
    372.17
    5.9
    79.32
    292.85
    48
    24
    15839.63
    372.17
    5.9
    77.88
    294.29
    48
    25
    15545.34
    372.17
    5.9
    76.43
    295.74
    48
    26
    15249.6
    372.17
    5.9
    74.98
    297.19
    48
    27
    14952.41
    372.17
    5.9
    73.52
    298.65
    48
    28
    14653.76
    372.17
    5.9
    72.05
    300.12
    48
    29
    14353.64
    372.17
    5.9
    70.57
    301.6
    48
    30

  • JDBC Sender Adapter : java.sql.SQLException: Cursor state not valid.

    Hello all,
    We have configured JDBC Sender Adapter which fetches around 10K records with poll interval 1hr  from DB2 System .
    It was working fine,suddenly it started throwing an exception in Adapter Monitoring :
    Error during conversion of query result to XML: java.sql.SQLException: Cursor state not valid.
    It is not fetching any records.
    Without changing any configurations when we tried to fetch to around 1000 records it's working fine.
    For 10K records same exception persists
    What could be the reason ?How to resolve this issue?
    regards
    GangaPrasad

    Hello Christophe ,
    Trace in VA :::
    Date : 05/09/2008
    Time : 11:45:57:750
    Message : Unexpected error converting database resultset to XML, reason: java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Severity : Error
    Category : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Location : com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(ResultSet, ResultSetMetaData)
    Application :
    Thread : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Datasource : 12428950:/usr/sap/PXI/DVEBMGS01/j2ee/cluster/server0/log/applications/com.sap.xi/xi.log
    Message ID : 00145E742794005E0014980B000000BE00044CC763766C4F
    Source Name : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Argument Objs : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Arguments : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Dsr Component :
    Dsr Transaction : d1f629d01d9b11dd984200145e742794
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives : com.sap.aii.adapter.jdbc.JDBC2XI
    Resource Bundlename :
    Session : 0
    Source : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    ThreadObject : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Transaction : SAP J2EE Engine JTA Transaction : [0ffffffbdffffffa6ffffff960086]
    User : J2EE_GUEST
    Regards
    Ganga Prasad

  • Need Suitable Pure SQL Query

    Hi
    I have Pure SQL DataBase name of Table as per given Coloumn Name.
    User Name StartDate EndDate
    Mr.Jack 01/04/2010 05/04/2010
    Mr.Perlin 07/04/2010 10/04/2010
    Mr.Tinklin 01/05/2010 05/05/2010
    Mr.Kerlin 12/04/2010 15/04/2010
    Now I am using asp.net Form Using C#...
    Name --> TextBox
    StartDate -> TextBox
    EndDate --> TextBox
    Now User enter the Dates after Click Save Button....
    Here SQL Query Check Whether the User Dates Clause into Data Base Date's.
    For Examble..
    User Enter Start Date = 04/04/2010, EndDate =08/04/2010
    Now Query it check SQL DataBase, Already 01/04/2010 to 10/04/2010 Available so Dont allow Save.... only allow various dates...
    ---------------- This is task Condition -------
    i am using SQL Query
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate ='02/04/2010' --// This is User Start Date coming from Text Box
    SET @EndDate = '10/04/2010' --// This is User End Date coming from Text Box
    IF NOT EXISTS (SELECT PollID FROM Polls WHERE (StartDate<= CAST (CONVERT(VARCHAR,@StartDate,101) AS DATETIME) OR EndDate <= CAST (CONVERT (VARCHAR,@EndDate,101) AS DateTime)) AND STATUS<>'D')
    SELECT 'OK ALLLOW'
    ELSE
    SELECT 'NOT ALLOW'
    But it is not working Correctly....
    Pls give some correctful query for solve task Condition
    By
    Riyaz
    Edited by: 798225 on Sep 28, 2010 10:37 PM
    Edited by: 798225 on Sep 28, 2010 10:52 PM

    Now I am developing Polls Application in asp.net
    I am using Polls Concept,
    DateBase Name : Polls
    Fields : PollID          PollName                           StartDate                                     EndDate                     UserID
    In Asp.Form Having
    User Name :  TextBox
    PollName: TextBox
    StartDate: TextBox
    EndDate: TextBox
    Submit - Button
    Task Details
    Whenever User Click after fillup all data's... then SQL Query Check
    if StartDate or EndDate is exists in Between DataBase Date's.....
    Condition true means dont allow save.. else Save.....
    Examble:
    PollID PollName StartDate EndDate UserName
    01 Sample 23/09/2010 26/09/2010 Klit
    02 Sample 2 29/09/2010 30/09/2010 Jack
    Now User given follwing details and click Submit,
    User Name : James
    PollName: Test
    StartDate: 22/09/2010
    EndDate: 27/09/2010
    Submit - Button
    Here User StartDate: 22/09/2010 , EndDate: 27/09/2010
    SQL Query Check ,
    Condtion 1 : Those dates are avilable in Datebase???
    Result: Yes
    Because, Sample Poll date is 23/09/2010 to 26/09/2010, here Start Date is Not Exists, But End Date Exists.
    So dnt allow Save Operation....
    Now User Again given follwing details and click Submit,
    User Name : James
    PollName: Test
    StartDate: 27/09/2010
    EndDate: 28/09/2010
    Submit - Button
    Here User StartDate: 27/09/2010 , EndDate: 28/09/2010
    SQL Query Again Check ,
    Condtion 1 : Those dates are avilable in Datebase???
    Result: No
    Because, Sample Poll date is 23/09/2010 to 26/09/2010,
    Sample1 Poll Date is 29/09/2010 to 30/09/2010
    here Start Date is Not Exists, But End Date Not Exists.
    So Allow Save Operation....
    This a My Task....
    Could You give SQL Query for help to Check given condition??
    regd
    Riayz
    Edited by: Riyaz on Sep 30, 2010 1:08 AM

  • How to disable free hand sql option in deski stanadalone mode

    I have a requirement where in i need to disable free hand sql option in deski standalone mode. Id this possible?
    Regards,
    AK

    Hi Alok,
    Kindly implement the following steps:
    1. Logon to CMC > Applications > Desktop Intelligence > User Security.
    2. Click on Add Principals and add the user account/user group to which you want to restrict the access > Add and Assign Security
    3. If the account/group is already there, Click on Assign Security > Advanced > Add/Remove Rights
    4. Select Advanced tab  and click on 'Add or Remove rights'
    5. Under Application, Click on Desktop Intelligence and deny the following rights.
    Edit Free-hand SQL --> Denied
    Use Free-hand SQL --> Denied
    I hope this helps.
    Regards,
    Nakul Mehta

Maybe you are looking for

  • IPod Classic, Recording and Alesis iMultiMix

    I have a brand new Alesis iMultiMix 8 USB that has a dock area for an iPod so you can play and record using it. I previously had an iPod photo which I knew would not be compatible to record with. I have recently purchased an iPod Classic thinking the

  • Firewire out.....

    I have just lost firewire on my FW800 G4 Dual 1.42Ghz (ultimate) my firewire canon scanner isn't being seen, my ipod is charging by not mounting, in system profiler when i go to look at firewire it just comes up with firewire bus. I have tried resett

  • Post Script 2UP trayswitch Command need

    Hi friends, I am a fresher in post script file printing. I need a command for postscript 2UP trayswitching for xerox printers. Please help me.

  • Informatica 9.5 client and 9.6 server

    Kids, the answer is extremely simple: Informatica does NOT support any combination of server X and clients Y. Both versions have to match exactly. Yes, there have been times when e.g. a 8.6.1 Hotfix 5 client could be used with a 8.6.1 Hotfix 9 server

  • Determing BPM's???

    What is the best program for determining the BPM's for all of my files on iTunes? For windows I used MixMeister and it was very accurate. Is there a good program for Mac? Any help would be appreciated. Thanks in advance!!!