How to Dene a Data Link Between Queries: Bind Variables

This is an interesting topic and I cannot get it to work using Bind Variables.
I have 2 queries: Q1 and Q2. Q2 needs c_id, account_code and account_type from Q1.
Whe I run the data template below, I get only the data for Q1.
Now people may argue that there is no data in Q2 for the relevant clause. So if I even remove the where clause in Q2 I still get no joy i.e Data appears for Q1 but not for Q2
<dataTemplate name="FLCMR519_DATA_SET" description="Termination Quote Report">
     <parameters>
          <parameter name="cid" dataType="number" defaultValue="1"/>
          <parameter name="p_cln_id" dataType="number" defaultValue="62412"/>
     </parameters>
     <dataQuery>
          <sqlStatement name="Q1">
               <![CDATA[SELECT qm.qmd_id,
qm.contract_period,
qm.quo_quo_id||'/'||qm.quote_no||'/'||qm.revision_no reference_no,
qm.contract_distance,
qm.mdl_mdl_id,
q.qpr_qpr_id,
q.quo_id,
q.drv_drv_id,
qm.revision_user username,
pb.first_name||' '||pb.last_name op_name,
pb.telephone_no,
pb.facsimile_no,
pb.email,
q.c_id c_id,
q.account_type account_type,
q.account_code account_code,
m.model_desc,
ph.payment_description payment_head_desc,
cl.fms_fms_id,
cl.start_date,
cl.end_date,
cl.actual_end_date,
cl.con_con_id,
cl.cln_id,
cl.term_qmd_id term_qmd_id,
qm2.contract_period term_period,
qm2.contract_distance term_distance
FROM quotations q,
           quotation_models qm,
           contract_lines cl,
           personnel_base pb,
           models m,
           model_types mt,
           payment_headers ph,
           quotation_models qm2
WHERE q.quo_id = qm.quo_quo_id
       AND cl.cln_id = :p_cln_id
       AND qm.qmd_id = cl.qmd_qmd_id
       AND qm2.revision_user = pb.employee_no (+)
       AND qm.mdl_mdl_id = m.mdl_id
       AND m.mtp_mtp_id = mt.mtp_id
       AND qm.payment_id = ph.payment_header_id
       AND qm2.qmd_id (+) = cl.term_qmd_id
]]>
          </sqlStatement>
          <sqlStatement name="Q2">
               <![CDATA[SELECT ea.c_id,                  ea.account_type,ea.account_code,ea.account_name
FROM external_accounts ea
             WHERE ea.c_id = :c_id
               AND ea.account_type = :account_type
               AND ea.account_code = :account_code
]]>
          </sqlStatement>
     </dataQuery>
</dataTemplate>

Defining dataStructure section is mandatory for multiple queries.

