XMLELEMENT/ XMLAGG functions - Fetching the result into a variable

Hi, I have a query to generate an XML output. I have the following questions:
1) I am typecasting the result from this query to a VARCHAR2 and I want to assign the output to a VARCHAR2 variable. Can you please help me with that. When I try to get this into a varchar variable, i get the following error:
declare
x varchar2(6000);
begin
SELECT CAST(xmlelement("itemMaster",
xmlelement("itemNumber",lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0)),
xmlelement("itemDesc",NVL(d.ITEM_DESC_T,lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0))),
xmlelement("paltSize",p1_test),
xmlelement("stdUOM",p1_test),
xmlelement("sellByDayQty",d.sell_by_day_q),
xmlelement("shflfUOM",p1_test),
xmlelement("minShflfDayQty",d.min_shflf_day_q),
xmlelement("itemCatgCode",NVL(d.dc_item_catg_c,'GM')),
xmlelement("strgTempZoneCode",NVL(d.strg_tmpr_zone_c,'01')),
xmlelement("retailAmt",retl_a),
xmlelement("expireDateFlag",NVL(d.expire_date_f,'N')),
xmlelement("randomWtFlag",NVL(d.rndm_wt_f,'N')),
xmlelement("wetFlag",NVL(d.wet_f,'N')),
xmlelement("areaCode",d.area_c),
xmlelement("vcpQty",d.vcp_q),
xmlelement("sspQty",d.ssp_q),
xmlelement("hndlTypeCode",d.hndl_type_c),
xmlelement("mstrPackTypeCode",d.mstr_pk_type_c),
xmlelement("mstrItemTypeCode",NVL(d.mstr_item_type_c,'00')),
xmlelement("sszCode",d.reg_ssz_excpt_c),
xmlelement("agriFlag",NVL(d.agrl_f,'N')),
xmlelement("itemRankCode",d.item_rank_c),
xmlelement("hazardFlag",NVL(d.hazd_mtrl_f,'N')),
xmlelement("createDate",to_char(d.create_d,'MM-DD-YYYY HH24:MI:SS')),
xmlelement("updateDate",to_char(d.modf_ts,'MM-DD-YYYY HH24:MI:SS')),
xmlelement("actvnDate",to_char(d.actvn_d,'MM-DD-YYYY HH24:MI:SS')),
xmlelement("organicCode",d.ognc_c),
xmlelement("lotCntlFlag",NVL(d.lot_cntl_f,'N')),
xmlelement("flammableFlag",NVL(d.flam_c,'N')),
xmlelement("recordMode",c.action_c),
xmlelement("areaType",p1_test),
xmlelement("uoms",
xmlelement("uom",
xmlelement("prodUOM",p1_test),
xmlelement("ratioDen",p1_test),
xmlelement("consldtRule",p1_test),
xmlelement("unitWtQty",NVL(d.unit_wt_q,1)),
xmlelement("vcpHeightQty",NVL(d.vcp_ht_q,1)),
xmlelement("vcpWidthQty",NVL(d.vcp_wth_q,1)),
xmlelement("vcpLengthQty",NVL(d.vcp_lgth_q,1)),
xmlelement("layerQty",p1_test)
(SELECT xmlelement("aliases",
xmlagg(xmlelement("upcCode",trunc(b.bar_code_i))
ORDER BY b.dept_i,b.class_i,b.item_i
FROM dc_item_bar_code b,
dc_item a
WHERE a.dept_i = b.dept_i
AND a.class_i = b.class_i
AND a.item_i = b.item_i
AND a.dept_i = c.dept_i
AND a.class_i = c.class_i
AND a.item_i = c.item_i
AS VARCHAR2(4000)
) INTO x
FROM dc_item d, item_wm_trigger_w c
WHERE d.dept_i = c.dept_i
AND d.class_i = c.class_i
AND d.item_i = c.item_i;
end;
ERROR at line 1:
ORA-06550: line 49, column 33:
PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
ORA-06550: line 49, column 33:
PL/SQL: ORA-00904: "XMLAGG": invalid identifier
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
When I run this query without the
declare
begin
select....
into...
end
construct, it's working perfectly fine.
Any help would be greatly appreciated.
Thanks,
Nitin

I think I confused you. The 'pre' tags are for this Oracle Forum ( not your code). If your code was formatted we can look at it better .
For example, I have put your code in those tags(you won't see them), they are for the forum software to process.
See, how I didn't lose the formatting?
DECLARE
  x VARCHAR2(6000);
BEGIN
  SELECT CAST(xmlelement("itemMaster",
                         xmlelement("itemNumber",
                                    lpad(d.dept_i, 3, 0) || lpad(d.class_i, 2, 0) ||
                                    lpad(d.item_i, 4, 0)),
                         xmlelement("itemDesc",
                                    NVL(d.ITEM_DESC_T,
                                        lpad(d.dept_i, 3, 0) ||
                                        lpad(d.class_i, 2, 0) ||
                                        lpad(d.item_i, 4, 0))),
                         xmlelement("paltSize", p1_test),
                         xmlelement("stdUOM", p1_test),
                         xmlelement("sellByDayQty", d.sell_by_day_q),
                         xmlelement("shflfUOM", p1_test),
                         xmlelement("minShflfDayQty", d.min_shflf_day_q),
                         xmlelement("itemCatgCode", NVL(d.dc_item_catg_c, 'GM')),
                         xmlelement("strgTempZoneCode",
                                    NVL(d.strg_tmpr_zone_c, '01')),
                         xmlelement("retailAmt", retl_a),
                         xmlelement("expireDateFlag", NVL(d.expire_date_f, 'N')),
                         xmlelement("randomWtFlag", NVL(d.rndm_wt_f, 'N')),
                         xmlelement("wetFlag", NVL(d.wet_f, 'N')),
                         xmlelement("areaCode", d.area_c),
                         xmlelement("vcpQty", d.vcp_q),
                         xmlelement("sspQty", d.ssp_q),
                         xmlelement("hndlTypeCode", d.hndl_type_c),
                         xmlelement("mstrPackTypeCode", d.mstr_pk_type_c),
                         xmlelement("mstrItemTypeCode",
                                    NVL(d.mstr_item_type_c, '00')),
                         xmlelement("sszCode", d.reg_ssz_excpt_c),
                         xmlelement("agriFlag", NVL(d.agrl_f, 'N')),
                         xmlelement("itemRankCode", d.item_rank_c),
                         xmlelement("hazardFlag", NVL(d.hazd_mtrl_f, 'N')),
                         xmlelement("createDate",
                                    to_char(d.create_d, 'MM-DD-YYYY HH24:MI:SS')),
                         xmlelement("updateDate",
                                    to_char(d.modf_ts, 'MM-DD-YYYY HH24:MI:SS')),
                         xmlelement("actvnDate",
                                    to_char(d.actvn_d, 'MM-DD-YYYY HH24:MI:SS')),
                         xmlelement("organicCode", d.ognc_c),
                         xmlelement("lotCntlFlag", NVL(d.lot_cntl_f, 'N')),
                         xmlelement("flammableFlag", NVL(d.flam_c, 'N')),
                         xmlelement("recordMode", c.action_c),
                         xmlelement("areaType", p1_test),
                         xmlelement("uoms",
                                    xmlelement("uom",
                                               xmlelement("prodUOM", p1_test),
                                               xmlelement("ratioDen", p1_test),
                                               xmlelement("consldtRule", p1_test),
                                               xmlelement("unitWtQty",
                                                          NVL(d.unit_wt_q, 1)),
                                               xmlelement("vcpHeightQty",
                                                          NVL(d.vcp_ht_q, 1)),
                                               xmlelement("vcpWidthQty",
                                                          NVL(d.vcp_wth_q, 1)),
                                               xmlelement("vcpLengthQty",
                                                          NVL(d.vcp_lgth_q, 1)),
                                               xmlelement("layerQty", p1_test))),
                         (SELECT xmlelement("aliases",
                                            xmlagg(xmlelement("upcCode",
                                                              trunc(b.bar_code_i))
                                                   ORDER BY b.dept_i,
                                                   b.class_i,
                                                   b.item_i))
                            FROM dc_item_bar_code b, dc_item a
                           WHERE a.dept_i = b.dept_i
                             AND a.class_i = b.class_i
                             AND a.item_i = b.item_i
                             AND a.dept_i = c.dept_i
                             AND a.class_i = c.class_i
                             AND a.item_i = c.item_i)) AS VARCHAR2(4000))
    INTO x
    FROM dc_item d, item_wm_trigger_w c
   WHERE d.dept_i = c.dept_i
     AND d.class_i = c.class_i
     AND d.item_i = c.item_i;
END;
/

Similar Messages

  • Mapping proc output to vars gets error extracting result into a variable of type (DBTYPE_UI2)

    Hi, we run std 2012.  I have a proc (sets nocount on) whose params r shown in the first block .   My execute ssis sql task mapping is shown in the block following that (same order as shown, the param sizes are all -1).  The variable
    characteristics and initial values are shown in the 3rd block.  The execute sql task command is
    exec usp_fileArrivalStatus ?,?,?,?,?,? output,? output,? output
    when I run the proc in ssms followed by a select on the output fields, I get stat 0, instance id -1 and file name empty string (aka tick tick aka '')
    The error is:
    [Execute SQL Task] Error: Executing the query "exec usp_fileArrivalStatus ?,?,?,?,?,? output,? ou..." failed with the following error:
    "An error occurred while extracting the result into a variable of type (DBTYPE_UI2)".
    Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Does anybody know what is wrong?
    CREATE PROCEDURE [dbo].[usp_fileArrivalStatus] @NewFilePattern varchar(500),
    @PkgName varchar (257),
    @appid int,
    @MsgHistCreateDate date,
    @messageFriendlyName varchar(500),
    @arrivalStatus int output,
    @instanceId bigint output,
    @fileName varchar(500) output
    VariableName Direction DataType ParamName
    User::TranFilePattern Input VARCHAR 0
    System::PackageName Input VARCHAR 1
    User::AppID Input SHORT 2
    User::todaysDate Input DATE 3
    User::TranFileArriveStatus OUTPUT SHORT 5
    User::TranFileInstanceId OUTPUT LARGE_INTEGER 6
    User::TranFileName OUTPUT VARCHAR 7
    User::TranFileFriendlyName Input VARCHAR 4
    User::TranFilePattern,string,tranfile05-Nov-2014
    User::fileDate,string,05-Nov-2014
    System::PackageName,
    User::AppID,int32,12
    User::todaysDate,DateTime, set by select getdate()
    User::TranFileArriveStatus,int32,0
    User::TranFileInstanceId,Int64,0
    User::TranFileName,string
    User::TranFileFriendlyName,string,Tran File

    I may have gotten past this.  The ui showed the first execution of that proc as the aborting component but when I looked at my error code (-1073548784), and component name in the
    message sent with notification email, I noticed the second component name.  It too executes that proc and still had ushort for appid in sql task mapping and long for instance id.  I changed these characteristics to match what I posted and got green
    on the seq container that runs both.
    I think I go thru this kind of adventure every time I try to map proc output to ssis vars.   

  • XMLELEMENT/ XMLAGG functions

    Hi, I have a query to generate an XML output. I have the following questions:
    1) I am typecasting the result from this query to a VARCHAR2 and I want to assign the output to a VARCHAR2 variable. Can you please help me with that. When I try to get this into a varchar variable, i get the following error:
    declare
    x varchar2(6000);
    begin
    SELECT CAST(xmlelement("itemMaster",
    xmlelement("itemNumber",lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0)),
    xmlelement("itemDesc",NVL(d.ITEM_DESC_T,lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0))),
    xmlelement("paltSize",p1_test),
    xmlelement("stdUOM",p1_test),
    xmlelement("sellByDayQty",d.sell_by_day_q),
    xmlelement("shflfUOM",p1_test),
    xmlelement("minShflfDayQty",d.min_shflf_day_q),
    xmlelement("itemCatgCode",NVL(d.dc_item_catg_c,'GM')),
    xmlelement("strgTempZoneCode",NVL(d.strg_tmpr_zone_c,'01')),
    xmlelement("retailAmt",retl_a),
    xmlelement("expireDateFlag",NVL(d.expire_date_f,'N')),
    xmlelement("randomWtFlag",NVL(d.rndm_wt_f,'N')),
    xmlelement("wetFlag",NVL(d.wet_f,'N')),
    xmlelement("areaCode",d.area_c),
    xmlelement("vcpQty",d.vcp_q),
    xmlelement("sspQty",d.ssp_q),
    xmlelement("hndlTypeCode",d.hndl_type_c),
    xmlelement("mstrPackTypeCode",d.mstr_pk_type_c),
    xmlelement("mstrItemTypeCode",NVL(d.mstr_item_type_c,'00')),
    xmlelement("sszCode",d.reg_ssz_excpt_c),
    xmlelement("agriFlag",NVL(d.agrl_f,'N')),
    xmlelement("itemRankCode",d.item_rank_c),
    xmlelement("hazardFlag",NVL(d.hazd_mtrl_f,'N')),
    xmlelement("createDate",to_char(d.create_d,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("updateDate",to_char(d.modf_ts,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("actvnDate",to_char(d.actvn_d,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("organicCode",d.ognc_c),
    xmlelement("lotCntlFlag",NVL(d.lot_cntl_f,'N')),
    xmlelement("flammableFlag",NVL(d.flam_c,'N')),
    xmlelement("recordMode",c.action_c),
    xmlelement("areaType",p1_test),
    xmlelement("uoms",
    xmlelement("uom",
    xmlelement("prodUOM",p1_test),
    xmlelement("ratioDen",p1_test),
    xmlelement("consldtRule",p1_test),
    xmlelement("unitWtQty",NVL(d.unit_wt_q,1)),
    xmlelement("vcpHeightQty",NVL(d.vcp_ht_q,1)),
    xmlelement("vcpWidthQty",NVL(d.vcp_wth_q,1)),
    xmlelement("vcpLengthQty",NVL(d.vcp_lgth_q,1)),
    xmlelement("layerQty",p1_test)
    (SELECT xmlelement("aliases",
    xmlagg(xmlelement("upcCode",trunc(b.bar_code_i))
    ORDER BY b.dept_i,b.class_i,b.item_i
    FROM dc_item_bar_code b,
    dc_item a
    WHERE a.dept_i = b.dept_i
    AND a.class_i = b.class_i
    AND a.item_i = b.item_i
    AND a.dept_i = c.dept_i
    AND a.class_i = c.class_i
    AND a.item_i = c.item_i
    AS VARCHAR2(4000)
    ) INTO x
    FROM dc_item d, item_wm_trigger_w c
    WHERE d.dept_i = c.dept_i
    AND d.class_i = c.class_i
    AND d.item_i = c.item_i;
    end;
    ERROR at line 1:
    ORA-06550: line 49, column 33:
    PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
    ORA-06550: line 49, column 33:
    PL/SQL: ORA-00904: "XMLAGG": invalid identifier
    ORA-06550: line 4, column 1:
    PL/SQL: SQL Statement ignored
    When I run this query without the
    declare
    begin
    select....
    into...
    end
    construct, it's working perfectly fine.
    Any help would be greatly appreciated.
    Thanks,
    Nitin

    Is there a valid reason for putting the XMLTYPE result into a VARCHAR variable?
    In most cases you can deal with your XML document by keeping it in the XMLTYPE. Should you need it in a "character" type format, then you are better using the .getClobVal() method on the XMLTYPE result to put the results into a CLOB as this will not have the size restriction of a VARCHAR.

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • Search in Nested Tables and Insert the result into new Nested Table!

    How can I search in Nested Tables ex: (pr_travel_date_range,pr_bo_arr) using the SQL below and insert the result into a new Nested Table: ex:g_splited_range_arr.
    Here are the DDL and DML SQLs;
    Don't worry about the NUMBER( 8 )
    CREATE OR REPLACE TYPE DATE_RANGE IS OBJECT ( start_date NUMBER( 8 ), end_date NUMBER( 8 ) );
    CREATE OR REPLACE TYPE DATE_RANGE_ARR IS TABLE OF DATE_RANGE;
    DECLARE
       g_splited_range_arr   DATE_RANGE_ARR := DATE_RANGE_ARR( );
       g_travel_range        DATE_RANGE := DATE_RANGE( '20110101', '99991231' );
       g_bo_arr              DATE_RANGE_ARR := DATE_RANGE_ARR( DATE_RANGE( '20110312', '20110317' ), DATE_RANGE( '20110315', '20110329' ) );
       FUNCTION split_date_sql( pr_travel_date_range    DATE_RANGE,
                                pr_bo_arr               DATE_RANGE_ARR )
          RETURN DATE_RANGE_ARR
       IS
          l_splited_range_arr   DATE_RANGE_ARR;
       BEGIN
          SELECT start_date, end_date
            INTO l_splited_range_arr(start_date, end_date)
            FROM (WITH all_dates
                          AS (SELECT tr_start_date AS a_date, 0 AS black_out_val FROM TABLE( pr_travel_date_range )
                              UNION ALL
                              SELECT tr_end_date, 0 FROM TABLE( pr_travel_date_range )
                              UNION ALL
                              SELECT bo_start_date - 1, 1 FROM TABLE( pr_bo_arr )
                              UNION ALL
                              SELECT bo_end_date + 1, -1 FROM TABLE( pr_bo_arr )),
                       got_analytics
                          AS (SELECT a_date AS start_date,
                                     LEAD( a_date ) OVER (ORDER BY a_date, black_out_val) AS end_date,
                                     SUM( black_out_val ) OVER (ORDER BY a_date, black_out_val) AS black_out_cnt
                                FROM all_dates)
                    SELECT start_date, end_date
                      FROM got_analytics
                     WHERE black_out_cnt = 0 AND start_date < end_date
                  ORDER BY start_date);
          RETURN l_splited_range_arr;
       END;
    BEGIN
        g_splited_range_arr := split_date_sql(g_travel_range,g_bo_arr);
        FOR index_g_splited_range_arr IN g_splited_range_arr .FIRST .. g_splited_range_arr .LAST LOOP       
            DBMS_OUTPUT.PUT_LINE('g_splited_range_arr[' || index_g_splited_range_arr || ']: ' || g_splited_range_arr(index_g_splited_range_arr).start_date || '-'  || g_splited_range_arr(index_g_splited_range_arr).end_date );
        END LOOP;
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          NULL;
       WHEN OTHERS
       THEN
          NULL;
    END;Or can I create a VIEW with parameters of Nested Tables in it so I can simply call
    SELECT  *
      BULK COLLECT INTO g_splited_range_arr
      FROM view_split_date(g_travel_range,g_bo_arr);

    @riedelme
    For your questions:
    1) I don't want to store in the database as a nested table
    2) I don't want to retrieve data from the database. Data will come from function split_date() parameter and data will be processed in the function and function will return it in nested table format. For more detail please look at the raw function SQL.
    I have a SQL like:
    WITH all_dates
            AS (SELECT tr_start_date AS a_date, 0 AS black_out_val FROM travel
                UNION ALL
                SELECT tr_end_date, 0 FROM travel
                UNION ALL
                SELECT bo_start_date - 1, 1 FROM black_out_dates
                UNION ALL
                SELECT bo_end_date + 1, -1 FROM black_out_dates),
         got_analytics
            AS (SELECT a_date AS start_date,
                       LEAD( a_date ) OVER (ORDER BY a_date, black_out_val)
                          AS end_date,
                       SUM( black_out_val ) OVER (ORDER BY a_date, black_out_val)
                          AS black_out_cnt
                  FROM all_dates)
      SELECT start_date, end_date
        FROM got_analytics
       WHERE black_out_cnt = 0 AND start_date < end_date
    ORDER BY start_date;I want to change the tables black_out_dates and travel to Nested Array so I can use it in a function with Nested Array travel and Nested Array black_out_dates parameters and the function will return Nested Array of date ranges.
    Here is what I want in raw SQL:
        DECLARE
           g_splited_range_arr   DATE_RANGE_ARR := DATE_RANGE_ARR( );
           g_travel_range        DATE_RANGE := DATE_RANGE( '20110101', '99991231' );
           g_bo_arr              DATE_RANGE_ARR := DATE_RANGE_ARR( DATE_RANGE( '20110312', '20110317' ), DATE_RANGE( '20110315', '20110329' ) );
           FUNCTION split_date_sql( pr_travel_date_range    DATE_RANGE,
                                    pr_bo_arr               DATE_RANGE_ARR )
              RETURN DATE_RANGE_ARR
           IS
              l_splited_range_arr   DATE_RANGE_ARR;
           BEGIN
              SELECT start_date, end_date
                INTO l_splited_range_arr(start_date, end_date)
                FROM (WITH all_dates
                              AS (SELECT tr_start_date AS a_date, 0 AS black_out_val FROM TABLE( pr_travel_date_range )
                                  UNION ALL
                                  SELECT tr_end_date, 0 FROM TABLE( pr_travel_date_range )
                                  UNION ALL
                                  SELECT bo_start_date - 1, 1 FROM TABLE( pr_bo_arr )
                                  UNION ALL
                                  SELECT bo_end_date + 1, -1 FROM TABLE( pr_bo_arr )),
                           got_analytics
                              AS (SELECT a_date AS start_date,
                                         LEAD( a_date ) OVER (ORDER BY a_date, black_out_val) AS end_date,
                                         SUM( black_out_val ) OVER (ORDER BY a_date, black_out_val) AS black_out_cnt
                                    FROM all_dates)
                        SELECT start_date, end_date
                          FROM got_analytics
                         WHERE black_out_cnt = 0 AND start_date < end_date
                      ORDER BY start_date);
              RETURN l_splited_range_arr;
           END;
        BEGIN
            g_splited_range_arr := split_date_sql(g_travel_range,g_bo_arr);
            FOR index_g_splited_range_arr IN g_splited_range_arr .FIRST .. g_splited_range_arr .LAST LOOP       
                DBMS_OUTPUT.PUT_LINE('g_splited_range_arr[' || index_g_splited_range_arr || ']: ' || g_splited_range_arr(index_g_splited_range_arr).start_date || '-'  || g_splited_range_arr(index_g_splited_range_arr).end_date );
            END LOOP;
        EXCEPTION
           WHEN NO_DATA_FOUND
           THEN
              NULL;
           WHEN OTHERS
           THEN
              NULL;
        END;I must change the tables black_out_dates and travel in a way so it will be something like
    FROM TABLE( pr_travel_date_range )to get the result into l_splited_range_arr so it will be something like
              SELECT start_date, end_date
                INTO l_splited_range_arr(start_date, end_date)
                FROM (

  • Copy the result of Execute immediate result into a variable.

    Hi All,
    Is there any way to copy the result of execute immediate result into a variable.
    am doing following steps but am getting an error.
    varSQLstmt1:='select count(*) into'||vararch_ct||' from '||vararch_count;
    dbms_output.put_line(varSQLstmt1);
    execute immediate varSQLstmt1;
    But am getting sql statement as select count(*) into from SALES
    the variable(vararch_ct) is missing in select statement .
    please help me to solve this issue. Or is there any way to insert the count of records into any variable.
    Thanks
    Sree

    declare
    varSQLstmt1    varchar2(4000);
    v_count          number;
    begin
    varSQLstmt1:='select count(*) from '||vararch_count;
    dbms_output.put_line(varSQLstmt1);   
    execute immediate varSQLstmt1 into v_count;
    dbms_output.put_line('Coutn :: ' || v_count);
    end;

  • Crystal Report is very slow to fetch the results of a Query used in Command

    Hello All,
    We have a query which is used in command object in Business Objects Crystal reports XI. This report is executed against IBM DB2 database. It is taking 40 min to getback the results. Here is the Query. Please suggest how can i improve the performance of this query in report as another reporting tool is taking 2-3 min time to fetch the results with the same query.
    SELECT
    A1.CARR_NUM ,  A1.CST_CTR_NUM ,A1.CLM_CLOSE_STS_CD ,   A1.CLM_RJCT_STS_CD ,A1.CLM_VOID_STS_CD ,  A1.PMT_MTCH_DT , A1.ASC_TRANS_TYP_CD ,  A1.DRUG_DESC ,               
    A1.BATCH_NUM ,   T5.TPA_RJCT_CD ,  A1.DIV_NUM , A1.INVC_NUM ,  A1.SERVICE_DT ,  A1.ACTL_REFILL_NUM ,  A1.CLM_DSPSN_CD ,  A1.INVC_RSBMT_CD , A1.TP_TOTAL_DUE_AMT ,  
    A1.INTL_BILG_MTHD_CD , A1.CARR_EOB_1_CD ,  T5.CARR_EOB_CD_DESC ,  A1.NTNL_DRUG_CD ,  A1.PTNT_FRST_NM ,  A1.PTNT_MDDL_INTL ,  A1.PTNT_LST_NM ,  A1.PTNT_BIRTH_DT ,
    A1.CRDHLDR_ID_NUM   
    FROM
    (SELECT DISTINCT
        T1.CARR_NUM ,  T1.CST_CTR_NUM ,  T1.CLM_CLOSE_STS_CD ,  T1.CLM_RJCT_STS_CD ,   T1.CLM_VOID_STS_CD ,  T3.PMT_MTCH_DT ,   
        T3.ASC_TRANS_TYP_CD ,  T2.DRUG_DESC ,  T4.BATCH_NUM , T1.DIV_NUM ,  T1.INVC_NUM ,  T1 . SERVICE_DT ,  T1.ACTL_REFILL_NUM ,                                         
        T1.CLM_DSPSN_CD ,  T1.INVC_RSBMT_CD ,T1.TP_TOTAL_DUE_AMT ,  T1.INTL_BILG_MTHD_CD ,T3.CARR_EOB_1_CD ,T1.NTNL_DRUG_CD ,  T2.PTNT_FRST_NM ,         T2.PTNT_MDDL_INTL , T2.PTNT_LST_NM ,  T2.PTNT_BIRTH_DT ,  T2.CRDHLDR_ID_NUM 
       FROM  
                    PDRD2LO.VINVC_CLM T1                             
                   , PDRD2LO.VPMNT_DTL T3                             
                   , PDRD2LO.VINVC_CLM_2 T2                           
                   , PDRD2LO.VINVC_ITM_PHARM  T4                     
                        WHERE  
      T1.CLM_CLOSE_STS_CD ='OP'                     
                  AND  T1.CLM_RJCT_STS_CD ='RJ'                       
                  AND  T1.CLM_VOID_STS_CD ='NV'                       
                  AND  T3.ASC_TRANS_TYP_CD ='40'                      
                  AND  T1.CARR_NUM = T3.CARR_NUM                      
               AND   T1.CST_CTR_NUM = T3.CST_CTR_NUM                  
               AND   T1.DIV_NUM = T3.DIV_NUM                          
               AND   T1.INVC_NUM = T3.INVC_NUM                        
               AND   T1.SERVICE_DT = T3.SERVICE_DT                    
               AND   T1.CLM_CTRL_NUM = T3.CLM_CTRL_NUM                
               AND   T1.ACTL_REFILL_NUM = T3.ACTL_REFILL_NUM          
               AND   T1.INVC_ITM_NUM = T3.INVC_ITM_NUM                
               AND   T1.REFILL_TRANS_NUM = T3.REFILL_TRANS_NUM        
               AND   T1.CARR_NUM = T2.CARR_NUM                        
               AND   T1.CST_CTR_NUM = T2.CST_CTR_NUM                  
               AND   T1.DIV_NUM = T2.DIV_NUM                          
               AND   T1.INVC_NUM = T2.INVC_NUM                        
               AND   T1.SERVICE_DT = T2.SERVICE_DT                  
               AND   T1.ACTL_REFILL_NUM = T2.ACTL_REFILL_NUM        
               AND   T1.CLM_CTRL_NUM = T2.CLM_CTRL_NUM              
               AND   T1.INVC_ITM_NUM = T2.INVC_ITM_NUM              
               AND   T1.REFILL_TRANS_NUM = T2.REFILL_TRANS_NUM      
               AND   T1.INVC_CTRL_NUM = T4.INVC_CTRL_NUM) A1        
    LEFT OUTER JOIN  PDRD2LO.VCARR_EOB T5                
                ON    A1.CARR_EOB_1_CD = T5.CARR_EOB_CD             
                AND   A1.CARR_NUM = T5.CARR_NUM                     
                AND   A1.DIV_NUM = T5.DIV_NUM        
    Thanks!

    Hi Zilla Eh ,
    Thanks for the reply.
    The another reporting tool name is impromptu and it takes 2-3 min , where in Crystal report is taking around 40 min. Please let me know if you any other questions.
    Regards
    Ravi

  • How I can transfer data from the database into a variable (or array)?

    I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
    (<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}"  width="296" height="89"  />).
    It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
    Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
    How can I pass a value from the database into a variable? Thank you.
    public var nameTemp:String;
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
    nameTemp = getDataMeanResult.lastResult[0].name;
    public var nameArray:Array = new Array();
    for (var i:uint=o; i<3; i++){
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
    nameArray[i] = getDataMeanResult.lastResult[0].name;
    And how i can use syntax highlighting in this forum?

    Astraport2012 wrote:
    I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
    yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
    easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
    for example, you could have the PHP generate XML such as:
    <pictures>
         <location>test1.png</location>
         <location>test2.png</location>
         <location>test3.png</location>
         <location>test4.png</location>
         <location>test5.png</location>
         <location>test6.png</location>
    </pictures>
    then you'll read that in as the ResultEvent, and perform something like this on it
    private var tempAC:ArrayList = new ArrayList
    protected function getStuff_resultHandler(event:ResultEvent):void
        for each(var item:Object in event.result.pictures)
           var temp:String = (item.@location).toString();
           tempAC.addItem(temp);
    in my example on cookies
    http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
    you'll see an example of how to format an XML structure containing multiple values:
    if($_COOKIE["firstName"])
            print "<stored>true</stored>";
            print "<userInfo>
                    <firstName>".$_COOKIE["firstName"]."</firstName>
                    <lastName>".$_COOKIE["lastName"]."</lastName>
                    <userAge>".$_COOKIE["userAge"]."</userAge>
                    <gender>".$_COOKIE["gender"]."</gender>
                   </userInfo>";
        else
            print "<stored>false</stored>";
    which i handle like so
    if(event.result.stored == true)
                        entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
                        firstName.text = event.result.userInfo.firstName;
                        lastName.text = event.result.userInfo.lastName;
                        userAge.value = event.result.userInfo.userAge;
                        userGender.selectedIndex = event.result.userInfo.gender;
    depends on what type of Array you're after
    from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
    so i'd probably adopt something like
    <picture>
         <location>example1.png</location>
         <tooltip>tooltip for picture #1</tooltip>
    </picture>
    <picture>
         <location>example2.png</location>
         <tooltip>tooltip for picture #2</tooltip>
    </picture>
    <picture>
         <location>example3.png</location>
         <tooltip>tooltip for picture #3</tooltip>
    </picture>
    etc...
    or
    <picture location="example1.png" tooltip="tooltip for picture #1"/>
    <picture location="example2.png" tooltip="tooltip for picture #2"/>
    <picture location="example3.png" tooltip="tooltip for picture #3"/>
    etc...

  • How to execute a function and return the result into a bind variable

    Hi,
    I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
    create or replace function total_income
    +(v_job_id IN varchar2)+
    RETURN number IS
    v_total number(6);
    cursor get_sal is
    select salary from employees
    where job_id = v_job_id;
    BEGIN
    v_total := 0;
    for emp in get_sal
    loop
    v_total := v_total emp.salary;+
    end loop;
    dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
    return v_total;
    END;
    Now I woud like to execute this function and assign the returned value into a bind variable test_sal
    variable test_sal number(6)
    SELECT total_income('AD_VP') into :test_sal FROM DUAL;
    dbms_output.put_line('Total Sal:'||:test_sal);
    This is returning the below errors:
    SELECT total_income('AD_VP') into :test_sal FROM DUAL
    *+
    Error at line 0
    ORA-01036: illegal variable name/number
    dbms_output.put_line('Total Sal:'||:test_sal);
    Error at line 3
    ORA-00900: invalid SQL statement
    Could someone help me what could be the problem?? Thanks for your time...

    Dear,
    If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
    The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
    So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
    Best regards
    Mohamed Houri

  • Fetching large results into excel

    I would like to fetch 50,000 records from an oracle database and store it as an ascii file so that it can be viewed through an excel. The request will be initiated from a client�s computer through J2ee web application.
    1. What is the best way to fetch the 50,000 records and store in an ASCII/Excel file?
    2. Is there a potential performance issue in writing into local PC/Laptop?
    Thankyou,
    Ramran

    Ramran wrote:
    I would like to fetch 50,000 records from an oracle database and store it as an ascii file so that it can be viewed through an excel. Who in their right mind would want to view 50K records on the web?
    The request will be initiated from a client&#146;s computer through J2ee web application. What's the use case? Here's one:
    1. User specifies WHERE clause to specify which records they want
    2. Application queries database and sends result to browser using Excel MIME type
    3. User now has the option of saving the browser as an Excel file to their local machine
    1. What is the best way to fetch the 50,000 records and store in an ASCII/Excel file?"Best"? You'll use JDBC for the fetch, of course. I'd use Andy Khan's JExcel and Spring's JExcelView to render in the browser.
    2. Is there a potential performance issue in writing into local PC/Laptop?Sure. Depending on how large each record is (X bytes/record), you'll have 50000X bytes consumed on the server and in the browser for each request. How many simultaneous users do you plan on having? Nevermind the network latency required to fetch the data and stream it to the browser.
    %

  • Can query output the result into excel with a fix format?

    Hi Expert,
    My user giving me a requirement for new reports. They do not want the standard SAP report format but they want the result to be populate into a excel template with their own fix format. Can BW generate the report like this? Or it is out of the functionality of BW. FYI, I'm using SAP BI 7.0.
    Thanks!
    Regards.

    Hi Ang,
    You have a way to do through the Bex Analyzer.
    Please get the excel template in that please use a analysis design item in the place of the query result display.
    Then after adding the analysis item then please assign a DP (data provider) with the query you have created.
    After that please save the work book in your roles or fav's.
    Note: some important settings has to be changed for the workbook.
    In workbook settings, tick mark the property "REFRESH upon open of work book"
    With Regards,
    Ravi

  • Oracle 11g SUM function on the result of inner Select

    The inner Select returns rows with the values. The outer select running on tthe result of inner select SUM the result of the inner select.
    Although there are valid rows of the inner select the SUM in the outer SELECT return NVL. As a comment any aggregate function on the outer select returns NVL.
    The query is below.
    select a.yil,
    a.ay,
    sum(brut_prim),
    sum(kom),
    from (SELECT oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy') yil,
    to_char(pp.zeyil_tanzim_tar, 'mm') ay,
    sum(decode(substr(pp.no, 1, 1),
    'T',
    pp.zeyil_brut_prim_fark / 2,
    pp.zeyil_brut_prim_fark)) -
    sum(pp.zeyil_gv_fark) brut_prim,
    sum(pp.zeyil_acente_kom_fark) kom
    from pol_police pp, org_acente oa
    WHERE SUBSTR(PP.NO, 1, 1) != 'D')
    group by oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy'),
    to_char(pp.zeyil_tanzim_tar, 'mm')) a
    group by a.yil, a.ay, oid_pol_kesilen_acente
    Edited by: [email protected] on May 7, 2010 2:09 AM
    Edited by: [email protected] on May 7, 2010 2:31 AM

    Hi,
    please try the below sql:
    select a.yil, a.ay, sum(brut_prim), sum(kom),
    from (SELECT oid_pol_kesilen_acente,to_char(pp.zeyil_tanzim_tar, 'yyyy') yil, to_char(pp.zeyil_tanzim_tar, 'mm') ay,
    sum(decode(substr(pp.no, 1, 1), 'T',nvl(pp.zeyil_brut_prim_fark,0) / 2,nvl(pp.zeyil_brut_prim_fark,0))) - sum(nvl(pp.zeyil_gv_fark,0)) brut_prim,
    sum(nvl(pp.zeyil_acente_kom_fark,0)) kom
    from pol_police pp, org_acente oa
    WHERE SUBSTR(PP.NO, 1, 1) != 'D'
    group by oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy'),
    to_char(pp.zeyil_tanzim_tar, 'mm')
    ) a
    group by a.yil, a.ay, oid_pol_kesilen_acente ;
    Thanks,
    Siva

  • TimeStampDiff function ROUNDing the result. How can we avoid this?

    Hi,
    I am using the following timestamp function:
    TIMESTAMPDIFF(SQL_TSI_HOUR, "SF_CS_CS_Fact"."Crtddt_Dt", "SF_Emlmssg_Sum_CS"."Initl Resp Tm")
    I notice that the result set is rounded off to the whole no.
    This is happening because OBIEE autimatically ROUNDS the difference of the timestamps whe using TIMESTAMPDIFF:
    select distinct D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10
    from
    (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10
    from
    (select 0 as c1,
    D1.c4 as c2,
    D1.c5 as c3,
    D1.c3 as c4,
    D1.c2 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c1 as c10,
    ROW_NUMBER() OVER (PARTITION BY D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9 ORDER BY D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c7 ASC, D1.c8 ASC, D1.c9 ASC) as c11
    from
    (select distinct ROUND ( ( CAST(T14421.INITIAL_RESPONSE_TIME as DATE)  - CAST(T14963.CRTDDT_DT as DATE)  ) 24 ) as c1*,
    T14963.CRTDDT_DT as c2,
    T14963.CSNMBR as c3,
    T4813.FISCAL_YEAR_NAME as c4,
    T4813.FISCAL_QUARTER_NAME as c5,
    T14421.INITIAL_RESPONSE_TIME as c6,
    T14468.GRP as c7,
    T4813.FISCAL_YEAR_ID as c8,
    T4813.FISCAL_QUARTER_ID as c9
    from
    DW_SF_EMLMSSG_SUM_CS T14421,
    DW_SF_EMLMSSG_CS T14400,
    SF_ORGN_CS_DIM T14468,
    CIN_CALENDARS_DIM T4813,
    DW_SF_CS_CS T14963 /* SF_CS_CS_Fact */
    where ( T14400.PRNTID = T14963.ID and T4813.CALENDAR_KEY = T14963.CRDT_KEY and T14421.PRNTID = T14963.ID and T14400.STTS = '3' and T14468.ORGN_KEY = T14963.ORGN_KEY and T14963.TYP = 'CIN' and (T14963.CSNMBR in ('1103676964', '1103677035', '1103677076', '1103677285', '1103677303', '1103677369', '1103677389')) )
    ) D1
    ) D1
    where ( D1.c11 = 1 )
    ) D1
    order by c1, c8, c9, c7, c4, c5, c6, c10
    Please see the line in Bold in the query.
    I want to get the results in the actual decimal point and not the whole no. Is there a way that I can enable the TIMESTAMPDIFF not to ROUND by default.
    Any answers will be helpful.
    Thanks,

    When you specify in the interval in the first argument of TIMESTAMPDIFF you are implicitly telling OBIEE the level of precision that you want. For SQL_TSI_YEAR you are going to get integer values of whole years. if yo uneed to get more granular than that you need to use SQL_TSI_MONTH or WEEK.
    Also note, than when performing mathematical operations like divide an multiply, all elements of the calculation need to be a data type that can represent decimal values, or the result of the entire calc will always get converted to an integer.

  • Query a database a show the results into a form

    Hello!
    I have a general question.
    I have created a form and when the user submit it , it calls a servlet that store the information into a database.
    Now I want to make a new page where you can look for the information that the user stored in to the database (according to an ID ) and that information must be showed to the user again into a form (same form but with two or more empty fields that he can update now).
    What is the best way do that?
    Should I include in the query.jsp a bean and program all in the bean and then come back with the results to the query page?
    Im quite new to jsp, java...so , please I need your opinion about the best way to program that...
    thanks in advance

    As promised, here's a way to execute a SQL command and see the results in a JSP. It'll work with all four CRUD operations, as long as you pass valid SQL:
    <%@ page errorPage="error.jsp" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <form name="sqlQueryTester" method="post" action="sqlQueryTester.jsp">
        <center>
            <h3>SQL Query Tester</h3>
            <table>
                <tr>
                    <th>SQL Query:</th>
                    <td>
                        <textarea name="sqlQuery" rows="10" cols="80"></textarea>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <input type="submit" name="submit" value="Submit"/>
                    </td>
                    <td>
                        <input type="reset"/>
                    </td>
                </tr>
            </table>
            <c:if test="${not empty param.sqlQuery}">
                <sql:query var="queryResult" sql="${param.sqlQuery}"/>
                <hr />
                <h3>Query Results</h3>
                <c:forEach items="${queryResult.rowsByIndex}" var="row" varStatus="status">
                    <c:if test="${status.first}">
                       <table border="1" align="center" width="100%">
                           <tr bgcolor="#ffad00">
                               <c:forEach items="${queryResult.columnNames}" var="col">
                                   <th><c:out value="${col}"/></th>
                               </c:forEach>
                           </tr>
                    </c:if>
                    <tr>
                        <c:forEach items="${row}" var="value">
                            <td><c:out value="${value}"/></td>
                        </c:forEach>
                    </tr>               
                    <c:if test="${status.last}">
                        </table>
                    </c:if>
                </c:forEach>
            </c:if>
        </center>
    </form>I'll leave the web.xml and error.jsp as an exercise for you.
    This will run on Tomcat 4.1.x and JSTL version 1.0.
    %

  • How do I join two tables in the same database and load the result into a destination table in a SSIS package

    Hi,
    I have a query that joins two tables in the same database, the result needs to be loaded in a destination DB table.  How do I do this in SSIS package?
    thank you !
    Thank You Warmest Fanny Pied

    Please take a look at these links related to your query.
    http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
    http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database

Maybe you are looking for

  • Rates In Scheduling Agreement

    Hello, We are maintaining purchasing info records for all material and vendor combination and from Info records rates are flowing in the purchase order and scheduling agreemnt. But in schediling agreement buyer can change rates by going on condition

  • What is Delegated LOV (List of Value) ?

    Hi, What is Delegated LOV (List of Value) ? Thanks

  • Multiple inner joins

    any ideas on the following? not sure how to end the query.. select route.COLLECTIONFROM, schedule.DEPARTURE, route.deliveryto, schedule.arrival, goods.goodscontent, consignment.weight from route, schedule, goods, consignment where route.routeid=sched

  • Can't see bex queries in metadata repository

    Hi Pros,          I have created a lot of bex query and saved in my favorite, but I can't see them in metadata repository. why.

  • Alert Modeler in IC Winclient

    Hi all, I am configuring the alert modeler in IC WinClient in CRM 5.0. I have created a Alert modeler profile assigned it to the IC WinClient profile. And i am able to trigger the events defined the profile. My problem is that i am unable to use the