Break string in column

Hello to all ,
Having a strings like this, where pipe(|) is his delimiter
10:00 | x1 | 2 | RO | P | Con ausilio  | y1
10:10 | x2 | 1 | RO |  |  | y2
10:20 |x3 | 3 |  |  |  | y3
10:30 |x4 | 3 | RO | N | Con aiuto  | y4
10:40 |x5 | 1 | RO |  |  | y5
how can I break it up into columns, for example, the first char(before first pipe) insert in first variable,
then, after first pipe,  second characters in a other column ans so on
col1 := '10:00';
col2 := 'x1';
col3 := '2';
col4:= 'RO';
col5 := 'P';
col6 := ' Con ausilio ';
col7 := 'y1';
col1 := '10:10';
col2 := 'x2';
.. and so onthanks in advance

Is this somehow related to oracle forms? For what we know you don't even use an oracle product like forms or the database, so an answer would be near to impossible.
First of all please indicate the oracle products plus their 5-digit version numbers you are using. After that please share with us what you plan to do with this string tokenizer, where you get the string from (maybe a CSV file?) and what you plan to do with it (maybe insert into a table?)
cheers

Similar Messages

  • How to break the name column into first,middle,last

    hi,
    Having a column in a table called employee_name which is
    containing the names of employees like:-
    employee_name
    Syed Azhar Husain
    Also having another table having cloumns first_name,middle_name, last_name
    I just want to write the query that break my employee_name column into
    first name, middle name, last name and
    store into table columns first_name, middle_name, last_name respectively
    i.e. it should display like
    first_name middle_name last_name
    Syed Azhar husain
    I am using oracle9i database.
    Thanks in advance
    Azhar

    Dear Asuri,
    Thanks for quick reply,
    your query was working fine when there was one record into the table but when there was more then one record into the table it was giving error "ORA-01427: single-row subquery returns more than one row". So i did small modification in the query as below
    SELECT SUBSTR(' ' || name || ' ', INSTR(' ' || name || ' ' , ' ', 1, rn) +1,
    INSTR(' ' || name || ' ' , ' ', 1, rn + 1) - INSTR(' ' || name || ' ' , ' ', 1, rn) -1) name
    FROM test , (SELECT ROWNUM rn FROM all_objects
    WHERE ROWNUM <= ( SELECT distinct(LENGTH(name) - (LENGTH(REPLACE(name, ' ')))) / LENGTH(' ') + 1
    FROM test ))
    order by name
    so above query is working fine with more than one record but there is another problem as i am explaining blow
    Suppose there is table called "test" as follows
    SQL> select * from test;
    NAME
    Rajendra kumar jain
    syed azhar husain
    Chander Shekhar Kumar
    when i am putting above query it is giving result as follows
    NAME
    Chander
    Kumar
    Rajendra
    Shekhar
    azhar
    husain
    jain
    kumar
    syed
    my requirement is that for complete full name like 'syed azhar husain' it should give
    name
    fist name : syed
    middle name: azhar
    last name: husain
    first name: rejendra
    middle name: kumar
    last name: jain
    first name: chander
    middle name: shekhar
    last name: kumar

  • How to split a string into columns

    Hello to all ,
    Having a strings like this, where pipe(|) is his delimiter
    10:00 | x1 | 2 | RO | P | Con ausilio  | y1
    10:10 | x2 | 1 | RO |  |  | y2
    10:20 |x3 | 3 |  |  |  | y3
    10:30 |x4 | 3 | RO | N | Con aiuto  | y4
    10:40 |x5 | 1 | RO |  |  | y5
    how can I break it up into columns, for example, the first char(before first pipe) insert in first variable,
    then, after first pipe,  second characters in a other column ans so on
    col1 := '10:00';
    col2 := 'x1';
    col3 := '2';
    col4:= 'RO';
    col5 := 'P';
    col6 := ' Con ausilio ';
    col7 := 'y1';
    col1 := '10:10';
    col2 := 'x2';
    .. and so on
    thanks in advance

    Hi,
    check this:
    WITH mydata(txt) AS
       SELECT '10:00 | x1 | 2 | RO | P | Con ausilio  | y1' FROM DUAL UNION ALL
       SELECT '10:10 | x2 | 1 | RO |  |  | y2'              FROM DUAL UNION ALL
       SELECT '10:20 |x3 | 3 |  |  |  | y3'                 FROM DUAL UNION ALL
       SELECT '10:30 |x4 | 3 | RO | N | Con aiuto  | y4'    FROM DUAL UNION ALL
       SELECT '10:40 |x5 | 1 | RO |  |  | y5'               FROM DUAL
    SELECT TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,1)) col1
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,2)) col2
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,3)) col3
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,4)) col4
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,5)) col5
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,6)) col6
         , TRIM(REGEXP_SUBSTR(txt,'[^|]+',1,7)) col7
      FROM mydata;
    COL1   COL2   COL3   COL4   COL5   COL6            COL7 
    10:00  x1     2      RO     P      Con ausilio     y1   
    10:10  x2     1      RO                            y2   
    10:20  x3     3                                    y3   
    10:30  x4     3      RO     N      Con aiuto       y4   
    10:40  x5     1      RO                            y5    Regards.
    Al

  • Find out varchar2 string NULL columns and Empty columns

    Hi dev's ,
    my requiremnt is to find out the string columns Names of whose storing NULL values and EMPTY strings. for that i had written below code. it's getting some error.
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    spool D:\stringnull.csv
    DECLARE
      v_tab_indent NUMBER(5);
      v_col_indent NUMBER(5);
      v_val1       VARCHAR2(20);
      v_val2       VARCHAR2(20);
      v_query1     VARCHAR(500);
      v_query2     VARCHAR(500);
    BEGIN
      --DBMS_OUTPUT.ENABLE(100000);
      SELECT MAX(LENGTH(table_name))+1,MAX(LENGTH(column_name))    +1
      INTO v_tab_indent,v_col_indent
      FROM user_tab_columns
      WHERE data_type='VARCHAR2';
    FOR i IN
      (SELECT table_name,
        column_name
      FROM user_tab_columns
      WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
      ORDER BY table_name,
        column_name
      LOOP
        v_query1:='SELECT NVL('||i.column_name||',0) AS VAL    
                  FROM '||i.table_name||' where '||i.column_name||' IS NULL';
        v_query2:='SELECT '||i.column_name||' AS VAL    
                  FROM '||i.table_name||' where '||i.column_name||'=''''';
        --dbms_output.put_line(v_query1);
       -- dbms_output.put_line(v_query2);
        EXECUTE immediate v_query1 INTO v_val1;
        EXECUTE immediate v_query2 INTO v_val2;
        dbms_output.put_line (rpad(i.table_name,v_tab_indent,' ')||','||rpad(i.column_name,v_col_indent,' ')||' ,'||v_val1||','||v_val2);
      END LOOP;
    END;
    Spool OFF
    Set echo on
    Set feedback onERROR:
    Error report:
    ORA-01403: no data found
    ORA-06512: at line 31
    01403. 00000 -  "no data found"
    *Cause:   
    *Action:
    set feedback onpls help me on this issue..
    Thanks,

    Example:
    SQL> DECLARE
      2    v_val       VARCHAR2(20);
      3    v_query1     VARCHAR(32767);
      4  BEGIN
      5   FOR i IN (SELECT table_name, column_name FROM user_tab_columns
      6             WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
      7             ORDER BY table_name, column_name
      8            )
      9   LOOP
    10     v_query1 := 'SELECT count(*) FROM '||i.table_name||' where '||i.column_name||' IS NULL';
    11     EXECUTE immediate v_query1 INTO v_val;
    12     dbms_output.put_line(rpad(i.table_name,30,' ')||' : '||rpad(i.column_name,30,' ')||' : '||v_val);
    13   END LOOP;
    14  END;
    15  /
    CHILD_TAB                      : DESCRIPTION                    : 0
    DEPT                           : DNAME                          : 0
    DEPT                           : LOC                            : 0
    EMP                            : ENAME                          : 0
    EMP                            : JOB                            : 0
    MYEMP_OLD                      : ENAME                          : 0
    MYEMP_OLD                      : JOB                            : 0
    MYNULLS                        : ENAME                          : 0
    MYNULLS                        : JOB                            : 4
    PARENT_TAB                     : DESCRIPTION                    : 0
    T                              : CHAR_VALUE                     : 0
    TABLE1                         : COL1_DESC                      : 0
    PL/SQL procedure successfully completed.

  • (new to scripting) Only allow certain paragraph styles to break to next column/page

    Hi all,
    As stated, I'm very new to scripting. I've done a few small scripts to automate Photoshop tasks and such. I'm in the process of trying to learn Javascript as much as possible, with the hope of bringing about more efficiency for our small production department. It's a daunting task, but I'm trying my darnedest.
    One of the number one goals I have is the find a way to automate pagination of weekly transaction records. These records run between 32 to 48 pages normally, with each page having 5 columns. Creation of these pages is very systematic, so it would seem that this process should be able to be automated, but there are some challenges I'm having a hard time thinking about how to attack.
    One of the key tasks needing to be figured out is getting the records to go in with headings and subheadings always starting at the top of a page/column. Just about all the copy comes in with predetermined paragraph styles, so a script should easily be able to search for instances of each style. What needs to eb accomplished is only allowing the flow of copy to break on certain styles and not others ... (counties, towns, etc.)
    For example: if you have the following  ...
    Countyland <styled "county">
    Utopiatown <styled "town">
    46 Appletree Lane ...... $500,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Dystopia Village <styled "town">
    47 Orangeplant Road ...... $400,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    If the two records above were to fall near the end of a column, the break to the next column should NOT occur anywhere except:
    - Before the county (causing the county to start at the top of the next column
    - Before the second town (Dystopia Village, forcing that town to the top of the next column)
    - After both (forcing whatever town/county is next to goto the top of the next column)
    So basically, I need to find a way PREVENT column breaks where they should not occur. Inserting column breaks is one thing (I know how to do that). Prevention is the issue though that confounds me.
    Does anyone have any thoughts of how to achieve such a thing? I know there are "non-breaking space" characters ... is there, or could there be, some kind of a "non-breaking return" character? Or would it be more feasible to test for the paragraph style at the bottoms of columns and insert column breaks in once it finds an appropriate match?
    Am I going about this all wrong?
    Again, any help or suggestions are more than welcome.
    Thanks much.
    ~Nate
    FYI .. using InDesign cs5.5

    I am now wondering about a possible solution. It would be one hell of a challenge for me to figure out how to code it, but I at least need to figure out the theory first, then I'll try to figure out how to code it.
    Again, the issue at hand is preventing column breaks for the "listing" style in the following example. Please note, the number of "listing" lines varies. If the following two entries (in a long list of similar entries) were to be near the end of a column, I'm trying to cause the flow of text to break only before a county style, or a town style (if it's not the first town in the county).  Basically, no breaks in the middle of listings.
    Countyland <styled "county">
    Utopiatown <styled "town">
    46 Appletree Lane ...... $500,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Dystopia Village <styled "town">
    47 Orangeplant Road ...... $400,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Naomi previously suggested messing with the "keep options" in the styles. This will solve the issue of preventing breaks before listing details start. But it won't help in keeping listing details from breaking, since the number of lines can vary.
    I'm now thinking ... might it be possible to have a script search all copy, looking for the last line of listings, and then apply a second listing style with a different keep option setting? The "normal listing" style would "keep next 1 line". The "last listing" style would not, therefore, allowing a break.
    Here's a map of what I'm thinking: (bear with me on the terrible syntax, this is just for illustrative purposes)
    listingNormal has keep with next 1 line applied
    listingBreak does not keep with next line
    if currentLineStyle == listingNormal
    AND
    style of next line != listingNormal {
    currentLineStyle = listingBreak
    Does this make sense? If so, does this sound feasible?
    Thanks any and all.
    ~Nate

  • Line Break for the column

    Hi,
    I have a BIP Report.
    The report includes the layout of a free text column. This text goes towards the right side for sufficient length.
    I want to wrap the text or line break this text.
    In the rtf template, I am using the following formula:
    <?html2fo: OUTPUT_NOTES?>
    Any Ideas?

    Dear,
    Add the UDF's on the marketing document you want the tax break up.
    Apply FMS using below queries and call these UDF's on your PLD.
    FOR BED
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount =$[$38.21.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='9' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    For Cess
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount = $[$38.U_BED.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='8' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    For HCess
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount = $[$38.U_BED.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='10' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    This will help you.
    regards,
    Neetu

  • Break string in email

      String mydoc = (String) session.getAttribute("ReceiveDoc");
    String body = "<p>This email serves to acknowledge the receipt of your fee deferment application set with the following supporting documents on</p>"
                    + mydoc + "<br>";.......... mbp.setContent(header + body + footer, "text/html");How can I put a loop to break mydoc and display it in email, I mean I know the StringTokenizer tokens =new StringTokenizer(s,","); not problem to break the string with the , in jsp or servlet (actually, I add the , on the time I create the string) but I want to display it in email,
    I want my body part in email like
    String body = "<p>This email serves to acknowledge the receipt of your fee deferment application set with the following supporting documents on</p>"
    hello1,
    hello2,
    depend on how many common on the string
    Thank you

    I assume that mydoc has a list of items separated by commas. In this case, you can display the line break in HTML content email with the <br> tag. Try using the following code:
    String mydoc = (String) session.getAttribute("ReceiveDoc");
    String body = "<p>This email serves to acknowledge the receipt of your fee deferment application set with the following supporting documents on</p>"
                    + mydoc.replaceAll(",","<br>") + "<br>";.......... mbp.setContent(header + body + footer, "text/html");{code}
    Edited by: J4Java on Apr 29, 2009 2:39 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Export to Excel via web query (page breaks on every column?)

    The problem that I'm having is when a query is sent out via the reporting agent or whenever I export a web query to excel there are page breaks put on every column of the query. This becomes quite cumbersome whenever an end user or myself wants to print out a query.
    I have already transported the packages included in the  "How to Enhance Web Printing" and tested much of the functionality in BWD with no success.
    Can anyone shed some light on how to adjust the page breaks or format when exporting a web query to excel or when sending a query out via the reporting agent?
    Thanks,
    Chad
    BW Version 3.5  Support Package 18

    The problem that I'm having is when a query is sent out via the reporting agent or whenever I export a web query to excel there are page breaks put on every column of the query. This becomes quite cumbersome whenever an end user or myself wants to print out a query.
    I have already transported the packages included in the  "How to Enhance Web Printing" and tested much of the functionality in BWD with no success.
    Can anyone shed some light on how to adjust the page breaks or format when exporting a web query to excel or when sending a query out via the reporting agent?
    Thanks,
    Chad
    BW Version 3.5  Support Package 18

  • Join String to Column in Query

    Hi
    I have a column in a query I would like to join a string so that the value from the column always has a descriptor at the end like this:
    1.5 "Yards"
    2.5 "Yards"
    I don't mean:
    column AS "Yards"
    The value in the column changes length so I want to try and have this descriptor so that when I put it in a report the changing value length does not overwrite a seperate text field in the report.
    the column is a float value and I want to join the string to it.
    Thanks for any input on how to do this

    Hi
    Sorry I think we have wires crossed
    so say I have this:
    select columnA
    from table A
    and It returns this:
    columnA
    ======
    123
    456
    789
    .What I want is for it to show this:
    columnA
    ======
    123 Yards
    456 Yards
    789 Yards
    . Yards
    . Yards
    . Yards
    . Yards
    . YardsSo for ever value returned I want to have the string value "Yards" on the end; column A is a float.
    Thanks

  • Add one column of string to columns of integer

    Hi there,
    Could someone help please. 
    I would like to add one column of strings to a few columns of integer. 
                                                           --------- Added elements ------ 
    20C=           100     101    102           20C=100     20C=101    20C=102
    15C=           200     201    202          15C=200     15C=201    15C=202
    10C=           300     301    302          10C=300     10C=301    10C=302
    Thanks for help. 

    Hoverman wrote:
    I had a look at the tutorial link you sent. They are not particularly relevant to my question. 
    Why do you think I am posting a question? I have already spent a few hours searching forum and looking at examples. It would be more helpful to have a relevant example or a solution.
    Thanks for your time.  
    What is your problem here? RavensFan gave you information quite relevant to your task, but you had not (and still have not) answered his questions, so he could not (nor anyone else) tell where in your task you are having trouble. Do you know how for loops work, with respect to outputs? Your questions imply that you need to spend some real time learning LabVIEW, not just "having a look at the tutorials."
    Hmm, it looks like you had a similar problem with your last question, and you still have not indicated that you understood how to solve it.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Breaking line in column header

    Hi,everybody
    How can I break the line in column header for two lines?
    Regards,
    Michael

    Hi michael,
    As per my knowledge the webdynpro accomodates the text you given as column header.I did so many experiments on this in my previous developement.There is no option to break the column header.See one thing if the number of columns are more in your table and the headers are too large and if you restrict the table size then this might will break the column header because of  table width.I am not sure.But there is no options to control this by the developer.This is totally the results of my experiments.If you acheive this please give me the procedure.
    Thanks and regards
    venkatakalyan K

  • Archiving a ztable with string/lob column

    Hello,
    We have a ZTable that is quite big.
    Our functionals would like to preserve this information,
    even if they rarely access it.
    The table is independent of other tables.
    This table contains a zone with the abap data type string.
    This is stored as a lobs column in the Oracle database.
    1. Is it possible to "sara" archive that kind of tables?
    2. Where could I found examples of ADK abap delete/write/read/reload programs
    for ztables?
    Thanks in advance for your answers.

    Give help.sap.com a chance:
    http://help.sap.com/saphelp_sm40/helpdata/EN/2a/fa042d493111d182b70000e829fbfe/frameset.htm
    it is pretty well explained there and even mentiones example programs:  SBOOKA and SFLIGHTA

  • String to column conversion

    i have searched the forum before posting
    i want to convert single string value to multiple column
    445 1945551 1595560 1594591
    444 1945553 1595560 1594593 1594544
    to col1 --- col5
    please give me adv
    i am using the following version
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

    You can use Regular Expression :
    SQL> with t_data as
    select '445 1945551 1595560 1594591' as txt from dual union all
    select '444 1945553 1595560 1594593 1594544' from dual
    select
      txt,
      regexp_substr(txt,'[^ ]+',1,1) col1,
      regexp_substr(txt,'[^ ]+',1,2) col2,
      regexp_substr(txt,'[^ ]+',1,3) col3,
      regexp_substr(txt,'[^ ]+',1,4) col4,
      regexp_substr(txt,'[^ ]+',1,5) col5
    From t_data;
    TXT                                                COL1            COL2            COL3            COL4            COL5
    445 1945551 1595560 1594591                        445             1945551         1595560         1594591
    444 1945553 1595560 1594593 1594544                444             1945553         1595560         1594593         1594544
    SQL>

  • How to compare array of String with column of a table

    Hi,
    i have a array of string(say array is of length 1000). I want to
    compare those string in array with one table column
            - whether that table column has a string
                            if yes
                                            do nothing.
                            if no
                                            then insert that string into table.
            - whether table has obsolete row i.e, the one present in table and
    not in array
                            then delete that row.
    How do i go about this, because i see, it is not feasible to loop
    through array and search table to find new string OR loop through each
    row from table to find some obsolete row
    How can i accomplish this task more feasibly(without running query for
    each string, for comparission)? Is there any way to find this kind of
    problem. I would have been easy if i had to compare two tables(with
    UNION and INTERSECT), but it is not the case.
    thanks,
    kath.

    I'm not sure, whether I understand your problem correctly. Only two comments:
    - if both arrays are sorted, all can be done running exactly once simultaneously through both arrays.
    - if the column is marked as UNIQUE, all column strings will be different. I.e. you cannot insert the same string a second time.
    Regards  Thomas

  • I can't pass empty string as column of Table Valued Parameter.

    Hello.
    I have stored procedure which accept TVP with columns of 'sql_variant' type. And I have C++ application which call this stored procedure.
    When i pass some non-empty string as sql_variant from my application - all works fine.
    But when I need to pass empty string ("") as sql_variant - I get following error:
    "OLEDB hr = 0x80040e14
     #0:  OLEDB provider error 3621  "The statement has been terminated."
     #1:  OLEDB provider error 8062  "The data for the table-valued parameter 1 doesn't conform to the table type of the parameter."
     #2:  OLEDB provider error 8046  "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Table-valued parameter 0 (""), row 1, column 1: The supplied length is not valid for data type sql_variant.
    Check the source data for invalid lengths. An example of an invalid length is data of nchar type with an odd length in bytes."  
    Could you please help me deal with that issue?
    Thanks,
    Vitaliy

    Dear Vitaliy,
    Thank you for your question.
    Based on my understanding of your question, the issue is related with passing SQL_VARIANT data type in C++ application using Microsoft OLE DB Provider.
    As we can see from http://msdn.microsoft.com/en-us/library/ms173829(v=sql.100).aspx:
    ODBC does not fully support sql_variant. Therefore, queries of sql_variant columns are returned as binary data when you use Microsoft OLE DB Provider for ODBC (MSDASQL). For example, a sql_variant column that contains the character string data 'PS2091'
    is returned as 0x505332303931.
    According to above statement, as you are using OLEDB provider for ODBC with sql_variant in your application, it is not fully support. Seems there are some conversion failure within the Stored Procedure calling. You may consider to adjust your application
    slightly to use other commonly supported data types which also fits your application requirements.
    I listed some more information regarding sql_variant below for your reference:
    A column of type sql_variant may contain rows of different data types such as int, binary and char values.
    A sql_variant data type must first be cast to its base data type value
    before participating in operations such as addition and subtraction. You can find the conversion details in "Comparings sql_variant Values" part.
    Below types of values cannot be stored by using sql_variant:
    varchar(max)
    varbinary(max)
    nvarchar(max)
    xml
    text
    ntext
    image
    timestamp
    sql_variant
    geography
    hierarchyid
    geometry
    User-defined types
    Hope it will be helpful.
    Thank you!
    Best Regards,
    SQL Team - MSFT

Maybe you are looking for