Similar Messages

  • How can I encrypt my data links between switch uplink ports ? I'm unable to use "cts Manual" command in C3560X switch.suggest me

    How can I encrypt my data uplinks between switch trunk ports ? I'm unable to use "cts Manual" command in C3560X switch.suggest me as I want to encrypt my switch-to-switch link with Cisco TrustSec.

    Hi 
    Login to switch & go to interface..
    There you can give tags.. (ISL & DONT1Q)
    Command switch-port mode trunk
    Switch-port trunk encapsulation ssl or dot1Q

  • How can we do the data migration between Oracle Applications and SAP R/3.

    Hi All,
    How can we do the data migration between Oracle Applications and SAP R/3 system.What are all the possible ways to move bulk data from Oracle Apps to SAP r/3 system.
    Provide any 3rd party tools which supports data migration and also pls rpovide the SAP's own data migration tools with supports the above feature.
    Awaiting for best possible solution.
    Thanks in advance.
    Regards
    Dharmaraju

    the 3rd party tool is ETL , you can use ETL tool and the prepare the load files then you can use LSMW method to upload the data to SAP.

  • How do I use the Session State to manage bind variables & download xml data

    I have a Report Query with more than 30 queries; many have bind variables in them. I'd like to create sample xml so that I can develop my word templates. When I try to download the XML data Source for Layout, it doesn't ask for the bind variable values.
    How can I download the XML data without replacing the bind variable values in each of the queries?
    Thank you.

    If you are using the Standalone version, then first of all make sure to UNCHECK (BIP10g 10.1.3.4.1)
    "AUTO RUN" (it is under General Settings when you select your Report Definition)
    Next, you should define the parameters in the corresponding parameter Section.
    Its simplest form is of "Text" type so you will have to enter values at runtime.
    Then these parameters can be used in your query as bind variables.
    When you run the report it will prompt for parameter values. Enter these values
    and you would get a sample of your XML data.
    This should work and you should not find any issues.
    regards
    Jorge

  • Convert data link between one query's group and another querys group to SQL

    Hi
    I have a report where there are 2 query Groups. These 2 query groups r linked by data link. How do i combine these queries to One query so i can use it as a SQL query.
    Thanks

    Hi,
    Assume that we have two queries Q1 and Q2 and the common column between the two queries is "comn".
    Now we can convert the datalink into SQL as follows:-
    SELECT *
    FROM
    (Query for Q1)a,
    (Query for Q2)b
    WHERE a.comn=b.comn(+)
    Note: "a" and "b" are alias names for Q1 and Q2.

  • How to get active remote data link

    I creat new data link easy, but when I test it. The message is not active.

    I assume you are asking this with reference of replication.
    Which means you have set global_names=true in your initora.
    That requires the database link names to be same as the sid/service name. Are you using the same database link name as the sid/service name?
    Please reply back if it helped.
    null

  • Data discrapancy between queries in SAP and BW

    Hi All,
    I have a problem in data discrapancy between the queries in SAP R/3 and BW Queries .can any one please tell me how to investigate this kind of problems and how to fetch this data ,
    please help me ASAP this is an urgent issue
    and how many ways we can investigate this kind of issues ,please send me some steps .......
    Thanks
    Tom

    Hi Tom,
    You can proceed in a step by step fashion when trying to match the BW query data with that in R/3 reports.
    . Try to check the filters and calculations applied in the BW query. You can create a very basic query if required.
    . If this does not work then try using transaction LISTCUBE so that you can directly see the data in the InfoCube as per your chosen selections.
    . If this doesn't yield anything, then look at the way data is being processed: Any code in the Start routines, Update or Transfer rules. Check them for correctness.
    . If you loaded through the PSA, you can also check data in the PSA. Or you can also check the data extracted using RSA3 in the R/3 system.
    . Try to provide us some more specifics about the data that you are trying to match. Which module is it? Which is the datasource?
    Hope this helps...

  • Link between queries and roles

    Hello,
    Could someone tell me if there is a way to have an overview on the link between roles and queries?
    For example a table which give us a role and the liste of queries which are linked to this role.
    Thanks in advance.
    Hicham

    Hi,
    I also had same query :
    mapping between the query/report and the role with technical names - BI Sec
    Its a bit tricky.
    Actually there are no direct linkage between queries and roles. However, you can look up S_RS_COMP in the roles that will help you identify which all queries the role gives access to.
    Regards,
    Zaheer
    Edited by: Zaheer on Aug 28, 2008 4:19 PM

  • Csv no data found when using bind variables

    Hi,
    I have created a report, that uses 2 date variables to limit the query and rows display as they should. But clicking the csv link opens csv having one row stating 'No data found...'. If I set static values in place of variables, I get the right result. How could I use bind variables and get the right answer in csv (without coding my own function)?
    Kaja

    I am having the same problem.
    The export link opens a new session without submitting the current page. The page item values are therefor not saved to cache before the export is undertaken.
    Any report using page item bind variables in the where clause will not export correctly as the bind values are either null or those of the previous page submit.
    Any ideas on how to get round this??

  • How can i navigate via navigational link between views in different windows

    hello
    i am using CRM_UI and have opened a popup
    gv_transcr_popup is a attribute referrring to if_bsp_wd_popup in my implementation class
    gv_transcr_popup = comp_controller->window_manager->create_popup(
        iv_interface_view_name = 'AIC_CM_TRANS/AssignTranspReq' "#EC NOTEXT
        iv_usage_name          = 'CUBAssignTransporReq'         "#EC NOTEXT
        iv_title               = lv_title ).
    get instance of BOL dynamic query
      lo_qs = cl_crm_bol_dquery_service=>get_instance( 'BTQAIC_CM_TRANSPORTREQ').
      gv_transcr_popup->set_on_close_event( iv_view = me iv_event_name = 'AssignTranspReq' ).
      gv_transcr_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
      gv_transcr_popup->open(   ).
    through the iv_usage_name i will open in this popup a search view from another window
    in this window is a searchview implemented and now after selecting the line in the result view in want to navigate through outbound plug / inbound plug to the starting view .
    but i get the exception
    Target view AIC_CM_TRANS/TransportReq of the navigation is not assigned to the current window AIC_CM_TRANS/AssignTranspReq ( which is true)
    now the question: how can i navigate between views of different windows?
    Best Regards
    britta

    hi
    i have found a way : you have to use a outboungplug from the windows interface ..then it is working
    best regards
    britta

  • How to delete the duplicate data in between two distinct rows in SQL?

    Hi,
    I need to identify the duplicate data with two distinct rows. See my data structure below.
    NAME NAME_1 VALUE START_DATE END_DATE FLAG INDEX
    SUR SE 275 13/12/2005 31/12/2010 B 1
    SUR SE 375 A 1
    SUR SE 475 A 1
    SUR SE 275 13/12/2005 31/12/2010 B 2
    SUR SE 375 A 2
    SUR SE 475 A 2
    SUR SE 175 13/12/2006 31/12/2010 B 3
    SUR SE 375 A 3
    SUR SE 475 A 3
    This is my sample data. Here data are duplicate with different index columns. INDEX 1 and 2 contains same group of combination. So i need to identify any one of duplicate combination(i.e INDEX 1 or 2). Can anyone come up with exact solution?
    Thanks

    Try this:
    with test_table as
    (select 'SUR' NAME, 'SE' NAME_1, 275 VALUE, '13/12/2005' START_DATE, '31/12/2010' END_DATE, 'B' FLAG, 1 IND from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 1 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 1 from dual union all
    select 'SUR', 'SE', 275, '13/12/2005' ,'31/12/2010' ,'B', 2 from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 2 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 2 from dual union all
    select 'SUR', 'SE', 175, '13/12/2006', '31/12/2010', 'B', 3 from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 3 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 3 from dual )
    select t.*,
           CASE WHEN START_DATE IS NULL THEN
             first_value(row_number) OVER (PARTITION BY NAME, NAME_1, IND ORDER BY START_DATE)
           ELSE
             row_number
           END row_number
    from (
    SELECT t.*,
           CASE WHEN START_DATE IS NOT NULL THEN
             row_number() over(PARTITION BY NAME, NAME_1,VALUE, START_DATE, END_DATE, FLAG
                               ORDER BY IND)
           END row_number
      FROM test_table t) t
    order by IND, start_dateNote that this is only checking for diferences in the rows where start_date is not null. Do you want to also check if the records where start_date is null it there are differences? If so you can do this:
    with test_table as
    (select 'SUR' NAME, 'SE' NAME_1, 275 VALUE, '13/12/2005' START_DATE, '31/12/2010' END_DATE, 'B' FLAG, 1 IND from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 1 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 1 from dual union all
    select 'SUR', 'SE', 275, '13/12/2005' ,'31/12/2010' ,'B', 2 from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 2 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 2 from dual union all
    select 'SUR', 'SE', 175, '13/12/2006', '31/12/2010', 'B', 3 from dual union all
    select 'SUR', 'SE', 375, null, null, 'A', 3 from dual union all
    select 'SUR', 'SE', 475, null, null, 'A', 3 from dual )
    SELECT t.*,
           MIN(row_number) OVER(PARTITION BY NAME, NAME_1, IND) MIN
      FROM (SELECT t.*,
                   row_number() over(PARTITION BY NAME, NAME_1, VALUE,
                                                  START_DATE, END_DATE, FLAG
                                         ORDER BY IND) row_number
              FROM test_table t) t
    ORDER BY IND,
              start_date;Edited by: Manuel Vidigal on 13/Abr/2009 12:05

  • How do I swap the data (completely) between two Macbooks?

    I am trying to swap my computer with my mums as hers is newer and has more memory; and I have run out! Is it possible to do this without losing everything?

    If the issue is that your internal hard drive space is used up, swapping to your mothers computer will involve writing her computers data to an external hard drive, erasing her computer hard drive, then copy your data to it, erase your hard drive, then copy her data to it. That can be done without losing anything.
    Why not get an external hard drive to move some of your data off your internal drive?  It's just a guess, but you don't have a backup external drive today? If you get an external hard drive, get it larger than your hard drive so you can put two partitions on it, one for backup and one for data you want to store. Then move audio/visual/whatever files to the external hard drive and delete them on your internal drive.
    Another option would be just to get a larger hard drive installed in your system. This can be done without losing data, too.

  • Data link between vi's

    Every second, I would like to collect data (from some instrument) in one VI (collector.vi) and then add the point to a graph in another VI.
    I've seen the "Dynamic Load" examples to use "Call SubVI by Reference."  However, it seems like the data is simply passed once rather than continuously updated.
    What is the simplest / best way to update a separate window (subvi) with periodic data?

    You have a variety of choices beyond the dynamic call option you mentioned. You can also use a queues, notifiers and user events. Each has their benefits and their limitations. Check out the design patterns in the templates that ship with LV. From the file menu, select New... and in the resulting dialog, expand:
    VI
    From Template
    Frameworks
    Design Patterns
    These templates show everything in one VI but the basic techniques are the same when the loops are in separate VIs. Pay particular attention to the Producer/Consumer Loop pattern.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Data Link - 2 Queries with Parameters

    hello, I have read couple of post and couldnt get the answer that i am looking for.
    I am using Oralce 10g Report.
    I have created report that use 2 queries. On my first Query i have all the detail information by each Company (withing Company i have two Department). I am using Metrix Report in order to get my Department Total and also Report Total for the Company. and Each company has about 8 fileds accross the report.
    Now on my second Query i am doing SUM of all the Department so thats way i can put at bottom of my report on each company report to see overall what the all department number's are.
    so in simple word: i have
    My First Report
    company_name Dept_name, sales_amt, ytd_amt ....
    Food_Mart grocery $ 2525.25 $123554.55
    Food_Mart Vegitable $330.25 $2354555.54
    My Second Report
    company_name Dept_name, sales_amt, ytd_amt ....
    J&J grocery $22425.25 $2513554.55
    Food_Lion Vegitable $47330.25 $25548555.54
    so on.. each company have their own report and i pass parameter where user enter company name and it will generate reports.
    Now i am trying to put each Dept_name under each report and get their Grand Total so thats way I can see what will be the Dept_Name Grand Total.
    Now so Far, I created Data_Link and put the sumDEPT_NAME on Data Model as sumDEPT_NAMEPerReport and created field under Sales_AMT and it gives me an ERROR.
    RPT-1517 reference column DEPT_NAME .............. to sumDEPT_NAME
    Can you guys can explain me how to solve this type of probelm?
    Or atlead give me some idea where i can try it.
    Thank You very much

    In my opinion you could try to use a Summary Column,with function Sum and source tha data you want to sum.
    aguero

  • Link between queries

    I have 2 cursor queries:
    <dataQuery>
         <sqlStatement name="Q_1"><![CDATA[
              select XX_PACKAGE_PKG.Header_Data (:p_invoice_num_from, :p_invoice_num_to, :p_invoice_date_from, :p_invoice_date_to, :p_customer_name) from dual
              ]]>
    </sqlStatement>
         <sqlStatement name="Q_2"><![CDATA[
              select XX_PACKAGE_PKG.Lines_Data(:CUSTOMER_TRX_ID) from dual
              ]]>
    </sqlStatement>
    </dataQuery>
    First statement returning customer_trx_id which is parameter in second statement.
    In data output I have always the same lines for every invoice.
    To function XX_PACKAGE_PKG.Lines_Data always is setting customer_trx_id from first printing invoice.
    I don't now why this run in this way.
    Thanks for any help.
    MS

    I believe Q_1 returns only one column CUSTOMER_TRX_ID.
    You can try having an alias for the column like
    select XX_PACKAGE_PKG.Header_Data (:p_invoice_num_from, :p_invoice_num_to, :p_invoice_date_from, :p_invoice_date_to, :p_customer_name) CUSTOMER_TRX_ID
    from dual

