Source table has an xml column that I need to query before splitting into 2 tables.

Hi
I have a source table with an xml column that I need to query on the nodes and then depending on what data is in the node then to split it into 2 different tables. I don't think I can use conditional split so I am looking at just a straight Execute SQL Task.
Has anyone got any ideas on any other way of doing this?
Thanks for the help in advance.
Dave

Hi TheDish,
Your goal arguably can me accomplished using pure T-SQL only encompassing XPath or XQuery.
E.g. the XQuery would retrieve the nodes as explained in http://sqljudo.wordpress.com/2013/12/02/xpath-for-the-sql-server-dba/
And then you may want to use the WHERE clause to extract - insert the nodes that go to one or another table.
I don't see why SSIS is necessary, but you can run the same queries in two Data Sources, or Execute SQL Tasks (that capture a resultset).
Arthur
MyBlog
Twitter

Similar Messages

  • When I try to install ios lion the installer says my hard drive has SMART errors and that I need to buy a new Hard Drive, but my computer witch has snowleprd and runs just fine

    When I try to install ios lion the installer says my hard drive has SMART errors and that I need to buy a new Hard Drive, but my computer witch has snowleprd and runs just fine.

    SMART is a technology that monitors the drive for signs of impending failure. You can verify that SMART is indicating a problem in Disk Utility. Select the hard drive and look at the bottom of the window. It should look like this:
    If the SMART status is not "Verified" then you should back up your drive and start shopping for a new one.

  • Need a query to list all table names

    I have more than 500 tables in my database.
    'insert_date' & 'update_date' columns are found in more than 100 tables with data type as date.
    I need a query to list all table names and 'insert_date' , 'update_date' column's content.
    Please Help
    Lee1212
    Message was edited by:
    LEE1212

    I have more than 500 tables in my database.
    'insert_date' & update_date column is found in more
    than 100 tables with data type as date.
    I need a query to list all table names and
    'insert_date' column's content.What do you mean by "column's content". A table can have many rows. Do you want to display all the distinct value for these columns?
    Below is the query to get the tables which has columns insert_Date and update_date
    select table_name
    from user_tab_columns
    where column_name ='INSERT_DATE'
    or column_name ='UPDATE_DATE'
    /You can write a PL/SQL block to retrive the distinct values of INSERT_DATE for these tables
    declare
    TYPE ref_cur IS REF CURSOR;
    insert_date_cur ref_cur;
    lv_insert_date DATE;
    cursor tables_list IS
    select table_name
    from user_tab_columns
    where column_name ='INSERT_DATE';
    begin
    for cur_tables in tables_list
    loop
      OPEN insert_date_cur for 'SELECT DISTINCT insert_date from '||cur_tables.table_name;
      DBMS_OUTPUT.PUT_LINE(cur_tables.table_name);
      DBMS_OUTPUT.PUT_LINE('--------------------------------');
      LOOP
      FETCH insert_date_cur into lv_insert_date;
      EXIT WHEN insert_date_cur%NOTFOUND;
      DBMS_OUTPUT.PUT_LINE(lv_insert_date);
      END LOOP;
    CLOSE insert_date_cur;
    end loop;
    end;I haven't tested this code. There might be some errors. Just posted something to start with for you.

  • How to find a specific word (from a list) in a sentence located in a different table, and build a column that contains the name

    Hi all, 
    I have 2 tables:
    1) Lookup table- "Names"- which contains ID# and product description (~100 names that can change).
    2) Data table- "Data"- which contains a column with sentences and within lies also the description. In addition, there is a quantity column.
    Example:
    Names table-
    ID
    Name
    1 Glass
    2 Paper
    3 Alum'
    4 Metal for construction
    100 Hydro therapy products
    And Data table-
    Description
    Qty
    Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
    6
    Metal for construction is the major component in our system
    7
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="ba668f16-4de8-41d9-af39-d1b17422d6fe" id="ae5b76e8-6897-46c8-823b-86a382087f83">Kandoo</gs>, Delgado,
    Glass 17
    Greece needs more paper, 200 ft.
     45
    *there is no order where the lookup value can be found in the sentence*
    My purpose is to import the Data table while performing a calculation, that <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="1941bde7-1595-40eb-9d64-c2e3b9fabdef" id="b60549fc-5b92-46ea-abc6-72cc8c4c093b">checks</gs>
    for each row what is the suitable lookup value and then add it to a new column "Name". 
    Meaning, this table should be the new data after import:
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="f5d9da98-3ff6-4022-920d-8965a15730ee" id="580f945f-7822-4035-9b5b-542c74eff605">Description</gs>
    Qty                        
    Name
    Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
    6 Alum'
    Metal for construction is the major component in our system
    7 Metal for construction
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="365dd7f8-7ffc-4ef3-95bf-9bf03421c90d" id="c9ba8515-3dba-4a6b-929e-650510f70844">Kandoo</gs>, Delgado, Glass
    17 Glass
    Greece needs more Paper, 200 ft.
     45 Paper
    Appreciate all support! 
    I lost hope and I want to avoid macros as much as possible.
    Thanks!
    עמית

    Hi Amit,
    I updated the file. The solution uses the following query formula:
    let
    Source = Excel.CurrentWorkbook(){[Name="DataTbl"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each IndexTbl),
    #"Expand Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Scope"}, {"Scope"}),
    #"Filtered Rows" = Table.SelectRows(#"Expand Custom", each Text.Contains([Description], [Scope])),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Topic", "Component Code", "Project", "Date", "TotalQty", "TotalQtyActual", "ID", "SOW #", " SOW#(lf)Rev", "Scope Driver", "Scope Source", "Scope Source #", "Cost Code", "Type", "Bdg", "System Code", "IMF Number", "IMF Description", "WG", "C or NC", "C/e", "LLE", "Dwg Ref", "Comments ", "Description", "Size", "Qty", "Unit", "Materials Cost/Unit ", "Sub-Total per Unit €", "Unit Rate ", "Total", "DIV Code", "SYS Code", "HelperForDynfilter"}, {{"Scope", each Text.Combine([Scope], " | "), type text}})
    in
    #"Grouped Rows"
    It is based on two queries. The first is the import from table of "IndexTbl", the second is the import of "DataTbl' which is then extended according to the expression above.
    Hope this helps.
    Gil

  • Filtering a Power Query Table Based on a Column That's a Table

    I have a table produced by an outer join ... 
    "Bananas" is not one of [My Fruit] values.  I'd like to filter my join results to only include [My Fruit] values, and I thought I could do that without expanding "NewCol".
    Am I mistaken in my belief that such a selection can be done without expanding the "NewCol"?

    hi Mark Weisman,
    I suppose your [My Fruit] value is single values. You can try below :
     Table.SelectRows( Join1,  each  List.Contains( [NewCol] [Fruit] , [My Fruit] ) )
    Note: [Fruit] is the column that contain value want to filter.
    Below is my testing sample :
    let
        Source = Table.FromRows({ {"North", "Apples"}, {"North", "Orange"}, {"West", "Bananas"},{"West", "Lemon"}}, {"Region", "Fruit"}),
        Group = Table.Group(Source, {"Region"}, {{"NewCol", each _, type table}}),
        Select = Table.SelectRows( Group, each List.Contains( [NewCol] [Fruit] , "Lemon" ) )
    in
        Select
    Regards,

  • Table has too many columns for one pg in InDesign document. How do I force a break?

    I have imported an Excel table into my InDesign document.  The table is 598 columns wide.  Obviously this isn't fitting on one page.  I want it to just keep flowing from page to page, keeping one same column at the beginning of each page (like "freeze panes" does in Excel) but it's not doing that.  Is this possible in my InDesign document or will I have to manually copy and paste 10 columns at a time, which is about how many are fitting on one page?  Any searches I do on this subject just talk about flowing rows but nothing about columns. 

    As far as I know there's probably no way ID is going to do what you want.
    You can place a table across a multiple page spread, but the odds of being able to do that and still keep the file printable are marginal, at best. You can't for example, leave blank space at the gutters unless you are able to add a blank column that spans the gutter, and the limt for multipage spreads is 10 pages wide, whcih doesn't sound like it's probably enough to hold almost 600 columns.
    Perhaps placing the table using named ranges of appropriate widths would work...

  • Need a query to find a table by two of its column names

    I work in software quality assurance. Oftentimes I am trying to figure out from which table data is being pulled, but the database has thousands of tables to look through. Instead of looking through all the tables, I just take a guess at one of the column names and execute a query like this:
    SELECT table_name FROM information_schema.columns WHERE column_name like '%pur%code%'
    That usually works, but occassionally it can return hundreds of table names which doesn't help me much. Instead, I'd like to form a query that could take two column names and return all the tables that have those columns.
    So, in English, I want to say:
    "Give me the names of all the tables that have a column named like %pur%code% and another column named like %client%loc%"
    How do I do this?

    One might have hoped that the QA guy actually had sufficient documentation to tell him which table information was "pulled from".
    (or is he actually checking that the documentation is accurate and complete .... )
    SQL> select phrase from well_known
             where upper ( phrase ) like '%PIG%' and upper ( phrase ) like '%FLY%'

  • Need Logic for Inserting data into table from another table

    Hi,
    Could you please give me some logic on below:
    TABLE_A has columns A,B,C,D
    What i did
    ==========
    Created new table
    TABLE_1_A with columns A1,A2,B1,B2,B3
    Requirement
    ===========
    I should populate columns A1,A2 (table TABLE_1_A) with the data from column A (table TABLE_A)
    & simillarly populate columns B1,B2 with the data from B.
    the data is huge in the table_a.
    Database: 10g
    Thanks.

    Hi,
    Here's one way:
    INSERT INTO  table_1_a
            (a1, a2, b1, b2)
    SELECT      a,  a,  b,  b
    FROM      table_a
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ {message:id=9360002}

  • Query of insert into table

    Hi,
    I want to insert data into table by subquery and some value by manully.
    How can I insert data into table.

    SQL> create table t(no integer, obj_name varchar2(100))
      2  /
    Table created.
    SQL> create sequence my_seq
      2  /
    Sequence created.
    SQL> create or replace function get_next_val return integer
      2  as
      3     lSeq integer;
      4  begin
      5     select my_seq.nextval into lseq from dual;
      6     return lseq;
      7  end;
      8  /
    Function created.
    SQL> insert into t
      2  select get_next_val,
      3        MAX(object_name)
      4    from all_objects
      5   where object_type = 'TABLE' group by owner
      6  /
    17 rows created.
    SQL> select * from t
      2  /
            NO OBJ_NAME
             1 PSDBOWNER
             2 SDO_XML_SCHEMAS
             3 SRS$
             4 DM$P_MODEL_TABLES
             5 OL$NODES
             6 SYS_IOT_OVER_40928
             7 XML_LOAD_RECORDS
             8 T
             9 SQLPLUS_PRODUCT_PROFILE
            10 SYS_IOT_OVER_42490
            11 SALGRADE
            NO OBJ_NAME
            12 MGMT_TEMPT_SQL
            13 SI_VALUES_TAB
            14 SYS_IOT_OVER_49872
            15 xdb-log9_TAB
            16 XDB_INSTALLATION_TAB
            17 WM$WORKSPACE_SAVEPOINTS_TABLE
    17 rows selected.
    SQL>

  • How to hide columns that are getting added dynamically to UI Element 'Table

    In SRM 7.0 while displaying a RFx, click on "responses and awards" button.
    In the response comparision tab once the user selects response number and clicks on "compare all responses".
    Item details table is displayed with fields item number,internal number,item description,........,Price etc.
    Requirement is  to hide the price column from the table.
    The UI element type is 'Table'.
    But the catch is there is no column price visible at layout design level.
    This field is getting added dynamically at run time.
    When i right click and see the 'more field help' at the front end i get the field id as 'GRP_1_COL_3_TXTV'.
    lo_table ?= view->get_element( id = 'ITEMS_TABLE' ).
    lo_column = lo_table->get_column( id = 'GRP_1_COL_3_TXTV').
    ASSERT lo_column IS NOT INITIAL.
    lo_column->set_visible( EXPORTING value = '01' ).
    I had written the above code in the pre-exit of WDDOMODIFYVIEW.
    But i am getting dump as assertion failed.it says no column by name 'GRP_1_COL_3_TXTV'.
    Please help me inhow to hide fields or buttons getting generated dynmically.
    Regards,
    Venkat Raghavan.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • Can't access my email. Receiving error message that my account has been suspended and that I need to contact customer service. How do I get a phone number?

    The details are in the question. Receiving error message that my account has been suspended. Looking for a phone number to call and speak to someone. Or, please have someone call me at '''*removed*'''.
    '''Phone number removed by moderator to protect privacy'''

    Note that mozilla does not have a phone number and would never charge for services, if there is a page that says so, its a lie.

  • I need to take elements from within 2 nested for loops and place them in an array at the specific row and column that I need.

    I have tried intializing an array and replacing elements by specifying a particular row, and column, but in the end I get an array with only one element replaced, and I suspect that it is because as the for loops are running through their iterations each time the array is re-initializing. I have a simple vi that I will post below, it is not the exact situation that I have but is a good place for me to get some understanding. I have the row and column indexes being driven by the inner and outer loop iterations, which gives me the pattern I need. I am using the inner iterations as array elements. How do I set this up so that it works and d
    oes keep re-initializing my array.
    Attachments:
    Untitled.vi ‏26 KB

    I have fixed a number of things in your vi.
    You were right in thinking that the array was continuously re-initialized. To avoid this, use a shift register (right-click the loop border), which will pass the updated array into the next iteration.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    your_vi.vi.zip ‏13 KB

  • HT1688 I bought my Iphone 3gs on ebay it has an apple ID that I need to change to mine how do I do this

    I bought my IPhone 3gs on ebay I am trying to get music from ITunes but the phone has an apple aID not mine. How do I change this?

    To make it truly yours... Connect to iTunes on your computer and Restore as New...
    http://support.apple.com/kb/HT1414

  • How can I display, horizontaly the multi-fields that I programmed Content Query to pull into a subsite?

    Hello all
    Am using SP Online,
    After doing the step by step programing found on
    http://www.heathersolomon.com/blog/articles/customitemstyle.aspx
    I was able to pull from a contact list the apt #, last name and first name of a contact list onto a subsite. But the information displays' vertically
    Example
    709
    Smith
    John
    How can I get it to display horizontally?
    709 Smith John
    Thank You
    Pierre
    PS: for those who want to do the same, (as per many questions and blogs I have read) if you go to the link above, note that step 17 the original line of code and the one you would need is almost identical except you have to take out the forward slash
    after "string" see the correct line of code (as shown on the blog below) but I missed the minor difference which of course prevented the webpart to work properly.
    <property name="CommonViewFields" type="string">InternalColumnNameGoesHere,
    FieldType</property>
    pgg02

    Hello,
    the answer is in step 21 of Heather Solomon's tutorial:
    Wrap HTML around the tag to format the data.  
    Please note!! When the page renders the CQWP, the site grabs the Item Style for each line of data.  So we can't add a table and expect that each line of data will be in a row.  Instead we get a full table for each line of data. 
    Keep this in mind as you style the HTML around the data.
    You need to create the html structure and place your fields inside. To have the values show up in one row with spaces between them, place the three field calls in the same row, like
    <div><xsl:value-of select="@Field1" /> <xsl:value-of select="@Field2" /> <xsl:value-of
    select="@Field3" /></div>
    cheers, teylyn

  • HT1212 I cannot remember my iphone passcode, and i reset it with my computer, but it still says that i need a passcode to get into it.

    I just recently got an iphone and put a passcode on it and i forgot the passcode. So i went online and reset it and did what the website told me to do. But it is still requiring a passcode.

    There are two things to try. If the first thing you try fails, try the next.
    Two Button Reset.
    This is the least likely to result in loss of data.  Read that again, especially the phrase "least likley."
    Unplug the iPad from the computer.
    Press and hold both the home and the sleep/wake buttons (ignore the red slider) until you see the silver Apple logo.
    When you see the logo, let both buttons go.
    If this worked, you should see an icon instructing you to connect to iTunes.  My guess is that the reset did not work.
    DFU Restore
    This will very likley result in loss of data.
    Plug the iPad into the computer.
    Ensure that it is running the latest version of iTunes and that it has access to the internet.
    Press and hold both the home and sleep/wake buttons for exactly eight seconds.
    Release only the sleep/wake button but continue to hold the home button for another five seconds.
    Let go of the home button, then look at the computer screen for an instructional popup.
    The popup should say "iTunes has detected a device in recovery mode. . .(etc)"  Click accept to all boxes and let iTunes download and install all of the latest device Firmware and Software.
    If no popup appears, repeat the above DFU instructions.  If you 've never done a DFU, it may take about three attempts to get the timing right.

Maybe you are looking for

  • IMac G5 programs will not save, unable in system pref to unlock

    Recently I seem to have growing problem with Microsoft Office programs not being able to save without crashing: Exception: EXCBADACCESS (0x0001) Codes: KERNPROTECTIONFAILURE (0x0002) at 0x00000008. Other programs dealing with checking the system for

  • Why does my music play at abnormal speeds after updating to iOS 8.2

    Since my update, my music will either stop, or play at an abnormal faster speed. It is intermittent and only happens to songs that are purchased from the iTunes store.

  • URGENT PLEASE!!! Enter Password Final attempt

    Hi Can some one please help me, my son was playing with my mobile I tried putting the password now it is not working can someone please help I have very important information on my mobile now its asking for final attempt if I put in the pin it will e

  • Vision problem

    Hi all, Since a few months, I have a vision (eye-) problem. So it is becoming very difficult for me to read the title and artists of the songs I play on my ipod touch. Is there a way to install a langer size of characters/letters, or f.e. to replace

  • Why can't I sync my new Iphone 5 to my mac.

    My mac say I need to download the latest version of itunes which I did and then It tells me I need osx 10.8.6 or something. Also when I updated my 4s to ios6 the same message came out when I tried to sync. Befoe I updated to IOS6 I had no problems.