Query for rows as columns

Hi,
i have one table temp1:
select * from temp, it's display:
id name add
1 xx xx1
2 yy yy1
3 zz zz1
But i want display like this:
1 2 3
xx yy zz
xx1 yy1 zz1
Help me on this.....

still problem not solveing.
help me on this.
normal output:
1     xx     xx1
2     yy     yy1
3     zz     zz1
Actual output:
1     2     3..............................
x     yy     zz..............................
xx1     yy1     zz1.................................

Similar Messages

  • Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).

    Hi,
    I have a file where fields are wrapped with ".
    =========== file sample
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    ==========
    I am having a .net method to remove the wrap characters and write out a file without wrap characters.
    ======================
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    ======================
    the .net code is here.
    ========================================
    public static string RemoveCharacter(string sFileName, char cRemoveChar)
                object objLock = new object();
                //VirtualStream objInputStream = null;
                //VirtualStream objOutStream = null;
                FileStream objInputFile = null, objOutFile = null;
                lock(objLock)
                    try
                        objInputFile = new FileStream(sFileName, FileMode.Open);
                        //objInputStream = new VirtualStream(objInputFile);
                        objOutFile = new FileStream(sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString(), FileMode.Create);
                        //objOutStream = new VirtualStream(objOutFile);
                        int nByteRead;
                        while ((nByteRead = objInputFile.ReadByte()) != -1)
                            if (nByteRead != (int)cRemoveChar)
                                objOutFile.WriteByte((byte)nByteRead);
                    finally
                        objInputFile.Close();
                        objOutFile.Close();
                    return sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString();
    ==================================
    however when I run the bulk load utility I get the error 
    =======================================
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).
    ==========================================
    the bulk insert statement is as follows
    =========================================
     BULK INSERT Temp  
     FROM '<file name>' WITH  
      FIELDTERMINATOR = ','  
      , KEEPNULLS  
    ==========================================
    Does anybody know what is happening and what needs to be done ?
    PLEASE HELP
    Thanks in advance 
    Vikram

    To load that file with BULK INSERT, use this format file:
    9.0
    4
    1 SQLCHAR 0 0 "\""      0 ""    ""
    2 SQLCHAR 0 0 "\",\""   1 col1  Latin1_General_CI_AS
    3 SQLCHAR 0 0 "\",\""   2 col2  Latin1_General_CI_AS
    4 SQLCHAR 0 0 "\"\r\n"  3 col3  Latin1_General_CI_AS
    Note that the format file defines four fields while the fileonly seems to have three. The format file defines an empty field before the first quote.
    Or, since you already have a .NET program, use a stored procedure with table-valued parameter instead. I have an example of how to do this here:
    http://www.sommarskog.se/arrays-in-sql-2008.html
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Cursor in select query in row to column format

    Hi
    I have the query like below
    SELECT d.department_id,
                 CURSOR(SELECT e.first_name,
                         e.last_name
                  FROM   employees e
                  WHERE  e.department_id = d.department_id
           ) emps
    FROM   depatments dI want the result set in a format of Row To columns like
    10                             20
    <cursor result>   <cursor result>pls give ur suggestions how to achieve this in a efficient way?I tried the method of "max(decode(.." but dont think so its possible with this

    vishnu prakash wrote:
    Hi
    I have the query like below
    SELECT d.department_id,
    CURSOR(SELECT e.first_name,
    e.last_name
    FROM   employees e
    WHERE  e.department_id = d.department_id
    ) emps
    FROM   depatments dI want the result set in a format of Row To columns like
    10                             20
    <cursor result>   <cursor result>pls give ur suggestions how to achieve this in a efficient way?I tried the method of "max(decode(.." but dont think so its possible with thisNumber of column of a select query is static. Must be known at the parsing time itself. But in your case i dont think the number of columns will be limited to 2 (10 and 20) there could be many more.
    You can search this forum to see how to PIVOT your data. There are lot of example. You can also try dynamic pivot. Its all in here, just search.

  • Query for comparing two columns in two tables

    Hai, all,
    I have following two tables and columns, I need to get the rows (all columns) from scott.cp_ip which are not ( the same value present in t1 and also in t2).
    Table scott.cp_ip column cp_ip.vrno = Table scott.cb1 column cb1.cb_vnno
    I used the following query and did not get the correct result:
    select * from scott.cp_ip where cp_ip.vrno in (select cb1.cb_vnno from scott.cb1);
    Can you please tell how it can be solved?
    Thanks in advance.
    Rcs
    SQL> desc scott.cb1;
    Name Null? Type
    ID NUMBER
    SUPCODE NUMBER
    SUPLNAME VARCHAR2(100)
    NAME VARCHAR2(100)
    ITEMCODE VARCHAR2(10)
    RECDOC NUMBER
    RECDATE VARCHAR2(10)
    TOTVALUE NUMBER
    QTY NUMBER
    CB_IPNO NUMBER
    CB_VNNO NUMBER
    CB_VDT VARCHAR2(10)
    CB_AMT NUMBER
    SQL> desc scott.cp_ip;
    Name Null? Type
    ID NUMBER
    VRNO NUMBER
    CODE VARCHAR2(50)
    HEAD VARCHAR2(255)
    PARTI VARCHAR2(255)
    CR NUMBER
    SQL> select * from scott.cp_ip
    2 intersect
    3 select * from scott.cb1;
    select * from scott.cp_ip
    ERROR at line 1:
    ORA-01789: query block has incorrect number of result columns
    SQL> (select * from scott.cp_ip
    2 minus
    3 select * from scott.cb1)
    4 union all
    5 (select * from scott.cb1
    6 minus
    7 select * from scott.cp_ip);
    (select * from scott.cb1
    ERROR at line 5:
    ORA-01789: query block has incorrect number of result columns
    SQL> select * from scott.cp_ip where cp_ip.vrno in (select cb1.cb_vnno from scott.cb1);
    result=instead of 1408 rows, 1481 rows (excess 73 rows) getting!
    ----------

    Instead of SELECT * write only the column that you want to compare. I guess that would be cb1.cb_vnno and cp_ip.vrno.

  • Query Designer - Rows between Columns

    Dear all,
    I've got the following requirement and I really cannot figure out if it is doable.
    I would appreciate your help.
    I shall create a query using Sap Query Designer regarding the actual and budet data of the assets (it's a financial report).
    I'll have 2 columns for the actual data and 2 columns for the budget data.
    Is there any way:
    a) to have the assets (the rows) in the middle of the report layout, and
    b) the actual data on the left side of the assets, and
    c) the budget data on the right side of the assets
    The goal is when drilling down the assets, both pairs of columns to be expanded as well.
    Is it doable? Is there any trick?
    Thanks in advance.

    Dear Riyez
    I do thank you for your response.
    I am wondering if there is something someone could possibly do on the Query Designer side in order to fool the system.
    For instance, to design a virtual structure (I do not know how - I am thinking loudly) which would be identical to the structure that holds the assets?
    In other words, is it designeable to have a row structure, then the column key figures and, finally, another row structure identical to the first one? And when the user expands the first structure, the second structure will follow accordingly?
    Or such a solution is out of question?

  • Query for row by rows-before using seq number

    Hi,
    I have a table of CatalogAuthor records
    long : id
    varchar : author
    long : seqnum
    I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
    We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
    What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?
    Andy

    Hi, Andy,
    user9990110 wrote:
    Hi,
    I have a table of CatalogAuthor records
    long : id
    varchar : author
    long : seqnumYou can't be serious! The LONG data type is nothing but trouble, and completely unnecessary. You must mean NUMBER instead of LONG.
    I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
    We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
    What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?I'm just curious, why do you need this? What will this tree structure do for you that an index on author won't do?
    I don't know of any way to automatically keep a tree balanced every time DML is done.
    You could periodically re-balance the tree; that shouldn't be too hard. Let's say you want each parent to have up to r children. Use the analytic ROW_NUMBER function to assign unique numbers 0, 1, 2, 3, ... to each row, in order by author.
    The row numbered 0 will have no parent
    For all all rows numbered n (n > 0), the parent will be the row numbered FLOOR (n/r).
    Whenever you re-configure the tree, use a MERGE statatment. An index on author will probably make generating the ROW_NUMBERs faster.
    If you need help, post CREATE TABLE and INSERT statements to show the table as it exists with the tree out of balance, and also show how you want it to look after balancing. Use a small value of r (maybe 2 or 3) to keep the sample set small.
    Edited by: Frank Kulash on Jan 12, 2011 12:41 PM

  • Select query for rows where condition 1

    Say I have a table, tb1, that has the following entries:
    FName LName
    Code
    John Doe
    xxx
    Jane Doe
    xxx
    Steve Harper
    x
    Barrak Obama
    x
    George Bush
    xxxx
    Bill Clinton
    xx
    I'd like to write a select query that only lists the rows where the count for Code is > 1, i.e not display the last two rows from the above entry. How would I go about writing that select query.
    Thanks.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> Say I have a table, tb1, that has the following entries: <<
    Are you this rude or really ignorant and too lazy to read the Netiquette at the start to this forum? Why do you think you do not need a key? No DDL? No constraints? And , why, why do you think that “tb1” is a precise, ISO-11179 conforming table name? 
    Let's make this a table of rude posters rated on a 4-star scale. 
    CREATE TABLE Rude_Posters
    (first_name VARCHAR(15) NOT NULL, 
     last_name VARCHAR(15) NOT NULL, 
     PRIMARY KEY (first_name, last_name), 
     rudeness_code VARCHAR (4) NOT NULL
       CHECK (rudeness_code IN ('x', 'xx', 'xxx', 'xxxx'));
    INSERT INTO Rude_Posters
    VALUES
    ('John', 'Doe', 'xxx'), 
    ('Jane', 'Doe', 'xxx'), 
    ('Steve', 'Harper', 'x'), 
    ('Barrack', 'Obama', 'x'), 
    ('George', 'Bush', 'xxxx'), 
    ('Bill', 'Clinton', 'xx');
    >> I'd like to write a SELECT query that only lists the rows where the count for rudeness_code is > 1, i.e not display the last two rows from the above entry. << 
    The rudeness scale is based on stars, so to ask for an integer value is like saying “on a scale from 1 to 10, what is the color of your favorite letter of the alphabet?”
    Next, the number of stars and your narrative do not match. Did you want to say WHERE rudeness_code IN ('xx' 'xxx', 'xxxx')? 
    Please stop programming SQL until you have gotten more education. At this point, you do not know enough to ask a question. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • What is syntax of sql query for horizontal 2d column in apex

    Series1 Query---SELECT NULL LINK, REGION LABEL,MILESTONES_PLANNED "MILESTONES PLANNED" ,MILESTONE_ACHIEVED "MILESTONE ACHIEVED" FROM (SELECT REGION_NAME "REGION",sum(NO_OF_MILESTONES_PLANNED) "MILESTONES_PLANNED",sum( NO_OF_MILESTONES_ACHIEVED) "MILESTONE_ACHIEVED" FROM MSR_NO_OF_MILESTONES JOIN PM_PROJECT ON MSR_NO_OF_MILESTONES .PROJECT_ID=PM_PROJECT.PROJECT_ID JOIN PM_REGION ON REGION_ID=PROJECT_REGION_ID GROUP BY REGION_NAME)
    Series2 Query----SELECT NULL LINK, 'Consulting Services' label , MILESTONES_PLANNED "MILESTONES PLANNED" , MILESTONE_ACHIEVED "MILESTONE ACHIEVED" FROM (SELECT sum(A.NO_OF_MILESTONES_PLANNED) "MILESTONES_PLANNED", sum(A.NO_OF_MILESTONES_ACHIEVED) "MILESTONE_ACHIEVED" FROM MSR_NO_OF_MILESTONES A)
    I want both output in the same bar chart...
    But am not getting correct output... its giving 4 labels instead of 2 labels and fills 2 extra 0 in chart becoz of it

    Hi All,
    I think you misunderstood my question, so may be I didnt ask it properly, so here it is I am explaining in detail with an example.
    Suppose I have 10 users with 10 different user name's in a database and I am the 11th user as DBA, every 10 of these users have created some tables lets say 20 tables each by every user making a count of the total tables as 200, now lets say 10 of 200 tables has a column ie fname with value as 'rahul', I want to search the string 'rahul' from all the 200 tables that which of the tables contains this string along with the column name.
    I hope this time my question is clear, the point is I just know of a value and I dont know the table name and column name where it may actually residing, futher I want to search tables of other users as well.
    Regards
    Rahul

  • Display Query Output - Rows as Columns

    Hi ,
    I am fetching data as follows.
    ITEM CODE, DESCRIPTION, UOM, PRICELISTNAME, PRICELISTVALUE
    Item can exists in more than one price list.
    I want get the output as follows
    ITEM CODE, DESCRIPTION, UOM, PLIST1 PLIST2
    X X X PLIST VAL1 PLISTVAL2
    Y Y Y PLISTVAL2
    Item X exists in PLIST1 and PLIST2, but, item Y exists in only Plist2.
    Can this be possible. Please let me know, if some one as solution for this requirement.
    Regards/Prasanth

    ITEM CODE...DESCRIPTION....UOM.......PLIST1.......PLIST2
    X..................X.........................X.............PLVAL1.....PLVAL2
    Y.................Y.........................Y..............................PLVAL2

  • Creating a header for rows/columns in cross-tab with syntax

    Hi,
    The issue is creating strings for rows or columns' headers. How can I create a formula field which contains more than one seperate string. Such as "aaa", "bbb" and "ccc" are headers and they should be in seperate columns. In short, they will behave like characteristics of one of my query's field but they are just headers of the columns.
    ..............aaa...bbb...ccc....
    row1.......x.......x........x.....
    row2.......y.......y........y.....
    Also there is another issue about the formulation again. Is there any operator that does the same job as " \n" which is used in C languages to break the line?
    before:
    aaabbb
    after:
    aaa
    bbb

    Hi Carl;
    Firstly, thanks for answering my question. To explain my problem there are two options ahead(for my first question); first one is writing down the actions step by step, the second one is posting an image file(jpeg etc) to visualize it. I think the first one will be enough. If not tell me
    Step 1- Create a cross-tab and right click and select cross-tab expert.
    Step 2- Click the button "New Formula" and write down any word(such as "Sales") between two -"- sign to make it string.Then save and close.
    Step 3- Drag and drop the created formula to "columns" section and fill the other necessary sections with your database's(such as xtreme.mdb which is famous for crystal users) fields.Don't forget to add another column value to "columns" section, since our formula has no link to database.
    Step 4- Then click OK to save the changes and lets preview the cross-tab.The result will have one top column and his child or children(that depends on your data). And this top column is behaving like a header not a field.
    Now turn the second step but write down a formula for 2 columns or more.For exmple "Sales" and "Profit".So the result will have 2 top columns and their child/children.
    My question is "what is the formula for 2 or more columns?"
    Also I couldn't get the answer for my second question. What is the meaning of expressions "\c" and ChrW(13)?
    Edited by: diabolus on Oct 30, 2009 9:39 AM

  • Rows to column and need to nvl for that newly  columns

    Hi,
    I have to create  rows to column query in rdf and in turn i have  to created excel rtf template to produce excel output.
    select max(decode (test.role, 'PA-ELT Member', test.full_name )) ELT_MEMBER,
    max(decode (test.role, 'PA-IT Director', test.full_name )) IT_MEMBER,
    max(decode (test.role, 'Project Manager', test.full_name )) Project_Manager,
    TEST.segment1 project_NUMber,
    test.name project_Name,
    test.project_id,
    test.project_type ,
    test.organization_name,
    TEST.project_status_name Status_Name,
    TEST.start_date Start_date,
    TEST.COMPLETION_DATE,
    TEST.Planned_OOE,
    TEST.Planned_Dep,
    TEST.Planned_lab
      from
    (select
    pppv.full_name,
    pppv.role,
    ppa.name,
    ppa.project_id,
    ppa.segment1, 
    ppa.project_type,
    (select name from PA_ALL_ORG_V  where organization_id = ppa.CARRYING_OUT_ORGANIZATION_ID) organization_name,
    ppa.PROJECT_STATUS_CODE,
    pps.PROJECT_STATUS_NAME,
    ppa.START_DATE,
    ppa.COMPLETION_DATE,
    (select N_EXT_ATTR1 from PA_PROJECTS_ERP_EXT_B where project_id = ppa.project_id and ATTR_GROUP_ID = 243) Planned_OOE,
    (select N_EXT_ATTR2 from PA_PROJECTS_ERP_EXT_B where project_id = ppa.project_id and ATTR_GROUP_ID = 243) Planned_Dep,
    (select N_EXT_ATTR3 from PA_PROJECTS_ERP_EXT_B where project_id = ppa.project_id and ATTR_GROUP_ID = 243) Planned_lab
    from
    PA_PROJECTS_ALL ppa, PA_PROJECT_PLAYERS_V pppv, pa_project_statuses pps
    where ppa.project_id = pppv.project_id
    and ppa.PROJECT_STATUS_CODE = pps.PROJECT_STATUS_CODE
    and pppv.role in ('PA-ELT Member','PA-IT Director','Project Manager')
    and ppa.CARRYING_OUT_ORGANIZATION_ID=3994
    )test
    where  1=1
    and TEST.project_type = nvl(:P_PROJECT_TYPE,test.project_type)
    and TEST.project_status_name = nvl(:P_PROJECT_STATUS,test.project_status_name)
    and TEST.segment1 = nvl(:P_PROJECT_NUMBER,test.segment1)
    and TEST.full_name = nvl(:P_ELT_MEMBER, test.full_name)
    and test.full_name = nvl(:P_IT_DIRECTOR,test.full_name)
    and TEST.full_name = nvl(:P_PROJECT_MANAGER,test.full_name)
    group by 
    TEST.segment1,
    test.name,
    test.project_id,
    test.project_type,
    test.organization_name,
    TEST.project_status_name,
    TEST.start_date,
    TEST.COMPLETION_DATE,
    TEST.Planned_OOE,
    TEST.Planned_Dep,
    TEST.Planned_lab
    order by TEST.SEGMENT1
    see ELT_MEMBER,IT_MEMBER and Project_Manager  are columns created from rows to column.
    now if i put where clause for this any columns for Eg: ELT_MEMBER it is giving Elt_member column values alone not remaining IT_member  and Project Manager it show null even it has values .
    it is because of this where clause
    and TEST.full_name = nvl(:P_ELT_MEMBER, test.full_name)
    and test.full_name = nvl(:P_IT_DIRECTOR,test.full_name)
    and TEST.full_name = nvl(:P_PROJECT_MANAGER,test.full_name)
    though i have ELT_MEMBER, IT_member and Project Manager column in where clause i have to call parent sql query column full_name.
    i have tried to have nvl on column like below.
    nvl( max(decode (test.role, 'Project Manager', test.full_name )),(select full_name from PA_PROJECT_PLAYERS_V where project_id = test.project_id and role ='Project Manager')) Project_Manager,
    but it is showing error single -row subquery error .
    it is possible to have a where clause for rows to columns .
    Please help in this regards

    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'john,henry,michi,glen' as customer_name, 25000 as credit_limit from dual union all
      2             select 'dilon,bryan', 10000 from dual union all
      3             select 'raymond', 8000 from dual)
      4  -- END OF TEST DATA
      5  select regexp_substr(customer_name, '[^,]+', 1, rn) as customer_name, credit_limit
      6  from   t
      7        ,(select rownum rn
      8          from dual
      9          connect by rownum <= (select max(length(regexp_replace(t.customer_name,'[^,]'))+1) from t))
    10  where regexp_substr(customer_name, '[^,]+', 1, rn) is not null
    11* order by credit_limit desc
    SQL> /
    CUSTOMER_NAME         CREDIT_LIMIT
    john                         25000
    henry                        25000
    michi                        25000
    glen                         25000
    bryan                        10000
    dilon                        10000
    raymond                       8000
    7 rows selected.
    SQL>Just replace "t" with your query to select the data from the external table.

  • How to color Rows and Columns of BI Query

    Hi to all,
    I have created BI query in query designer, with 2 structures for rows and Columns.
    Now I need that certain rows can be colored orange and certain columns as green color.
    I knew that it can be done in Query designer, but slice and dice reporting can not be done, which I required in my report.
    Is there any way I can do in WAD.
    or any other way to do that.
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana

    Hi Rana,
    You can do the coloring of KF values using the report designer tool.
    Check the below links
    http://help.sap.com/SAPhelp_nw70/helpdata/en/dd/cea14119eb9f09e10000000a155106/frameset.htm
    [Creating Formatted reports using BEx Report Designer|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00ae5173-6112-2d10-d78f-e7779d269f25?QuickLink=index&overridelayout=true]
    Regards
    KP

  • Display of  Row and Column Headers in NW2004s Bex Analyzer

    Hi all,
    when I open a query with the NW2004s Bex Analyzer (Excel)Frontend <b>Row and Column Headers are not visible</b>. I need to go to <b>"Tools-Options" and check the box  for "Row and Column Headers" which seems to be unchecked by default</b>.
    Is there <b>a possibility to make the Row and Column Headers visible by default when I open a query</b> so that I don't have to use Tools-Options every time.
    Thanks
    Alex

    This is fixed with SP8. The default template doesn't have this specified in SP7. It's a very easy fix. Just specify that the column headers are specified by default. Then save this new workbook as the global workbook template such that all queries use this new template. You can customize this standard template however you like!

  • Help! Inserting a 1-D comment array into a 2-D string array at specified row AND column

    Hello everyone,
    I am writing a 2-D string array to excel and i need a way to add comments to my file like this:  
    SLAM    NAME    G Level    Comments
    1              RALF         26               
    1              RALF         26
    1              RALF         26
    1              RALF         26
    For some reason, i cannot specify a row AND column to write because: 
    When i use replace array subset it only replaces 1 element at my index. 
    When i use replace array subset with a loop, it creates empty spaces until it reaches the end of the array it is replacing.
    When i use Insert into array: i cannot wire 2 inputs for row and column.  
    In my complete VI i will need to write from row 1-1001, a different comment from 2-2002, a different comment from 3-3003, etc until a stop condition is met so i need to figure out how to do this programatically and not have it replace any elements outside of the range or it will override previous commetns. 
    I am at a loss of what to do. Any and all suggestions are greatly appreciated. 
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    array.vi ‏13 KB

    Hi proph,
    I made a small subtile change to yur VI and now it replaces all values of the 4th column…
    THINK DATAFLOW!
    Use shift registers when you need to propagate values from one loop iteration to the next!
    USE/LEARN DEBUGGING TECHNIQUES!
    There are tools like probes and highlight to understand your VI execution and to find problems…
    Go through all those free online courses offered by NI!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    array.vit ‏12 KB

  • Convert rows into columns nad vice versa in 10g

    how to convert rows into columns in 10g??

    Qwerty wrote:
    see below for rows to column case
    SQL> WITH t as
    2      (
    3       SELECT 'US' test_string FROM DUAL UNION
    4       SELECT 'AMERICA'  FROM DUAL UNION
    5       SELECT'HOLLYWOOD'  FROM DUAL UNION
    6       SELECT 'WASHINGTON'  FROM DUAL
    7      )
    8      select ltrim (sys_connect_by_path(test_string,','),',') test_string
    9        from (
    10     SELECT row_number() over(order by test_string) rno, test_string
    11       FROM t)
    12       WHERE connect_by_isleaf = 1 and rownum=1
    13       connect by rno = prior rno+1;
    TEST_STRING
    AMERICA,HOLLYWOOD,US,WASHINGTONI hope you can do it for column to rows now.That's not really rows to columns. That's rows to a column, which is more commonly called string aggregation.
    Rows to columns (or pivot) is more like:
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as
      2       (
      3        SELECT 'US' test_string FROM DUAL UNION
      4        SELECT 'AMERICA'  FROM DUAL UNION
      5        SELECT'HOLLYWOOD'  FROM DUAL UNION
      6        SELECT 'WASHINGTON'  FROM DUAL
      7       )
      8  --
      9  select max(decode(rn,1,test_string)) as col_1
    10        ,max(decode(rn,2,test_string)) as col_2
    11        ,max(decode(rn,3,test_string)) as col_3
    12        ,max(decode(rn,4,test_string)) as col_4
    13* from (select test_string, row_number() over (order by test_string) as rn from t)
    SQL> /
    COL_1      COL_2      COL_3      COL_4
    AMERICA    HOLLYWOOD  US         WASHINGTON
    SQL>And columns to rows (or unpivot) is like:
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as
      2       (
      3        SELECT 'US' col_1, 'AMERICA' col_2, 'HOLLYWOOD' col_3, 'WASHINGTON' col_4 FROM DUAL
      4       )
      5  --
      6  select col_1 as col from t union all
      7  select col_2 from t union all
      8  select col_3 from t union all
      9* select col_4 from t
    SQL> /
    COL
    US
    AMERICA
    HOLLYWOOD
    WASHINGTONor...
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as
      2       (
      3        SELECT 'US' col_1, 'AMERICA' col_2, 'HOLLYWOOD' col_3, 'WASHINGTON' col_4 FROM DUAL
      4       )
      5  --
      6  select decode(rownum,1,col_1,2,col_2,3,col_3,4,col_4) as col
      7* from t, (select * from dual connect by rownum <= 4)
    SQL> /
    COL
    US
    AMERICA
    HOLLYWOOD
    WASHINGTON
    SQL>

Maybe you are looking for

  • Mass change requirements date

    Hello, Running ESC SRM 5.0 Is there a way to mass change the requirements date in a shopping cart? The business requirement is to have a template with ie 100 items. When they copy this template into a new shopping cart, the requirements date is set t

  • Setting tab width for Text editor

    Simple ? I was unable to see this in the tool help. How do we set the tab width in the Text Editor for solaris.

  • Crystal report in wpf

    hi i am new in WPF. How to i can use crystal report in WPF? is their any help..?

  • Filter condition not working when Navigating from Main report to detail

    Hello, I have one report in OBIEE 10.3.4. Below is the filter condition used in Main report:- (Customer Secondary Organization is equal to / is in BMS OTHER C AND Customer Tertiary Organization is equal to / is in S&FO ) OR Customer Secondary Organiz

  • Standard users + software updates

    Hello, My environment includes a 10.6 server and a full 2003 Active Directory environment. All of my Macs are connected to AD and I manage their policy via Workgroup Manager on my Xserve. I want to set my Mac users up as Standard instead of Admin, bu