How to insert the data to selected cell in multicolumn

Hello Labviewer
I am new for labview, and have a problem when i am using a multicolumn listboxes, how can i insert the data to my selected cell,
something like
header      XXX   

mengyi
The property node of the listbox has a "Item Names" property. This is a two dimensional array corresponding accordingly to the row by column listbox. You can modify this array to change the listed string for the selected cell(s).
--Russ

Similar Messages

  • How to insert the data from XML to a table

    Hi,
    I'm using Oracle 10g Express Edition
    I need help in How to insert the data from XML file into the table.
    Below is the example i'm working on..
    I have create ridb user with below mentioned privileges:
    Account Status Locked Unlocked
    Default Tablespace: USERS
    Temporary Tablespace: TEMP
    User Privileges :
    Roles:
    CONNECT
    RESOURCE
    Direct Grant System Privileges:
    CREATE DATABASE LINK
    CREATE MATERIALIZED VIEW
    CREATE PROCEDURE
    CREATE PUBLIC SYNONYM
    CREATE ROLE
    CREATE SEQUENCE
    CREATE SYNONYM
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    CREATE VIEW
    & table is created TRIALZIPCODES below mentioned is the DDL:
    CREATE TABLE TRIALZIPCODES
    STATE_ABBR VARCHAR2(20) NOT NULL
    , ZIP_CODE NUMBER(10, 0) NOT NULL
    , ZIP_CODE_EXT VARCHAR2(20)
    Below is the XML FILE: which is stored in C:\OracleProject Folder
    File name: trial.xml
    <?xml version="1.0" ?>
    <metadata>
    - <Zipcodes>
    - <mappings Record="4">
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    - <mappings Record="5">
    <STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
    <ZIPCODE>80323</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    </mappings>
    </Zipcodes>
    </metadata>
    PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
    create or replace
    PROCEDURE TRIAL AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    begin
    -- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
    -- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -- the name of the table as specified in our DTD
    DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
    -- the name of the data set as specified in our DTD
    DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
    insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    DBMS_XMLStore.closeContext(insCtx);
    END;
    END TRIAL;
    For the first time when i complied i got the errors as :
    Procedure RIDB.PROCEDURE1@RIDB
    Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
    Error(16,14): PL/SQL: Item ignored
    Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(29,1): PL/SQL: Statement ignored
    Error(33,1): PL/SQL: Statement ignored
    Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(36,1): PL/SQL: Statement ignored
    Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
    SQL Statement:
    grant execute on utl_file to ridb
    So, it got compiled successfully but when i execute it gives me error as:
    Source does not have a runnable target.
    What does this mean?
    So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
    So can i edit the init.ora with notepad.When i tried to do that it says permission denied
    In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
    but there is also other file initXETemp in the same path do i need to do the changes in it.
    I have tried even editing the SPFILE as mentioned below:
    C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
    So i had reinstall the software again.
    Could you please let me know how to proceed..

    hi,
    I have created the directory from sys database
    CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
    & grant read,write access to the user
    grant read,write on directory XML_DIR2 to RIDB;
    & i had change the tag name in the xml file as shown below:
    <?xml version = '1.0'?>
    <metadata>
    <Zipcodes>
    <mappings Record="4">
    <STABBRE>CA</STABBRE>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    <mappings Record="5">
    <STABBRE>CO</STABBRE>
    <ZIPCODE>80323</ZIPCODE>
    <ZIPCODEEXT>9277</ZIPCODEEXT>
    </mappings>
    </Zipcodes>
    </metadata>
    TRIALZIPCODE table as shown below:
    CREATE TABLE "RIDB"."TRIALZIPCODE"
    (     "STABBRE" VARCHAR2(20 BYTE),
         "ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
         "ZIPCODEEXT" NUMBER
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    I have tried two methods as shown below:
    Procedure 1:
    create or replace
    PROCEDURE TRIAL_V2 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
    DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
    DBMS_XMLStore.setRowTag(insCtx, 'mappings');
    cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
    DBMS_XMLStore.closeContext(insCtx);
    END;
    Procedure 1 was compiled with out errors but when i execute i got the error as :
    Source does not have a runnable target.
    Procedure 2_
    CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
    SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
    extractvalue(x.column_value, 'mappings/ZIPCODE'),
    extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
    FROM TABLE(
    XMLSequence(
    EXTRACT(
    xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
    'metadata/Zipcodes/mappings'
    ) x
    END;
    END TRIAL_V3;
    Procedure 2 was complied without errors but when i execute i got the error as:
    Connecting to the database RIDB.
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at "RIDB.TRIAL_V3", line 12
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database RIDB.
    Could you please let me know how to proceed...

  • How to insert the data using matrix

    Hi
      All how to insert the data using matrix feild
      plz help me
       thanks
        Loy

    Hi Loy,
    The best way to fill an entire matrix is to use a DBDatasource, here is some sample code:
    Dim oForm As SAPbouiCOM.Form
    oForm = SBO_App.Forms.Item("YourFormTypeID")
            '1. Add a DBDataSource to the form
            oForm.DataSources.DBDataSources.Add("OUSR")
            Dim oColumnDBS As SAPbouiCOM.Column
            Dim oColumnUDS As SAPbouiCOM.Column
            Dim i As Integer
            Dim GenEdt As SAPbouiCOM.EditText
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim oColumns As SAPbouiCOM.Columns
            Dim oDBDataSource As SAPbouiCOM.DBDataSource
            oMatrix = oForm.Items.Item("7").Specific
            oColumns = oMatrix.Columns
            '2. DBDataSource: Binding a field / alias of the table to a column
            oColumnDBS = oColumns.Item("V_1")
            oColumnDBS.DataBind.SetBound(True, "OUSR", "U_NAME")
            '3. getting the data sources bound to the form
            oDBDataSource = oForm.DataSources.DBDataSources.Item("OUSR")
            oMatrix.Clear()
            ' Querying the DB Data source
            oDBDataSource.Query()
            ' Adding the data to the matrix
            oMatrix.LoadFromDataSource()
    When you want to fill a specific field use :
    GenEdt = oMatrix.Columns.Item("V_2").Cells.Item(1).Specific
                    GenEdt.String = "Hello"

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • If Both tables having References then how to insert the data each other

    Hai EveryOne..,
    My Sample data.,
    Create table emp (empno number primary key,ename varchar2(20));
    Create table emp_dup (empno number references emp(empno),ename varchar2(20) primary key);
    alter table emp add constraint ename_fk foreign key(ename) references emp(ename);
    My Question is How to insert the data into these two tables?
    Its a *"Circular Reference"* Concept.
    Please ...
    Thank You!!

    You need to set the DEFERRED clause of the constraint when you create your foreign key as DEFERRABLE by which you can move the constraint validation at transaction level.
    In an interview point of view that could be a reasonable answer. But in real time this could be strongly questionable.
    Here is an example
    SQL> create table emp1 (empno number, ename varchar2(10))
      2  /
    Table created.
    SQL> create table emp2 (empno number, ename varchar2(10))
      2  /
    Table created. Define Primary Key for two tables
    SQL> alter table emp1 add constraint emp1_pk primary key (empno)
      2  /
    Table altered.
    SQL> alter table emp2 add constraint emp2_pk primary key (ename)
      2  /
    Table altered. Add foreign key for two tables with DEFERRED clause set as DEFERRABLE
    SQL> alter table emp1 add constraint emp1_fk foreign key (ename) references emp2(ename) initially deferred deferrable
      2  /
    Table altered.
    SQL> alter table emp2 add constraint emp2_fk foreign key (empno) references emp1(empno) initially deferred deferrable
      2  /
    Table altered. Now here is the test case
    SQL> insert into emp1 values (1, 'karthick')
      2  /
    1 row created.
    SQL> commit      
      2  /
    commit
    ERROR at line 1:
    ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (ARBORU.EMP1_FK) violated - parent key not found So the validation is done at Transaction level. Now let insert the value into both tables.
    SQL> insert into emp1 values (1, 'karthick')
      2  /
    1 row created.
    SQL> insert into emp2 values (1, 'karthick')
      2  /
    1 row created.
    SQL> commit
      2  /
    Commit complete.

  • How to insert the data even the trigger returned null

    Hi Gurus,
    I have a question regarding on how to insert the record even the condition being used by a "before insert trigger" returned null.
    The scenario is:
    2 tables have the same structure:
    Table A (Name varchar2 (100), No Number)
    Table B (Name_1 varchar2 (100), No Number)
    A script is using to load the data into table A daily, and a “before insert trigger” is being used to get the value for A.Name = B.Name whenever the condition A.No equals to B.No.
    If the B.No exists, then the trigger work fine, otherwise the records will be rejected, this is not the way we wanted, so I just wonder, is there any way to load all the data to the other fields but still using this trigger ?
    Thanks,
    Tran

    Either amend the select in the trigger that gets the name value to not raise a NO_DATA_FOUND exception (e.g. change "select name..." to "select min(name)..." ) or handle the NO_DATA_FOUND exception in an exception handler.
    e.g.
    EXCEPTION
      WHEN no_data_found THEN
        :new.name = 'where the streets have no name';

  • How to Insert the Text in Selected Text Frame-Reg.

    Dear all,
    I am using the SnipperRunner - SDK, and create the TextFrame, but I can't insert the Text in the Particular Frame. so please give me the soultions,
    (*) Create TextFrame is ok,
    (*) Select TextFrame is also ok,
    (*) now, my Query ->
    How to Insert the Text in the Selected Frame?. (or)
    How to Link the Selectable Frame and my Text.? (or)
    How come to know the TextFrame is select?.
    Please any one can suggest me through the Coding....I will appreciate you...
    Thanks & Regards,
    T.R.Harihara SudhaN

    Hi,
    you have to get the TextModel associated with the textframe. Once you got that, ITextModel has an Insert()-method. You could also process kInsertTextCmdBoss - there are quite a few examples around. I believe WriteFishPrice also inserts text into a frame, just as an example. Good luck ...
    Bernt

  • How to insert the data which is present in the variable into the table

    Hi,
    Let's consider that I have one table and I have stored the table column names in one variable and their values in another variable.
    I want to insert the data that is present in the variables into the table.
    I tried the following way :
    Declare
    V_columns    Varchar2(50) := 'Empno';
    V_values       Number(10) := 101;
    Begin
    Insert Into Emp (V_columns) Values (V_values);
    End;
    The above procedure gives an error : PL?SQL : ORA-00904 : "V_COLUMNS": invalid identifier
    Using the Execute Immediate, we can insert the data which is present in the variables into the table.
    Is there any other way to insert the data which is present in the variable into the table..?
    Can anyone please give me the solution..?
    Thanks..

    plz use this...
    DECLARE
       v_columns   VARCHAR2 (50) := 'Empno';
       v_values    NUMBER (10)   := 101;
    BEGIN
       EXECUTE IMMEDIATE    'Insert Into Emp ('
                         || v_columns
                         || ') Values ('
                         || v_values
                         || ')';
       COMMIT;
    END;

  • How to insert the data if the data in the two tables doesn't match.

    Hi,
    I have requirement like,I have to insert the data by comparing the two tables based on the date field.If they both are equal then the data shouldn't be inserted if not the data has to be inserted.
    Can some one help me on this ASAP.
    Regards,
    Sudha
    sudha

    Hi,
    Thanks for the reply,i would like to know the way that we can design the packages
    sudha
    You have multiple ways of implementing this
    1. Using Lookup Task
    http://www.sqlis.com/sqlis/post/Get-all-from-Table-A-that-isnt-in-Table-B.aspx
    2. using SCD wizard
    http://www.bimonkey.com/2009/07/the-slowly-changing-dimension-transformation-part-1/
    3. using hashing
    http://visakhm.blogspot.in/2014/06/ssis-tips-implementing-scd.html
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to insert the data using  SyncoBo Object

    Hi ,
        please provide the code for inserting the data such tat my meRepMeta.xml
    contains
                  one Top Row
                  4 Child Row
    i done the coding for inserting top row

    Hi Saravana,
        I am not sure about the query based on sync_key value but i am suggesting  the code snippet that you can use to get the SyncBo by the SyncBoName and SyncKey.
      public SyncBo getSyncBoInstance(String syncBoName, String syncKey) {
              SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
              try {
                   SyncBo sb = dataFacade.getSyncBo(sbd, syncKey);
                   return sb;
              } catch (PersistenceException pex) {
                   System.out.println(pex.getMessage());
                   return null;
              Based on the SyncBo value from the previous code snippet , you can obtain the rowCollection thru this method. 
    public RowCollection[] getRows()
                            throws PersistenceException
    Ex:
    sb.getRows()
    Once you obtain the RowCollection for the particular syncBo,you can iterate thru rowCollection to get the row entities.
    //To get the iterator of the Row entities in this RowCollection.
    MeIterator it = rowList.iterator();
    From each row entity you can get  the field values by this method
    public MeIterator getFieldValues()
    I would suggest you to go through the API Doc which is clearly explained about all the methods which would be useful for you to do all sort of operation.
    Regards,
    Rajan

  • How to insert the data

    Hi, I have the following xml file, can some one please tell me how to insert this file cdata into the table in the below format
    There would be couple of <TRAN> tag where we will not have AMT Tag but we will have only RKEY Tag.
    <?xml version='1.0' encoding='UTF-8'?>
    <main>
    <F_Header>
    <Version><![CDATA[1.0]]></Version>
    <SInfo>
    <In>
         <ID><![CDATA[12]]></ID>
         <Type><![CDATA[S]]></Type>
         <Filepath><![CDATA[\\temp\files\test.xml]]></Filepath>
    </In>
    </SInfo>
    </F_Header>
    <Tran>
    <GI>
    <RKey><![CDATA[1]]></RKey>
    <Amt><![CDATA[10.80]]></Amt>
    </GI>
    </Tran>
    <Tran>
    <GI>
    <RKey><![CDATA[2]]></RKey>
    <Amt><![CDATA[11.89]]></Amt>
    </GI>
    </Tran>
    <Tran>
    <GI>
    <RKey><![CDATA[0]]></RKey>
    </GI>
    </Tran>
    </main>
    create table temp_tab(version varchar2(20), SinfoID varchar2(20)
    , SInfotype varchar2(20), SInfoFPath varchar2(20), TranKey varchar2(20), TranAmt varchar2(20))
    The sample output should look like
    Version SINFOID SINFOTYPE SINFOPATH TRANKEY TRANAMT
    1.0 12 S \\temp\files\test.xml 1 10.80
    1.0 12 S \\temp\files\test.xml 2 11.89
    1.0 12 S \\temp\files\test.xml 0
    Thanks,

    As A_Non explained, two XMLTables will do the job.
    The first one to extract header info and the collection of Tran elements, and the second one to shred the collection of Trans passed from the first XMLTable into relational rows :
    SQL> SELECT h.version
      2       , h.SInfoID
      3       , h.SInfotype
      4       , h.SInfoFPath
      5       , t.TranKey
      6       , t.TranAmt
      7  FROM XMLTable(
      8        '/main'
      9        passing xmltype(bfilename('TEST_DIR','test.xml'),nls_charset_id('AL32UTF8'))
    10        columns
    11          version    varchar2(10) path 'F_Header/Version'
    12        , SInfoID    varchar2(10) path 'F_Header/SInfo/In/ID'
    13        , SInfotype  varchar2(10) path 'F_Header/SInfo/In/Type'
    14        , SInfoFPath varchar2(40) path 'F_Header/SInfo/In/Filepath'
    15        , Trans      xmltype      path 'Tran'
    16       ) h
    17     , XMLTable(
    18        '/Tran'
    19        passing h.Trans
    20        columns
    21          TranKey    varchar2(10) path 'GI/RKey'
    22        , TranAmt    varchar2(10) path 'GI/Amt' default '0'
    23       ) t
    24  ;
    VERSION    SINFOID    SINFOTYPE  SINFOFPATH                               TRANKEY    TRANAMT
    1.0        12         S          \\temp\files\test.xml                    1          10.80
    1.0        12         S          \\temp\files\test.xml                    2          11.89
    1.0        12         S          \\temp\files\test.xml                    0          0

  • How to insert the data system created table throuch RFC

    How can i Insert any data  system created table like MARC T100w .... throuh RFC.
    I created Funstion module.
    MY Email Address : [email protected]
                                   [email protected]

    Hello Chandan
    It is pure madness to update or modify tables like MARC or T100W directly, whether on remote systems or locally.
    If you need to update or modify such tables on remote system search for the appropriate <b>BAPI </b>(e.g. in case of MARC use BAPI_MATERIAL_SAVEDATA).
    Regards
      Uwe

  • How to get the data into select options if we have 10 select options

    Hi Experts,
         I facing problem to get the data from diffrent tables and different select options.
    I have to pass different parameter ranges.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: rb1 RADIOBUTTON GROUP g1.     "Existing Key Accounts
    PARAMETERS: rb2 RADIOBUTTON GROUP g1.     "Potential Key Accounts
    SELECT-OPTIONS: s_part FOR but000-partner."Business Partner Number
    PARAMETERS: p_bpkind LIKE but000-bpkind.    "Business Partner Type
    PARAMETERS: p_but000 LIKE but000-partner.   "Key Account Manager
    SELECT-OPTIONS : s_vkont FOR fkkvkp-vkont. "Contract Account
    SELECT-OPTIONS : s_ktokl FOR fkkvkp-ktokl. "Debtor Type
    SELECT-OPTIONS : s_sparte FOR ever-sparte.  "Division
    SELECT-OPTIONS : s_vertra FOR ever-vertrag. "Contract
    SELECT-OPTIONS : s_budat FOR erdk-budat.   "Invoice Date
    SELECT-OPTIONS : s_netto FOR dberchv-nettobtr."Billing Amount
    SELECT-OPTIONS : s_abrm FOR abc.               "Consumption Value
    SELECTION-SCREEN: END OF BLOCK b1.
    need response asap.
    Thanking you.
    Regards Surya Ramireddy

    HI,
    You can use as many Select-options in the select statment,
    Select XXXX yyyy from TABLE where FIELD In S_FIELD1 and
    FIELD2 In S_FIELD2.
    Regards
    Sudheer

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How can i open a DOC or TXT file and insert the data into table?

    How can i open a DOC or TXT file and insert the data into table?
    I have a doc file . the doc include some columns and some rows.(for example 'ID,Name,Date,...').
    I'd like open DOC file and I'd like insert them into the table with same columns.
    Thanks.

    Use the SQL*Loader utility or the UTL_FILE package.

Maybe you are looking for

  • Safari 3.1.2 crashes when downloading PDF

    For the past month, Safari crashes every time I click on or try to download a PDF. I have to go to FireFox just to download so it's not my computer. I have no problem using Acrobat at any other time. The Adobe versions I have installed are Acrobat Pr

  • SAP Treasury Reporting

    Hi, Company investments in State Bank Of India Fixed Deposit schemes. Investment made in 10 different Interest Rates. Now, Client need a report on Interest rate wise. How will i achieve this? question 2: My company have 10 company codes. for example,

  • Broken file links

    Oh I have a knucklehead friend who thought he'd be bright and move his FCPX clips!!! Now they can't be opened. ANy software to help>?

  • Do I need a seperate id for facetime other than my mac id and password to get facetime to cooperate? my

    Face-time seems to be relatively difficult to configure on my new itouch. I've changed everything on my network to make it work but nada. Seemingly it is not recognizing my password. An error message is returned about my network each time i entered m

  • Imported video from iPhone suddenly without sound. Thanks Apple!

    Is there any way of recovering the original file from my iphone? Im used to Apple delivering products of high quality therefore I delete all files from my iPhone after importing to my computer. You shouldnt have to save the files just to make sure th