3 rows data into one column

Hi,
Im working with asp application having controls (1 dropdownlist(options--Schedlue,InProcess,On HOld),two textboxes(SSStatusComments,SSGeneralComments))  I want to show output something  like below
CREATE TABLE [dbo].[EFIWorkStatus1](
[WID] [int] IDENTITY(1,1) NOT NULL,
[ST_ID] [int] NULL,
[SSStatus] [nchar](10) NULL,
[SSStatusComments] [nvarchar](max) NULL,
[SSGeneralComments] [text] NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
private void SiteSurveystatusload()
using (SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ArgentDB"].ConnectionString))
cn.Open();
string sql = "Select SSStatus,SSStatusComments from EFIWorkStatus1 where ST_ID=@ST_ID";
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.Parameters.AddWithValue("@ST_ID", Request.QueryString["ID1"]);
using (SqlDataReader reader = cmd.ExecuteReader())
if (reader.HasRows)
while (reader.Read())
txt_SiteSurveyGeneralComments.Text = reader["SSStatus"].ToString() + " " + reader["SSStatusComments"].ToString();
else
txt_SiteSurveyGeneralComments.Text = "";
output in database for above code
WID ST_ID SSStatus SSStatusComments SSGeneralComments
1 4 Schedule test in schedule Select
2 4 In Process test in process Select //expected output Schedule test in schedule in SSGEneralComments
3 4 On Hold ite on hold On Hold ite on hold //expected output Schedule test in schedule In Process test in process in GeneralComments

I want to display  the contents in textbox(SSGeneralComments)  .Please check below example.
Initally user selects dropdown option "Schedule" enter  comments in "SSSTatusComments" click savebtn .It stores in DB,Nexttime user wants to change dropdownlist option "IN Process" and enters comments  in "SSStatusCommentstextbox"    at
that time previous data(Schedule,comments)  I want to display in       SSGeneralCommentstextbox   click on savebtn it saves in database.nexttime user wants   update option to  Complete and enter comments
in SSStatusCommentstextbox   I want to display previous  data into   SSGeneralCommentstextbox .       
dropdownlist1   SSStatusCommentstextbox    SSGeneralCommentstextbox 
Schedule            test in Schedule   
IN Process          test in Process               Schedule  test in schedule     //want to display content  in
this  textbox
Complete           test in complete            Schedule  test in schedule    //want to display content  in this  textbox
   IN Process test in Process  

Similar Messages

  • How to fetch single row data into multiple columns

    Hi Have a cursor
    which will have SELECT Sun_hrs,Mon_hrs,Tue_hrs,Wed_hrs,Thu_hrs,Fri_hrs,Sat_hrs from OTMaster;
    now my cursor has one row of the above columns with this row data I want to insert into other tale as column wise
    ex:
    my row is like this: Sun_hrs,Mon_hrs,Tue_hrs,Wed_hrs,Thu_hrs,Fri_hrs,Sat_hrs
    01:00 01:00 01:00 01:00 01:00 01:00 01:00
    now I want to insert the above data into table with loop along with weekday
    weekday, OTHrs
    1 01:00
    2 01:00
    3 01:00
    4 01:00
    5 01:00
    6 01:00
    7 01:00
    which type of variable I need to fetch the records, rowtype or tabletype,
    plz help me

    thank you for information, and now I am using UNPIVOT below is my query
    SELECT * FROM OTCEILINGMASTER
    UNPIVOT(OTHOURS FOR WEEK_DAY IN (SUN_CEILING_HRS AS '1',MON_CEILING_HRS AS '2',TUE_CEILING_HRS AS '3',
    WED_CEILING_HRS AS '4',THU_CEILING_HRS AS '5',FRI_CEILING_HRS AS '6',SAT_CEILING_HRS AS '7'));
    when I am selecting all the columns (select * from OTCEILINGMASTER) then only the above query is executing I want only two columns from the table however my table has 10 columns.
    please looking into this

  • When I save a PDF as an Excel File, all of the data in the PDF is put into one column (AdobeXI)

    Hi, thanks for taking the time...
    I'm running a machine with Windows 7, Office 2010, and Acrobat XI.  When I save a specific PDF as an Excel workbook, all of the data in the original PDF is sorted correctly in four columns.  When the same task is performed on this file on another user's machine, all of the data is sorted into one column.  The user has the same versions of Windows, Office, and Acrobat.  I've attempted the "Repair installation" option but the problem persists.  Any suggestions?  Thanks again for helping,
    -E

    Thanks for the quick reply.  I figured out how to get the desired results by using tagging.  For anyone who may reference this post in the future, I went to "Customize" in the top right corner of Adobe, then selected "Create new tool set...", looked under "accessiblity and found the "tag" option.  Hit ok, tag is added to the toolbar.  Then I highlighted the dataset in the PDF that was relevant to the output format, then clicked "tag", saved as spreadsheet.  Sorry I can't provide more details on how tagging works or if there's a more elegant solution available, but I'm sure one's out there.

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Data in two different coulmns merge into one column

    I am using following script to create external table with data.
    CREATE TABLE external_class(
    item_no varchar2(255),
    max_range varchar2(255)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DATALOAD
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    (item_no,max_range)
    LOCATION ('class_newc.txt')
    REJECT LIMIT UNLIMITED;
    Problem is that its merge both columns into one column.
    I want two seperate columns.
    Data is in microsoft excel spread sheet.
    I saved as txt(TAB DELIMITED) txt
    Data appears in clas.txt file as below:
    "400     "     4177.64
    "404     "     5574.64
    "406     "     5333
    "408     "     
    "409     "     
    "450     "     10.83
    "478     "     
    "482     "     4820
    I ran the above script to create table.
    Table Created
    SQL> desc external_class;
    Name Null? Type
    ITEM_NO VARCHAR2(255)
    MAX_RANGE VARCHAR2(255)
    SQL> select count(*) from external_class;
    COUNT(*)
    3036
    but with
    select * from external_class;
    ITEM_NO MAX_RANGE
    "400"4177.64
    "404"5574.64
    "406"5333
    "408"
    "409"
    "450"10.83
    "478"
    "482"4820

    thanks its work.
    Actually I created other file as below
    Item_no-----max_range
    400     4177.64
    404     5574.64
    406     5333
    408     
    409     
    450     10.83
    and use creation script as below:
    CREATE TABLE external_class(
    item_no varchar2(255),
    max_range varchar2(255)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DATALOAD
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    fields terminated by whitespace
    MISSING FIELD VALUES ARE NULL
    (item_no,max_range)
    LOCATION ('class_newa.txt')
    REJECT LIMIT UNLIMITED;

  • How to display rows of data into different columns?

    I'm new to SQL and currently this is what I'm trying to do: 
    Display multiple rows of data into different columns within the same row
    I have a table like this:
        CREATE TABLE TRIPLEG(
            T#              NUMBER(10)      NOT NULL,
            LEG#            NUMBER(2)       NOT NULL,
            DEPARTURE       VARCHAR(30)     NOT NULL,
            DESTINATION     VARCHAR(30)     NOT NULL,
            CONSTRAINT TRIPLEG_PKEY PRIMARY KEY (T#, LEG#),
            CONSTRAINT TRIPLEG_UNIQUE UNIQUE(T#, DEPARTURE, DESTINATION),
            CONSTRAINT TRIPLEG_FKEY1 FOREIGN KEY (T#) REFERENCES TRIP(T#) );
        INSERT INTO TRIPLEG VALUES( 1, 1, 'Sydney', 'Melbourne');
        INSERT INTO TRIPLEG VALUES( 1, 2, 'Melbourne', 'Adelaide');
    The result should be something like this:
    > T#  | ORIGIN  | DESTINATION1  |  DESTINATION2 
    > 1   | SYDNEY  | MELBORUNE     | ADELAIDE
    The query should include the `COUNT(T#) < 3` since I only need to display the records less than 3. How can I achieve the results that I want using relational views???
    Thanks!!!

    T#
    LEG#
    DEPARTURE
    DESTINATION
    1
    1
    Sydney
    Melbourne
    1
    2
    Melbourne
    Adelaide
    1
    3
    Adelaide
    India
    1
    4
    India
    Dubai
    2
    1
    India
    UAE
    2
    2
    UAE
    Germany
    2
    3
    Germany
    USA
    On 11gr2, you may use this :
      SELECT t#,
             REGEXP_REPLACE (
                LISTAGG (departure || '->' || destination, ' ')
                   WITHIN GROUP (ORDER BY t#, leg#),
                '([^ ]+) \1+',
                '\1')
        FROM tripleg
        where leg#<=3
    GROUP BY t#;
    Output:
    1 Sydney->Melbourne->Adelaide->India
    2 India->UAE->Germany->USA
    Cheers,
    Manik.

  • Sql loader - mutiple values into one column

    Hi,
    Is it possible to load multiple fields into one column. Eg, my table structure has two columns COL1, COL2 and my data file is comma delimted with 3 fields A,B,C.
    How could i use sql loader to achieve (without the use of temp tables)
    COL1 = A
    COL2 = BC
    Thanks

    I don't understand why you can't modify the input fille.
    But anyway, i have 2 ways to help you
    1. Make new inputfile online using pipe and awk(or something your are familiar with) and use it as new input file.
    This is a traditional and powerful method in Unix environment.
    For instance:
    oracle> $ mknod pipe.dat p
    oracle> cat input.dat | awk '{print ...}' > pipe.dat &
    oracle> sqlldr ctl=.. data=pipe.dat
    Using this method, you don't need to modify original input file physically, but by some magical trick you can modify it on the fly.
    2. Use before trigger
    For instance:
    create table load(a int, b int, c int, d int);
    create or replace trigger load_trigger
    before insert on load
    for each row
    begin
    :new.d := :new.b + :new.c;
    :new.b := null;
    :new.c := null;
    end;
    load data
    infile *
    append
    into table load
    fields terminated by "," optionally enclosed by '"'
    (a, b, c)
    begindata
    1, 1, 1
    2, 2, 2
    3, 3, 3
    4, 4, 4
    sqlldr userid=... ctl=load.ctl
    SQL> select * from load;
    A B C D
    1 2
    2 4
    3 6
    4 8
    You won't like the existence of unnecessary columns(B, C) but don't have choice. ^^;
    I think there is another simple way provided by SQL*Loader. But i've never tried it myself. Read following doc and try it yourself:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1008153

  • Insert data into the column which is having null values.

    Hi,
    I have a column called "Classification_CD" .This column is having NULL values.I want to insert the data into this column.
    I tried to write the query as follows. But it is showing the mesg error "SQL Error: ORA-01400 cannot insert NULL into ("ABC"."A_CMP_W"."A_CMP_SEQ_NUM")"
    Can any one please help me out to write query to insert the dat afor this.
    Thanks.

    I think you are taking about updating the null value.So you can do this..
    SQL> select * from table_a;
            ID SCHEDULED MARK                       PRID
             5 07-NOV-10 T05                           7
             6 18-SEP-10 T06                           8
             4 31-JAN-11 T02                           2
             1 18-JAN-11 T01                           2
             2 18-JAN-11 T02
             3 18-JAN-11 T03                           1
    6 rows selected.See that prid is Null for id 2
    SQL> update table_a
      2  set prid =10
      3  where id =2;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from table_a;
            ID SCHEDULED MARK                       PRID
             5 07-NOV-10 T05                           7
             6 18-SEP-10 T06                           8
             4 31-JAN-11 T02                           2
             1 18-JAN-11 T01                           2
             2 18-JAN-11 T02                          10
             3 18-JAN-11 T03                           1
    6 rows selected.
    SQL> But remember while updating u should choose a primary key column in
    where condition so that only desired row or record is updated..
    Regards
    Umesh

  • Want to insert a XSL file's data into a column of type SYS.XMLTYPE??

    Hello Friends
    I want to insert a XSL file's data into a column of a table of type SYS.XMLTYPE. Following is the XSL which i want to add into a table please help in.....
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:fn="http://www.w3.org/2005/xpath-functions">
         <xsl:output method="html" encoding="UTF-8" />
         <xsl:template match="clinical_study">
         <xsl:variable name="status">
              <xsl:apply-templates select='overall_status' />
         </xsl:variable>
    <html>
    <head>
    <title>Summary</title>
    <link href="merckcancer.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
         <div id="trialtop" class="trialtop">
              <div id="trialtophead" class="trialtophead">
                   <H1>Summary</H1>
              </div>
    <!-- start of trial body-->
         <div id="trialmiddle" class="trialmiddle">
                             <span class="trialtitle1"><xsl:apply-templates select='brief_title'/></span>
                   <span class="tealbold">Official Title: </span><xsl:apply-templates select='official_title' />
                   <span class="tealbold" title="ClinicalTrials.gov Identifier">NCT Id: </span><xsl:apply-templates select='//nct_id'/>
    <span class="tealbold">Conditions: </span><xsl:for-each select="//condition[position()!=last()]"><xsl:value-of select="normalize-space(.)" /><xsl:text>, </xsl:text></xsl:for-each>
    <xsl:for-each select="//condition[position()=last()]"><xsl:value-of select="normalize-space(.)" /></xsl:for-each>
    <span class="tealbold">Phase: </span><xsl:apply-templates select='phase' />
    <span class="tealbold">Status: </span><xsl:value-of select="$status" />
    <span class="tealbold">Interventions: </span><xsl:for-each select="//intervention[position()!=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /><xsl:text>, </xsl:text></xsl:for-each><xsl:for-each select="//intervention[position()=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /></xsl:for-each>
    <xsl:apply-templates select='eligibility'><xsl:with-param name="type">short</xsl:with-param></xsl:apply-templates>
    </div><!-- end of middle -->
    </div><!-- end of top-->                         
    <div id="detail" class="detail">
         <div id="detailtophead" class="detailtophead">
              <H1>Details</H1>
         </div>
    <!-- end of detailtop-->
    <!-- start of detail body-->
    <div id="detailmiddle" class="detailmiddle">
    <span class="trialtitle2">Trial Description:</span>
         <span class="trialtitle4"><xsl:apply-templates select='brief_summary/textblock' /></span>
         <span class="trialtitle1">Eligibility: </span>
              <xsl:apply-templates select='eligibility'><xsl:with-param name="type">long</xsl:with-param></xsl:apply-templates>
    </div><!--end of detail middle-->
    </div><!-- end of detail top-->
    <div id="enroll" class="enroll">
    <div id="enrolltophead" class="enrolltophead">
    <H1>Enrollment</H1>
    </div>
    <!-- end of enroll top head-->
    <!-- start of enroll body-->
    <div id="enrollmiddle" class="enrollmiddle">
    <xsl:choose>
                                       <xsl:when test="$status = 'Recruiting'">
         This study has participating centers in a number of locations.
         To take the next step in learning more about participating in this clinical study please call one of these trial contacts.<p/>
         The trial contacts will know this study as <span class="tealbold"><xsl:apply-templates select='//org_study_id'/></span>
         or may know the study under the ClinicalTrials.gov identifier <span class="tealbold"><xsl:apply-templates select='//nct_id'/></span>.<p/>
         <p/>
                                       <xsl:apply-templates select='overall_contact'/>
                                       <xsl:for-each select="location">
                                            <xsl:call-template name='location'/><p/>
                                       </xsl:for-each>
                                       </xsl:when>
                                       <xsl:otherwise>
         This study is not currently Recruiting, it is <xsl:value-of select="$status" />.
                                       </xsl:otherwise>
                                       </xsl:choose>
    </div><!--end of enroll middle-->
    </div><!-- end of enroll -->
    <div id="credit" class="credit">
    <div id="credittophead" class="credittophead">
    <H1>Credits</H1>
    </div>
    <!-- end of credit top head-->
    <!-- start of credit body-->
    <div id="creditmiddle" class="creditmiddle">
                                  Information about this trial has been gathered from ClinicalTrials.gov. Please see
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=http://ClinicalTrials.gov
                                       </xsl:attribute>
                                       ClinicalTrials.gov
                                  </a> for more complete information.<p/>
                                  <xsl:apply-templates select='required_header/download_date'/><p/>
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=<xsl:apply-templates select='required_header/url'/>
                                       </xsl:attribute>
                                       <xsl:apply-templates select='required_header/link_text'/>
                                  </a> <p/>
                                  This trial data was last updated on <xsl:apply-templates select='//lastchanged_date'/><p/>
    </div><!--end of credit body-->
    </div><!--end of credit-->
    </body>
    </html>
    </xsl:template>
    <xsl:template match="brief_title">
              <span class="trialtitle"><xsl:value-of select="normalize-space(.)" /></span>
         </xsl:template>
         <xsl:template match="official_title">
              <span class="tealbold">Official Title: </span>     <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="phase">
              <span class="tealbold">Phase: </span> <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="overall_status">
              <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="eligibility">
              <xsl:param name="type" />
              <xsl:choose>
                   <xsl:when test="$type = 'short'">
                        <span class="tealbold">Eligibility: </span> <xsl:call-template name="ages">
                             <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                             <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                        </xsl:call-template>, <xsl:apply-templates select='gender' />
                   </xsl:when>
                   <xsl:when test="$type = 'long'">
                        <span class="trialtitle">Eligibility: </span>
                             <span class="tealbold">Age: </span> <xsl:call-template name="ages">
                                       <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                                       <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                                  </xsl:call-template>
                             <span class="tealbold">Genders Eligible for Study: </span> <xsl:apply-templates select='gender' />
                             <xsl:text>
                             </xsl:text>
                             <span class="tealbold">Eligibility Criteria: </span>
    <xsl:apply-templates select='criteria/textblock' />
                   </xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="gender">
              <xsl:choose>
                   <xsl:when test=". = 'Both'">Male or Female</xsl:when>
                   <xsl:otherwise>
                        <xsl:value-of select="normalize-space(.)" />
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="overall_contact">
         <span class="trialtitle">Central Contact: </span>
              <xsl:apply-templates select='./first_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./middle_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./last_name' />
              <xsl:apply-templates select='./phone' />
              <xsl:apply-templates select='./email' />
         </xsl:template>
         <xsl:template name="ages">
              <xsl:param name="min" />
              <xsl:param name="max" />
              <xsl:choose>
                   <xsl:when test="($min != '') and ($max != '')">Between <xsl:value-of select="$min" /> and <xsl:value-of select="$max" /></xsl:when>
                   <xsl:when test="($min != '') and ($max = '')"><xsl:value-of select="$min" /> and Above</xsl:when>
                   <xsl:when test="($min = '') and ($max != '')">Under <xsl:value-of select="$max" /></xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="brief_summary/textblock">
              <span class="trialtitle">Trial Description: </span> <xsl:call-template name="substitute">
    <xsl:with-param name="string" select="." />
    </xsl:call-template>
         </xsl:template>
         <xsl:template name="location">
              <span class="trialtitle"><xsl:apply-templates select='.//country' /><xsl:apply-templates select='.//state' /></span>
              <xsl:apply-templates select='./facility/name' /><xsl:apply-templates select='.//city' /><xsl:apply-templates select='.//zip' /><xsl:apply-templates select='.//status' />
              <xsl:apply-templates select='./contact' />
         </xsl:template>
         <xsl:template match="contact">
              <span class="tealbold">Site Contact: </span>
              <xsl:apply-templates select='first_name' />
              <xsl:apply-templates select='middle_name' />
              <xsl:apply-templates select='last_name' />
              <xsl:apply-templates select='phone' />
              <xsl:apply-templates select='email' />
         </xsl:template>
         <xsl:template match="criteria/textblock">
              <xsl:call-template name="substitute">
         <xsl:with-param name="string" select="." />
         </xsl:call-template>     
    </xsl:template>     
         <xsl:template match="facility/name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="country"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="city">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="zip">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="state">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="status">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="first_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="middle_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="last_name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="phone">Phone: <xsl:value-of select="normalize-space(.)" />
    </xsl:template>     
         <xsl:template match="email"><xsl:if test='. != ""'>EMail: <xsl:value-of select="normalize-space(.)" />
    </xsl:if></xsl:template>     
    <xsl:template name="substitute">
    <xsl:param name="string" />
    <xsl:param name="from" select="'&#xA;'" />
    <xsl:param name="to">
    </xsl:param>
    <xsl:choose>
    <xsl:when test="contains($string, $from)">
    <xsl:value-of select="substring-before($string, $from)" />
    <xsl:copy-of select="$to" />
    <xsl:call-template name="substitute">
    <xsl:with-param name="string"
    select="substring-after($string, $from)" />
    <xsl:with-param name="from" select="$from" />
    <xsl:with-param name="to" select="$to" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$string" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Please do as early as possible..
    thanks in advance

    Hi I tried with below querry but iam getting an error message?
    SQL> Insert into temp_clob_tab
    2 SELECT XMLELEMENT("soap:Envelope",
    3 XMLATTRIBUTES ('http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
    4 'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",
    5 'http://schemas.xmlsoap.org/soap/envelope/' as "xmlns:soap"),
    6 XMLELEMENT("soap:Body"),XMLELEMENT("AddListing",
    7 XMLATTRIBUTES ('http://www.christielites.com' as "xmlns" )),
    8 XMLELEMENT ( "SCOMCODE",a.SCOMCODE), XMLELEMENT ( "SLOCCODE",SLOCCODE),
    9 XMLELEMENT ( "DSTART",DSTART),XMLELEMENT ( "DEND",DEND),XMLELEMENT ( "SECODE",SECODE),
    10 XMLELEMENT ( "IAVAIL",IAVAIL),XMLELEMENT ("IOWNED",IOWNED),XMLELEMENT ("SPOSTTRANS",SPOSTTRANS))
    11 from LiteExchangeAvailablity a;
    SELECT XMLELEMENT("soap:Envelope",
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected CLOB got -

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Can we concatenate 2 columns of datafile into one column in sql loader

    Hi,
    Can we concatenate 2 columns of datafile into one column in sql loader?
    like
    Suppose there are two field in data file
    column1 - lastname value tiger
    column2 - firstname value scott
    Required result
    sould be concatenate of the two field into one database coulmn
    like name and value should be scott tiger.
    Thanks

    Or try this...
    My input file
    1,KARTHICK,PATTABIRAMAN,SOFTWARE
    2,VIJAY,RENGANATHAN,FINANCE
    3,VIMAL,KANTH,SALESAnd my control file.
    LOAD DATA
    INFILE 'EmpDetail.txt'
    BADFILE 'EmpDetail.bad'
    DISCARDFILE 'EmpDetail.dsc'
    INTO TABLE "EMPDETAIL"
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS     
      (NO,
      NAME1 BOUNDFILLER,
      NAME ":NAME1||' '||:NAME",
      DEPT) My table is.
    SQL> create table empdetail(no integer, name varchar2(50), dept varchar2(50))
      2  /
    Table created.Then i loaded the data.
    D:\karthick\Akiva\Look up\Akiva\Address Look Up>sqlldr sysadm/sysadm@akivanew empdetail.ctl
    SQL*Loader: Release 9.2.0.1.0 - Production on Mon Sep 15 12:23:42 2008
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Commit point reached - logical record count 2
    Commit point reached - logical record count 3And the output is
    SQL> select * from empdetail
      2  /
            NO NAME                                               DEPT
             1 KARTHICK PATTABIRAMAN                              SOFTWARE
             2 VIJAY RENGANATHAN                                  FINANCE
             3 VIMAL KANTH                                        SALESThanks,
    Karthick.

  • Select multiple column into one column

    Hi..!!!
    Is it possible to select 4 columns in to 1 columns?
    I've major1, major 2, major 3, major 4 and i want to retrieve all the columns into one column called "Majors".
    Is it possible? if yes then how?
    Help me out.
    Thanks,
    Himadri

    If you had given a proper example this thread would have been over in two posts. What you are looking for is often described as an UNPIVOT.
    I tend to use a collection type for this, e.g.
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE TYPE varchar2_table AS TABLE OF VARCHAR2 (4000);
      2  /
    Type created.
    SQL> SELECT empno, column_value
      2  FROM   emp, TABLE (varchar2_table (ename, job));
         EMPNO COLUMN_VALUE
          7369 SMITH
          7369 CLERK
          7499 ALLEN
          7499 SALESMAN
          7521 WARD
          7521 SALESMAN
          7566 JONES
          7566 MANAGER
          7654 MARTIN
          7654 SALESMAN
          7698 BLAKE
    (snipped)
    28 rows selected.
    SQL>

  • Join all rows bases on one column value

    Hi All,
    I have requrement like Join all rows bases on one column value, i am not getting how to accomplish that. Here is my requrement. i have table test(id,id_desc) with no key
    table:Test
    id id_desc
    1 desc_a
    1 desc_b
    1 desc_c
    Now the requremnet i have one more table as test1(id,id_desc) here id is primary key. where record i need to insert as
    id id_desc
    1 desc_a
    desc_b
    desc_c

    orza wrote:
    Hi All,
    I have requrement like Join all rows bases on one column value, i am not getting how to accomplish that. Here is my requrement. i have table test(id,id_desc) with no key
    table:Test
    id id_desc
    1 desc_a
    1 desc_b
    1 desc_c
    Now the requremnet i have one more table as test1(id,id_desc) here id is primary key. where record i need to insert as
    id id_desc
    1 desc_a
    desc_b
    desc_cI'm guessing you want to pivot the results in TEST and use that to insert into TEST1?
    If so this may be useful
    http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

  • Help with lists and Numbers - how can I separate data from one column?

    I have a series of data entries that have two or three pieces of information listed in one column (it was a list copied from the Internet). My data is in this form all in one column (ie Column A):
    XXXX -- YYYY, ZZZZ
    I want to be able to easily split that data into three columns (A, B, and C) without having to go through and manually separate all of the entries? I'd ideally like to have XXXX in one column, the '--' removed, YYYY in another column, and ZZZZ in a third column, like this:
    Column A Column B Column C
    ====== ====== ======
    XXXX YYYY ZZZZ
    Is this possible? Any help is appreciated.

    BlooGoo
    Open or paste your material in your favorite texteditor. TextEdit will suffice but there are better applications. Make sure your material is consistent, especially that there are no stray characters or extra spaces studded in the text. You can do this by using the clean up routine as described below.
    1. Copy the set of characters you want to replace. In this case " -- " Note that there are spaces on each side of the dashes and you want to get rid of those.
    2. Open the *Find and Replace* dialogue:
    +Menu > Edit > Find > Find…+ (or command f)
    Paste the " -- " into the Find: field, then type a comma in the Replace: field or
    Copy and paste a tab from the document or
    Click on the Advanced button and enter a tab using the Insert… button that appears.
    3. Click *Replace All.*
    Repeat as necessary. If it doesn't seem to work, copy and paste the bits that stick, usually there is something not visibly different but different as far as the computer iust concerned.
    When you are finished save the results as a comma or tab delimited delimited .txt file and reopen it in Numbers.
    Peter

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

Maybe you are looking for

  • How can I create a new UDL w/o calling a dialog box, or going through Windows?

    I'm using Labview 6.1 and the Database Connectivity Toolset. I know the conventional ways of creating a UDL, but with the SQL toolkit there was a vi on the Knowledgebase site that created a DSN seamlessly, with no dialog boxes at all. Is there such a

  • Component monitoring 403 fornidden error

    Hi , In the runtime workbench when i try to send a test message from component monitoring with my user account i get a 403 forbidden error . But when i use other user credentials it goes through and other users doesn't have this problem. So i suspect

  • Backing up 2 year old iBook with only 1.98GB of memory left

    I recently bought a external HDD(120GB Maxtor OneTouch mini) to back up my 60GB iBook. I am wondering is there any difference between backing-up files using the accompanying software (onetouch manager) and just copying files to the HDD by clicking an

  • Adjust yellow color on left side of Notes app in Yosemite?

    Hi all, Does anyone know how to change the ugly yellow highlighting color on left side of the Notes app in Yosemite? Thanks!

  • T code st03

    Dear All I am in SAP ECC 6.0 implementation project  in my development server in T code st03 under work load i am getting my Hostname and Abap Instance as lsi137_180_19 here actually i have to get the hostname_sid_instanceno but i am getting like  ls