Maybe you are looking for

  • Iphoto says my library has become unreadable

    i was importing and editing pictures tonight, and all of a sudden my library won't open and I get a screen that says my library is in use  by another application, or has become unreadable. i tried shutting down and restarting, and restarting pressing

  • How to make Quicktime 10.2 start to play automatically

    In Finder, I click on a movie and it open Quicktime but it never play until I click play button. How to make it automatically play?

  • JDeveloper and SuSE linux

    Hi all Does anybody else use JDeveloper 10.1.3 with SuSE linux ? I currently have SUSE linux 10.0, (kernel 2.6.13-15.8-smp), JDev version 10.1.3.0.4 SU2I with jdk 1.5.4 and I am facing various problems where JDeveloper hangs or behaves unexpectedly.

  • Cannot Telnet into 1921 router

    Please  Help, I cannot telnet into my 1921 router and not sure how to fix this.   See below. line con 0  password 7 XXXXX  logging synchronous  login local line aux 0 line 2  no activation-character  no exec  transport preferred none  transport outpu

  • Measure network bandwidth of SQL Server

    Hi everyone, I'm using SQL Server 2k5. Now I get a request to measure the network traffic of a certain DB. For example, how many GB data are in and out from a DB in 1 hours or longer. Is it possible to use SQL profiler or some other tools to grab the