String to Blob conversion

ALL I want to do is update a BLOB field in a DB2 database with a string. The field is updating but I'm getting garbage. Here's the code I'm using to test. What am I doing wrong? The GDTXFT is the BLOB field.
   Connection c = DriverManager.getConnection("jdbc:db2://DEV550");
   PreparedStatement ps =c.prepareStatement("UPDATE PRODDTA.F00165 SET GDTXFT = ? WHERE GDOBNM = 'GT4311' AND GDTXKY = '72455|00005|OR|000|1.000'");
   String s="Is anyone out there?";
   ps.setBytes(1, s.getBytes());
   ps.executeUpdate();

You normally do the following steps:
SELECT FOR UPDATE on the BLOB column
Use getBlob() to fetch the BLOB (you may need to cast it to a DB2-specific BLOB in your JDBC driver)
Get a reference to the BLOB's InputStream
Write data to the stream
Commit- Saish

Similar Messages

  • Converting from string to blob

    hi,
    how can I convert String to blob in java programming

    convert to char array then to int array and then look here:
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Blob.html

  • BLOB-- CLOB-- BLOB conversion reducing length of BLOB

    Hi,
    I am using the following BLOB-->CLOB and CLOB-->BLOB conversion functions :
    CREATE OR REPLACE FUNCTION blob_to_clob (blob_in IN BLOB)
    RETURN CLOB
    AS
         v_clob CLOB;
         v_varchar RAW(32001);
         v_varchar1 VARCHAR2(32001);
         v_start     INTEGER := 1;
         v_buffer INTEGER := 32001;
    BEGIN
         DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
         FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
         LOOP
         DBMS_LOB.READ(blob_in,v_buffer,v_start,v_varchar);
    DBMS_LOB.WRITEAPPEND(v_clob, utl_raw.length(v_varchar), v_varchar);
         v_start := v_start + v_buffer;
         END LOOP;
    RETURN v_clob;
    END blob_to_clob;
    CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB)
    RETURN BLOB
    AS
         v_blob BLOB;
         v_varchar RAW(32001);
         v_varchar1 RAW(32001);
         v_start     INTEGER := 1;
         v_buffer INTEGER := 32001;
    BEGIN
         DBMS_LOB.CREATETEMPORARY(v_blob, TRUE);
         FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer)
         LOOP
         DBMS_LOB.READ(clob_in,v_buffer,v_start,v_varchar);
    DBMS_LOB.WRITEAPPEND(v_blob, utl_raw.length(v_varchar), v_varchar);
              v_start := v_start + v_buffer;
         END LOOP;
    RETURN v_blob;
    END clob_to_blob;
    I am using these functions to convert image files, stored as BLOB to CLOB for intermediate storage, and then converting them back to BLOB. In this process, I see a loss of information when the image is converted from CLOB to BLOB ...which is seen by using dbms_lob.getlength() .Using the following sql query:
    select dbms_lob.getlength(file_body),
    dbms_lob.getlength(blob_to_clob(file_body)),
         dbms_lob.getlength(clob_to_blob(blob_to_clob(file_body)))
    from my_table where image_id in (8819)
    i see that returned length is usually half in the 3rd column, i.e. for dbms_lob.getlength(clob_to_blob(blob_to_clob(file_body))). There is no change in length for 1st and 2nd columns. Could you please let me know why length is getting lost in the CLOB to BLOB conversion ? Thanks.

    Thanks for replying.
    This is required because we have to store images in ldt files using FNDLOAD, whiich only supports CLOB, not BLOB. I understand that images stored in binary formats should be stored in BLOB only, but I am exploring the possibility of converting BLOB format to CLOB and then back to BLOB without loss of information. Any pointers in this regard are appreciated. Thanks !

  • Missing charsets in STring to FontSet conversion

    Hi,
    After installed SUn OS 10, I am trying to install SMC and I got a warning error: Missing Charsets in String to FontSet conversion. Cannot convert string "-monotype_arrial-regular-r-normal --*-140-*-*-p-*-iso8859-2" to type FonsStruct
    and so on, with different font types. etc....
    How can I find out which fontset in the Unix box? How can I permanent set it back to UTF-8 w/o re install OS again?
    Thanks
    HS

    Too bad Lily didn't follow up on TommyReynolds' suggestion. I'm also having the same problem ( I think ).
    TommyReynolds does say how to get the installed list, but doesn't say how to find out what's missing.
    My settings:
    [root@OEL5u4DB11gR2 X11]# rpm -qa 'xorg*font*' | /bin/sort
    xorg-x11-fonts-100dpi-7.1-2.1.el5
    xorg-x11-fonts-75dpi-7.1-2.1.el5
    xorg-x11-fonts-base-7.1-2.1.el5
    xorg-x11-fonts-ISO8859-1-100dpi-7.1-2.1.el5
    xorg-x11-fonts-ISO8859-1-75dpi-7.1-2.1.el5
    xorg-x11-fonts-misc-7.1-2.1.el5
    xorg-x11-fonts-truetype-7.1-2.1.el5
    xorg-x11-fonts-Type1-7.1-2.1.el5
    xorg-x11-font-utils-7.1-2
    [root@OEL5u4DB11gR2 X11]# uname -a
    Linux OEL5u4DB11gR2 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux
    [root@OEL5u4DB11gR2 X11]# xclock &
    [1] 5950
    [root@OEL5u4DB11gR2 X11]# Warning: Missing charsets in String to FontSet conversion
    I would greatly appreciate any input.
    Kind regards,
    UFP1701

  • Error Warning: Missing charsets in String to FontSet conversion

    Hi
    I was installed aqualogic BPM version 6.0 MP4 for weblogic on solaris 10 SPARC
    when i ran albpmadmcenter i got an error
    bash-3.00$./albpmadmcenter
    Warning: Missing charsets in String to FontSet conversion
    Warning: Missing charsets in String to FontSet conversion
    any solution?
    thanks.

    I just found this on the web at http://www-01.ibm.com/support/docview.wss?uid=swg21146408.
    When I ran "export LC_ALL=C" and then ran xclock, I did not get the message. This might work for you.
    Paul

  • Problem with String to Int conversion

    Dear Friends,
    Problem with String to Int conversion
    I am having a column where most of the values are numeric. Only 4 values are non numeric.
    I have replaces those non numeric values to numeric in order to maintain the data type.
    CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END
    This comes the result as down
    Grade
    _0_
    _1_
    _10_
    _11_
    _12_
    _13_
    _14_
    _15_
    _16_
    _17_
    _18_
    _19_
    _2_
    _20_
    _21_
    _22_
    _23_
    _24_
    _3_
    _4_
    _5_
    _6_
    _7_
    _8_
    _9_
    Refresh
    Now I want to convert this value to numeric and do some calculation
    So I changed the formula as below
    cast (CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END as INT)
    Now I get the following error
    View Display Error
    _     Odbc driver returned an error (SQLExecDirectW)._
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    _State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)_
    SQL Issued: SELECT cast ( CASE Grade.Grade WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade END as Int) saw0 FROM "Human Capital - Manpower Costing" WHERE LENGTH(CASE Grade.Grade WHEN 'E1' THEN '20' WHEN 'E2' THEN '21' WHEN 'E3' THEN '22' WHEN 'E4' THEN '23' ELSE Grade.Grade END) > 0 ORDER BY saw_0_
    Refresh
    Could anybody help me
    Regards
    Mustafa
    Edited by: Musnet on Jun 29, 2010 5:42 AM
    Edited by: Musnet on Jun 29, 2010 6:48 AM

    Dear Kart,
    This give me another hint, Yes you are right. There was one row which returns neither blank nor any value.
    I have done the code like following and it works fine
    Thanks again for your support
    Regards
    Code: cast (CASE (CASE WHEN Length(Grade.Grade)=0 THEN '--' ELSE Grade.Grade END) WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' when '--' then '-1' ELSE Grade.Grade END as Int)

  • I have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion

    i have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion.
    i wrote the method but it not workig
    My method is
    -(NSDate *)dateformstr:(NSString *)str
    NSString *date = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSDateFormatter *dateFormate = [[NSDateFormatter alloc] init];
      [dateFormate setDateFormat:@"yyyy-MM-dd'T'HH:mm:sssZZZZ"]
    // NSDate *formatterDate = [dateFormate  dateFromString:str];
        return formatterDate;
    but i did not the value and if i try othere formate i is working but my requiremet format is 2012-04-30T23:48:55.727-07:00.
    can any help it out in this senario.

    Sorry Butterbean, but I'm interested in the answer to your question myself.
    I've spent a few hours transfering my library from one computer to another and then find out that my ratings didn't transfer. Like you, I've spent many hours rating my 2000+ songs. I'm sure you have more, nevertheless, I want to find out how to get those ratings. They still show in my iTunes on my laptop but, when I go to the iTunes folder and display the details of at song, no rating is there. If you find out how to get them to display there in the iTunes folder, it seems that would be the key.
    Hope you get your answer soon.

  • Warning: Missing charsets in String to FontSet conversion

    Hi ,
    I just installed eclipse on a linux box abd while running eclipse i get the folowwing error -
    Warning: Missing charsets in String to FontSet conversion
    and the font looks distorted with blocks between alphabets

    did you fix this problem? I'm getting the same error :
    [bmollett@hextall ~]$ Warning: Missing charsets in String to FontSet conversion
    Warning: Cannot convert string "-*-*-medium-r-*-*-*-120-*-*-*-*-*-*" to type FontSet
    Warning: Missing charsets in String to FontSet conversion
    Warning: Unable to load any usable fontset
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    Warning: No font found.
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    Warning:
    Name: FONTLIST_DEFAULT_TAG_STRING
    Class: XmRendition
    Conversion failed. Cannot load font.
    JVMDG217: Dump Handler is Processing Signal 11 - Please Wait.
    JVMDG303: JVM Requesting Java core file
    JVMDG304: Java core file written to /home/bmollett/javacore.20050804.102118.11000.txt
    JVMDG215: Dump Handler has Processed Exception Signal 11.
    I've tried both motif and gtk2 versions ...

  • How to append the string into blob content

    the blob column will have a string with comma separated values which needs to be changed to column wise data and update it back with the existing BLOB content.
    string like:-'V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M'
    after i got splitting the values to column wise:
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M
    finally i need the blob append data output look like below,please do the needful................
    blob_value
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M

    actually
    my blob column values is:
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    splitting column wise data is:-**
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M
    now i am appending the string to blob content at the end of the line only like
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,MVCTMF1.0MICD-9 to 10 CMCODE_COMMENTS_UPLOAD0Absns2012-04-01Authorpa adminComment50 Record MapFVascularCM
    but my requirement is should be to append the column wise data to existing blob column as new line like:
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    VCTMF1.0MICD-9 to 10 CMCODE_COMMENTS_UPLOAD0Absns2012-04-01Authorpa adminComment50 Record MapFVascularCM
    my procedure:
    create or replace
    PROCEDURE PR_TEST_BLOB2 IS
    RES_BLOB CLOB;
    DEST_BLOB BLOB;
    SRC_BLOB BLOB;
    CURSOR CUR_TEST_BLOB2 IS
    SELECT REGEXP_SUBSTR(STR, '[^,]+', 1, LEVEL) FROM (SELECT UTL_RAW.CAST_TO_VARCHAR2(BLOB_VALUE) STR FROM TEST_BLOB2 WHERE TEST_ID=10)
    CONNECT BY LEVEL <= LENGTH(STR) - LENGTH(REPLACE(STR,','))+1;
    BEGIN
    OPEN CUR_TEST_BLOB2;
    LOOP
    FETCH CUR_TEST_BLOB2 INTO RES_BLOB;
    EXIT WHEN CUR_TEST_BLOB2%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(RES_BLOB);
    DEST_BLOB:=UTL_RAW.CAST_TO_RAW(RES_BLOB);--converting clob to blob;
    SELECT BLOB_VALUE INTO SRC_BLOB
    FROM TEST_BLOB2
    WHERE TEST_ID = 10 FOR UPDATE;
    --move the blob values to source file
    DBMS_LOB.APPEND(SRC_BLOB,DEST_BLOB);-- append the blob values
    COMMIT;
    END LOOP;
    CLOSE CUR_TEST_BLOB2;
    END;
    could you please help me.

  • Conversion of string to BLOB format

    Hi,
    Scenario is proxy to JDBC:
    I have a requirement where my PFD file name is maintained in one ABAP R3 table and I need to convert the PDF file name to BLOB format.
    Is there any function module available in R3 for converting to BLOB data type. or java mapping is required in graphical mappping for this conversion.
    My pdf file name is:
    SHELL_INC_123456789012_851000000005290_DE_04_2008.pdf
    Thnx
    Chirag

    Hi Chirag,
    I don't think there is any FM in ABAP is written for this purpose. you should need to write an UDF. Also my concern is that "where is the PDF file located"? If the answer is "on a file system accessible to the Oracle database" Then you can use directory objects and the DBMS_LOB package. It would look something like this:
    as SYS user do:
    -- assume the PDF files are in /data/documents filesystem directory
    create or replace directory pdfdir as '/data/documents';
    grant read on directory pdfdir to <USER>;
    as USER do:
    create table mydocs (id integer primary key, doc blob);
    declare
    bf bfile;
    b blob;
    src_offset integer := 1;
    dest_offset integer := 1;
    begin
    ' insert a new blob and return it to local variable
    insert into mydocs values(1, empty_blob()) returning doc into b;
    ' open the bfile for file "summary.pdf"
    bf := bfilename('PDFDIR', 'summary.pdf');
    dbms_lob.loadBlobFromFile(b, bf, dbms_lob.lobmaxsize, dest_offset, src_offset);
    ' done
    commit;
    end;
    I assumed that you are working with 2 different machines, one client, one server.
    If you are working on a single machine, there may be a simple bug in the code.
    try adding the line
    dbms_lob.open(bf, dbms_lob.file_readonly);
    between the calls to bfilename() and loadBlobFromFile()
    Also if you want to do this using java then please have a look in this link.
    http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.jccids.doc/com.ibm.db2.luw.apdv.java.doc/doc/cjvjdlbv.html
    Hopefully this will help you.
    Regards
    Aashish Sinha

  • How to call CLOB to BLOB conversion function within stored procedure?

    I have a tiny APEX application from which I need to be able to print. I’ve used these two resources: (Is there an inexpensive APEX report printer for invoices/checks/statements? and http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CJAHDJDA)
    I guess that in order to be able to download the RTF document stored in CLOB, I need to convert it into BLOB. I’ve found this function for this purpose on Oracle forums:
    CREATE OR REPLACE FUNCTION     c2b( c IN CLOB ) RETURN BLOB
    -- typecasts CLOB to BLOB (binary conversion)
    IS
              pos PLS_INTEGER := 1;
              buffer RAW( 32767 );
              res BLOB;
              lob_len PLS_INTEGER := DBMS_LOB.getLength( c );
    BEGIN
         DBMS_LOB.createTemporary( res, TRUE );
         DBMS_LOB.OPEN( res, DBMS_LOB.LOB_ReadWrite );
    LOOP
         buffer := UTL_RAW.cast_to_raw( DBMS_LOB.SUBSTR( c, 16000, pos ) );
         IF          UTL_RAW.LENGTH( buffer ) > 0
         THEN
                   DBMS_LOB.writeAppend( res, UTL_RAW.LENGTH( buffer ), buffer );
         END IF;
         pos := pos + 16000;
         EXIT WHEN pos > lob_len;
    END LOOP;
    RETURN res; -- res is OPEN here
    END c2b;And I am trying to use it in the modified download procedure that I also have found on Oracle forums:
    CREATE OR REPLACE PROCEDURE DOWNLOAD_WO(v_id IN NUMBER)
    AS
            v_mime          VARCHAR2(48);
            v_length     NUMBER;
            v_file_name     VARCHAR2(2000):= 'WO_Download.rtf';
            lob_loc          CLOB;
              v_blob      BLOB;
              v_company        jobs_vw.company%TYPE;
              v_project        jobs_vw.project%TYPE;
              v_description     jobs_vw.description%TYPE;
              v_date_          jobs_vw.date_%TYPE;
              v_job_no          jobs_vw.job_no%TYPE;
              v_apqwo               jobs_vw.apqwo%TYPE;
    --          v_mime           VARCHAR2(48) := 'application/msword';
    BEGIN
            SELECT     mime_type, report, DBMS_LOB.GETLENGTH(report)
              INTO     v_mime,lob_loc,v_length
              FROM     report_layouts
              WHERE     rl_id = 22332925279634283;
    -- JOB_VW record:
        SELECT     job_no
                   ,date_
                   ,description
                   ,apqwo
                   ,project
                   ,company       
         INTO     v_job_no
                   ,v_date_
                   ,v_description
                   ,v_apqwo
                   ,v_project
                   ,v_company
         FROM     jobs_vw
         WHERE     id = 214;
    -- Replace holders with actual values:
        lob_loc := REPLACE(lob_loc, '#COMPANY#', v_company);
        lob_loc := REPLACE(lob_loc, '#PROJECT#', v_project);
        lob_loc := REPLACE(lob_loc, '#DESCRIPTION#', v_description);
        lob_loc := REPLACE(lob_loc, '#DATE_#', TO_CHAR(v_date_, 'DD/MM/YYYY'));
        lob_loc := REPLACE(lob_loc, '#JOB_NO#', v_job_no);
        lob_loc := REPLACE(lob_loc, '#APQWO#', v_apqwo);
                  -- set up HTTP header
                        -- use an NVL around the mime type and
                        -- if it is a null set it to application/octect
                        -- application/octect may launch a download window from windows
                        owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
                    -- set the size so the browser knows how much to download
                    htp.p('Content-length: ' || v_length);
                    -- the filename will be used by the browser if the users does a save as
                    htp.p('Content-Disposition:  attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
                    -- close the headers           
                    owa_util.http_header_close;
                    -- download the BLOB
    --                wpg_docload.download_file( Lob_loc );
                             v_blob := c2b(lob_loc);
                             wpg_docload.download_file( v_blob );
    end DOWNLOAD_WO;
    /Unfortunately when I try to compile the download_wo stored procedure I am getting this error:
    Error at line 64: PL/SQL: Statement ignoredThe 64th line is:
    v_blob := c2b(lob_loc);How should I correctly call c2b within download_wo? Any advice is greatly appreciated.
    Thank you for your time.
    Daniel

    Hello there,
    Well, its invalid :(
    Object C2B is Invalid. I didn't know since when I run the create ... function, I only get this feedback:
    Statement processed.
    0.19 secondsI am investigating.
    Daniel

  • CLOB to BLOB conversion to save space

    Hi Gurus,
    I am having a table with a CLOB column which I am asked to convert into BLOB and in the process save some space. But I am finding even after the conversion, it is taking same amount of space as the previous CLOB column.
    Is there any way I can convert it to BLOB and/or save space in any way.
    Please let me know if there are any ways.
    Thanks
    Amitava.

    select * from v$version; -- it needs to be 11g+ Enterprise Edition;
    select * from v$option where parameter='Advanced Compression';
    But the best way, ask.  (on a piece of paper that requires a signature.)
    MK

  • HELP: String to double conversion?

    Hello,
    I want to convert a String to a double, and then use this double for a calculation. The conversion seems to be ok, but I get an error with the calculation... Please HELP!
    A part of my code:
    double angle;
    Double converted_angle;
    angle=jTextField2.getText();
    converted_angle= Double.valueOf(angle);
    double theta = cos(Math.PI/180*converted_angle);
    ERROR: "operator * cannot be applied to double,java.lang.Double"
    Thanks in advance.

    This is happening because you want to multiply a Double object, instead of a double value. Do this:
    Double converted_angle; should be double converted_angle;
    converted_angle= Double.valueOf(angle); should be changed to converted_angle = Double.parseDouble(angle);
    angle should probably be a String.
    check this link for your options:
    http://java.sun.com/j2se/1.4/docs/api/java/lang/Double.html

  • String to int conversion

    can n e body tell me how can i convert a String to an int

    always remember to use the try/catch block with thins that throw exceptions
    String gg;
    int in;
    try{  
    gg = "30";
       in = Integer.parseInt(gg);
    catch(NumberFormatException e){ 
      e.printStackTrace();
    }Ant

  • String to XML conversion using XSLT

    Hi all,
    I have a scenario when my source input XML is in the form of a string which needs to be transformed into an XML target fields.
    I am using XSLT mapping to do that and its working but unfortunately, input XML contain xml declaration <?xml version='1.0'?>. Because of which it fails.
    I need to remove this. Can any body please suggest how to do this?
    Any help will be appriciated.
    Regards
    -Kulwant

    Hi,
    Refer these links
    XI/PI: Convert Flat File to Deeply Nested XML Structures Using Only Graphical Mapping
    Regards,
    Surya

Maybe you are looking for