Convert BLOB from database to string

Hi All,
I have retrieved the blob data from my database , and now i have it in my InvokeVariable. The below details will brief the structure of my output variable.
<variable name="Invoke1_RetrieveRecordForInstanceId_OutputVariable"
messageType="*ns1:RetrieveRecordForInstanceIdOutputCollection_msg*"/>
<wsdl:message name="RetrieveRecordForInstanceIdOutputCollection_msg">
<wsdl:part name="RetrieveRecordForInstanceIdOutputCollection" element="db:RetrieveRecordForInstanceIdOutputCollection"/>
</wsdl:message>
<xs:complexType name="RetrieveRecordForInstanceIdOutputCollection">
<xs:sequence>
<xs:element name="RetrieveRecordForInstanceIdOutput" type="RetrieveRecordForInstanceIdOutput" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RetrieveRecordForInstanceIdOutput">
<xs:sequence>
<xs:element name="INSTANCE_ID" type="xs:decimal" nillable="true"/>
<xs:element name="SOURCE_XML" type="xs:base64Binary" nillable="true"/>
<xs:element name="TARGET_XML" type="xs:base64Binary" nillable="true"/>
</xs:sequence>
</xs:complexType>
I make my assign statement like below.
<assign name="Assign2">
<copy>
<from variable="Invoke1_RetrieveRecordForInstanceId_OutputVariable"
part="RetrieveRecordForInstanceIdOutputCollection"
query="/ns2:RetrieveRecordForInstanceIdOutputCollection/ns2:RetrieveRecordForInstanceIdOutput/ns2:SOURCE_XML"/>
<to variable="EnhancedBLOBdata"/>
</copy>
</assign>
I have my java code for converting the blob to string as below.
String input = (String)getVariableData("*EnhancedBLOBdata*");
Base64Decoder baseDecoder= new Base64Decoder();
try {            
byte[] decodedBytes = input.getBytes();
String decoded = new String(decodedBytes);
//String decoded = Base64Decoder.decode(input);
setVariableData("DecodedString", decoded);
catch(Exception ex)
ex.printStackTrace();
The data type of EnhancedBLOBdata is base64Binary.. I also checked with 'string' . Even then i dint get the proper decoded form.
Can anyone help me in using the variable SOURCE_XML coming under the RetrieveRecordForInstanceIdOutputCollection, directly in the line,
String input = (String)getVariableData("*Invoke_Output_Variable....<some format>*");
so that there is no need of assigning to some other variable.. Bcz while assignig i am not sure, the assigned variable contains data in blob format.
Kindly help me in this regard.
Thanks,
Sabarisri. N

I have figured out the error happens on a data picture with about 700KB of data all of the other data fields have less than 100KB. Is there a way around this size issue.

Similar Messages

  • Convert BLOB from database to XML. - *URGENT*

    Hi,
    I have converted xml data into BLOB object and inserted into database.
    Now when I retrieve the BLOB object,from my DB, using DBadapter, in the invokeOutputVariable, i have the following. This i copied from the 'Flow Trace'
    <Invoke1_GetSourceXML_OutputVariable>
    <part name="GetSourceXMLOutputCollection" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <GetSourceXMLOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/GetSourceXML">
    <GetSourceXMLOutput>
    <INSTANCE_ID>1</INSTANCE_ID>
    *<SOURCE_XML>weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a</SOURCE_XML>*
    <TARGET_XML xsi:nil="true"/>
    <ORDER_ID>1</ORDER_ID>
    <TASK_INSTANCE_ID>1</TASK_INSTANCE_ID>
    <ORDER_DATE xsi:nil="true"/>
    <TRANSLATION_TYP_CD xsi:nil="true"/>
    <EBM_ID>1</EBM_ID>
    <STATUS xsi:nil="true"/>
    <STATUS_DETAIL xsi:nil="true"/>
    </GetSourceXMLOutput>
    </GetSourceXMLOutputCollection>
    </part>
    </Invoke1_GetSourceXML_OutputVariable>
    1) Here i want to confirm, whether we l get weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a sort of value when we retrieve a BLOB object.
    2) Variable declaration is like below.
    <variable name="binaryXML" type="xsd:string"/>
    <variable name="decodedString" type="xsd:string"/>
    binaryXML - value assignment_
    <assign name="Assign2">
    <copy>
    <from variable="Invoke1_GetSourceXML_OutputVariable"
    part="GetSourceXMLOutputCollection"
    query="/ns2:GetSourceXMLOutputCollection/ns2:GetSourceXMLOutput/ns2:*SOURCE_XML*"/>
    <to variable="binaryXML"/>
    </copy>
    </assign>
    I have written java embedding code for converting this BLOB to  xml as below
    String input = (String)getVariableData("binaryXML");
    try
    /* *** INITIALLY I TRIED LIKE THIS*** */
    //byte[] decodedBytes = Base64Decoder.decode(input.getBytes());
    //String decoded = new String(decodedBytes);
    //setVariableData("decodedString",decoded);
    /* *** MY NEW CODE *** /
    String decoded = Base64Decoder.decode(input);
    setVariableData("decodedString",decoded);
    catch(Exception ex)
    ex.printStackTrace();
    My Doubt
    When I try to write this 'decodedString' to a .txt file, I couldnt find any output there.
    <assign name="Assign3">
    <copy>
    <from variable="decodedString"/>
    <to variable="Invoke2_Write_InputVariable" part="body"
    query="/ns4:Root/ns4:C1"/>
    </copy>
    </assign>
    Regarding the schema for the file to be written, i tried with 'opaque' schema.. I dint work. Later i tried with the schema as below (which is comma delimited)
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://TargetNamespace.com/WriteToFile"
    targetNamespace="http://TargetNamespace.com/WriteToFile"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:version="NXSD"
    nxsd:stream="chars"
    nxsd:encoding="US-ASCII"
    >
    <xsd:element name="Root">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Kindly help me in ths regard.
    Thanks,
    Sabarisri. N
    Edited by: Sabarisri N on Jul 22, 2011 2:37 PM

    Read this :
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#sthref508

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Getting blobs from databases

    Hi!
    Im trying to get a blob from a database and write it to a file, but I just can't get the Blob value, I just recieve the adress. I've tried InputStream and getBytes but none of them does what I want. getBytes where closest but because it requires two inparameters (long pos, int length) and blob.length gives an long i can't figure out how many bytes to get. Anyone got any sugestions?

    Agrawal.
    I've read through both those pages (even thou i've already managed to make the connection to mysql) and I still can't work around my problem. the method getBytes(), requires two parameters, one that tells it where to start reading and one telling it how long it should read. If I leave one out it will inevitable lead to problems. So I still need to figure out a way to get the length of the blob in a int to make this work. but since the blob.length() method returns a long wich I can't convert I'm stuck!

  • How to show in a report a pdf blob from database

    Hi all
    We are working on report 6i and report 10. We have a report wich needs to show a blob field from database that storages a pdf (type application/pdf). OLE2 is deprecated. The pdf blob field must be displayed in a preview and must be printed. In local, it works. When it works on a browser, the pdf blob field is missing. If we load the field into a pdf file, the field is not visible in the browser.
    Do not get it to work. How I can implement? Could you give us any example for this?

    In local, it works. What do you mean by that exactly? You see the pdf in Reports Builder?
    If you just want to show the pdf in a browser (not embedded in a report) it is easy to use mod_plsql. You can have a simple db procedure like this to show any kind of blob:
    procedure show_webdoc(io_blob    in out nocopy blob
                         ,i_mimetype in varchar2
                         ,i_filename in varchar2)
    is
    begin
       if dbms_lob.getlength(io_blob) >0 then
          owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
          htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
          htp.p('Content-Disposition:  inline; filename="'||i_filename|| '"');
          owa_util.http_header_close;
          wpg_docload.download_file(io_blob);
       end if;
    end show_webdoc;

  • Dowload blobs from Database

    I know this is not the best way to store files but I have inherited an old php script which I am converting to CF because php is useless.
    Now i have a script to do this in php but can this be achived with CF? It is just a quick fix until I have time to rework the CMS
    <?php
    if(isset($_GET['id']))
    // if id is set then get the file with the id from database
    $id    = $_GET['id'];
    $query = "SELECT name, type, size, content " .
             "FROM upload WHERE id = '$id'";
    $result = mysql_query($query) or die('Error, query failed');
    list($name, $type, $size, $content) =                                  mysql_fetch_array($result);
    header("Content-length: $size");
    header("Content-type: $type");
    header("Content-Disposition: attachment; filename=$name");
    echo $content;
    i
    exit;
    ?>

    My php experience is NILL, but applying basic coding experience I believe your CFML will be close to this.
    <cfif structKeyExists(url,"id")>
      <cfquery datasource="..." name="result">
        SELECT name,type,size,content
        FROM upload
        WHERE id = <cfqueryparam value="#url.id#" cfsqltype="cf_sql_integer">
      </cfquery>
      <cfheader name="Content-Disposition: atachment; filename=#result.name#">
      <cfcontent type="#result.type#" reset="yes">
      #result.content#
    </cfif>
    If any of this content can be binary, then you may also need to use one or more of the toBinary() toBase64(), isBinary(), binaryDecode() or other relevant functions.

  • Convert pdf from database system to pdf creator with our LOGO possible?

    We work in our company with a data base programme and when we creat a pdf with the info of these programme we want our LOGO automaticly intergrate in these new PDF.

    1. What software currently creates the PDF from database info?
    2. Is this software on each user's computer, on the database server, a web server, or somewhere else?

  • Retrieval of image (Blob) from database - doesn't always work in JSP - Why?

    In my JSP pages, when an image needs to be retrieved, I direct <img src> to a servlet that handles image processing.
    As an example, if I have 30 products that need to be shown on 1 webpage, there will be 30, dynamically generated, <img src="go.imageServlet?id=a1"> tags/statements. The servlet, when called, will make a connection to the database, run a query for the image requested (fetched as type Blob), image displays in <img src> area of JSP page, and finally the ResultSet, Statement, and Connection object(s) are closed.
    I tested this out, and unfortunately, to my surprise, and disappointment, a few images did not display on the page. Though the images are in the database table. I'm a little lost as to why this problem is occurring.
    Can someone please shed some light on this for me?

    evnafets wrote:
    If you request just one image, does that image come back broken, or is it different images that are 'broken' each time?On a page of almost 30 image requests (thumbnail size), it varies, but typically, 1-3 images are 'broken' each time. And they are not always the same images. Very strange.
    There may potentially be thread concurrency errors depending upon how you have written your servlet - ie one request for an image interfering with another because they use the same variable.
    To make it threadsafe, in your servlet make sure that you only use variables local to the doGet/doPost method, and not any class attributes.In my JSP page that makes the requests for these images, a String array generates the <img src> tags on the page, as a very basic example :
    <%  for(int i=0; i<products.length; i++) {
    %>
          <img src="go.imageP?imageNumber=<%=products[[0]%>">
    <% }//for %>
    Sorry for not posting code snippets from my servlet in my first post of this topic....
    Here is my servlet snippet -     public class ImageProcessingServlet extends HttpServlet {
              public Connection conn = null;
              public ResultSet rs = null;
              public Statement stmt = null;
              public PreparedStatement pstmt = null;          
              public PrintWriter out = null;     
              public String siteNameReference = "";
              int maxFullSizeImageWidth = 600;          
              int maxSizeImageWidth = 300;
              int maxSizeThumbWidth = 140;
              int maxImageFields = 4;
              String errorMessage = "";               
              public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
                   doPost(req,res);
              public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              try {                       
         HttpSession session = req.getSession();
         siteNameReference = req.getParameter("snr");
         String process = req.getParameter("process");
         if(process == null) process = "";
                   Context ctx = new InitialContext();
              if(ctx == null )
    throw new Exception("Boom - No Context");
              DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/imageDB");
         conn = ds.getConnection();
         stmt = conn.createStatement();      
              rs = stmt.executeQuery("Select "+imageNumber+" from images");
              rs.next();
              Blob blobImage = rs.getBlob(1);               
              getImage(blobImage,"thumb",res);
              if(rs != null) { rs.close(); }
              rs = null;
         if(stmt != null) { stmt.close(); }
         stmt = null;
         if(pstmt != null) { pstmt.close(); }
         pstmt = null;
         conn.close();
         conn = null;          
              }//try
         catch (Exception e) { }
         finally {
                   if (rs != null) {
                   try { rs.close(); } catch (SQLException e) { ; }
                   rs = null;
                   if (stmt != null) {
                   try { stmt.close(); } catch (SQLException e) { ; }
                   stmt = null;
                   if (pstmt != null) {
                   try { pstmt.close(); } catch (SQLException e) { ; }
                   pstmt = null;
                   if (conn != null) {
                   try { conn.close(); } catch (SQLException e) { ; }
                   conn = null;
              }//finally
         }//post          
              public void getImage(Blob blobImage, String imageType, HttpServletResponse res) {
                   try {                                              
                        //imageType will = Super = 600
                        // = Large = 300
                        //               = Thumb = 150
                        res.reset();
                        res.setContentType("image/jpeg");
                        BufferedInputStream bis = new BufferedInputStream(blobImage.getBinaryStream());                    
                        BufferedOutputStream bos = new BufferedOutputStream(res.getOutputStream());                                                            
                        if(imageType.equals("super")) {
                        byte[] imageBytes = new byte[(int)blobImage.length()]; //picture size           
         int length;
         while((length = bis.read(imageBytes)) > 0) {
    bos.write(imageBytes, 0, length);
         bos.flush();     
                   res.flushBuffer();
                        } else
                        if(imageType.equals("large")) {
                             resize(bis,bos,maxSizeImageWidth);
                             bos.flush();
                             res.flushBuffer();
                        } else
                        if(imageType.equals("thumb")) {
                             resize(bis,bos,maxSizeThumbWidth);
                             bos.flush();
                             res.flushBuffer();                         
                        }//if
                        //close streams
                        bis.close();
                        bos.close();
                   }//try
                   catch(Exception e) {}
              }//end          
         public void resize(BufferedInputStream bis, BufferedOutputStream bos, int maxImageWidth) {
              try {                            
              BufferedImage bufimg = ImageIO.read(bis);                                         
              //size of image
              int img_width = bufimg.getWidth();
              int img_height = bufimg.getHeight();               
              double scale = (double)maxImageWidth/(double)img_width;                    
              Image sized = getScaledInstanceAWT(bufimg, scale, Image.SCALE_SMOOTH);
              //convert image to BufferedImage
              BufferedImage resized = toBufferedImage(sized, BufferedImage.TYPE_INT_RGB);                                                                                
                        ImageIO.write(resized,"jpeg",bos);                                                                           
         }//try
         catch(Exception e){}
    }//end
    Edited by: webnotick on Apr 13, 2010 12:24 PM
    --added a method to the code snippet --                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Displaying BLOB from Database

    Hi All,
    I am trying to preview a 'jpeg' image which is stored in my database. The images get inserted into the DB without any trouble, but on retrieving the images I get 'broken links' to the images. Please Help:
    PROCEDURE GET_TEAM_LOGO(team_name VARCHAR2)
    AS
    vblob BLOB;
    buf RAW(32000);
    buf_size INTEGER := 32000;
    offset INTEGER := 1;
    len NUMBER;
    mime_type VARCHAR2(30);
    BEGIN
    auth_proc;
    -- get image_data and its mime type from the database
    WHERE LOGO_ID=position;
    htp.p('This is the value of team:'|| team_name ||'<br>');
    SELECT logo_image, logo_type INTO vblob, mime_type
    FROM LOGO_TABLE
    WHERE group_name = team_name;
    -- set the mime type for the http protocol
    owa_util.mime_header('image/jpeg');
    -- read the data with htp package
    len:=dbms_lob.getlength(vblob);
    WHILE offset < len LOOP
    dbms_lob.read(vblob,buf_size,offset,buf);
    htp.prn(utl_raw.cast_to_varchar2(buf));
    offset:=offset+buf_size;
    END LOOP;
    -- check for exception
    EXCEPTION
    WHEN OTHERS THEN
    htp.p(SQLCODE || SQLERRM);
    END;
    Thanks,
    Peter

    Hi!
    I've used this code successfylly in a mod_plsql procedure.
    Can be used as following:
    htp.img('http://yourhost:port/<dad>/image.get_image?p_picture_id=123,'"right"',null,null,'width=107 height=66 border=1');
    procedure get_image
    ( p_picture_id number
    ) as
    cursor c_pict
    ( b_picture_id number
    ) is
    select pict.picture -- blob column
    , pict.format -- Gif/Jpeg etc.
    from pictures pict
    where pict.picture_id = b_picture_id
    r_pict c_pict%rowtype;
    v_blob BLOB;
    v_amt NUMBER := 30;
    v_off NUMBER := 1;
    v_raw RAW(4096);
    begin
    open c_pict(p_picture_id);
    fetch c_pict into r_pict;
    if c_pict%notfound
    then
    close c_pict;
    else
    close c_pict;
    owa_util.mime_header('image/'||r_pict.format);
    begin
    loop
    dbms_lob.read(r_pict.picture,v_amt,v_off,v_raw);
    htp.prn(utl_raw.cast_to_varchar2(v_raw));
    v_off := v_off+v_amt;
    v_amt := 4096;
    end loop;
    exception
    when no_data_found
    then
    null;
    end;
    end if;
    end get_image;

  • Need to Move contents of BLOB from database to middle-tier file system

    I need to be able to move the contents of a BLOB (which is a PDF file) from the database to a specified location in the middle-tier file system (running 9iAS). There does not seem to be the equivalent package or other built-in functionality to DBMS_LOB (for moving INTO the database, which is amazing. Does anyone have a java bean or (?) which can accomplish this simingly simple task??

    The java bean should work to extract from the database to a binary file on either Unix or Windows. As long as the file is in .bmp format in the database, you can save the file as .bmp on you file system and everything should be alright.
    Or, perhaps, am I not understanding your question?
    Good Luck
    Eric Kamradt

  • How to convert from integer to string

    import javax.swing.*;
    import java.awt.*;
    public class Hw extends JFrame{
         JButton[] buttons = new JButton[26];
         public Hw(){
              getContentPane().setLayout(new GridLayout(2,13));
              JButton []buttons=new JButton[26];
              for(int i=65; i<90;i++)
                   buttons=new JButton(i+" ");
                   getContentPane().add(buttons[i]);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
         public static void main(String[] args) {
              Hw win = new Hw();
              win.setVisible(true);
              win.setLocation(50, 100);
    I have 26 buttons and each buttons will contain a character like A,B,C,D,...
    but i dont know how to convert it from integer to string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    import javax.swing.*;
    import java.awt.*;
    public class Hw extends JFrame{
         JButton[] buttons = new JButton[26];
         public Hw(){
              getContentPane().setLayout(new GridLayout(2,13));
              JButton []buttons=new JButton[26];
              for(int i=0; i<buttons.length;i++)
                   buttons=new JButton(""+('A'+i));
                   getContentPane().add(buttons[i]);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
         public static void main(String[] args) {
              Hw win = new Hw();
              win.setVisible(true);
              win.setTitle("Hangman Game");
    tjacobs01  , thnx for urgent reply, but i didnt apply your algorithm inside of the my program, if its possible can u compile the program with your codes..
    its a little complex for me i didnt understand anythind :S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to convert BLOB data into string format.

    Hi,
    I have problem while converting blob data into string format.
    for example,
    Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
    will get me the first 4000 byte of BLOB .
    When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
    declare
    my_var CLOB;
    BEGIN
    for x in (Select X from T)
    loop
    my_var:=dbms_lob.substr(x.X,32767,1)
    end loop
    return my_var;
    I comfortably convert 32k BLOB field to string.
    My problem is how to convert blob to varchar having size more than 32K.
    Please help me to resolve this,
    Thanx in advance for the support,
    Nilesh

    Nilesh,
    . . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
    SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
    -- resulting string:
        ☺AW(⌂özßHAA
    Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
    Regards,
    Noel

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • How to specifiy the provider to be Oracle.ManagedDataAccess.Client when creating a dynamic connection string with EF Code First from Database?

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

  • Error synchroniz​ing with Windows 7 Contacts: "CRADSData​base ERROR (5211): There is an error converting Unicode string to or from code page string"

    CRADSDatabase ERROR (5211): There is an error converting Unicode string to or from code page string
    Device          Blackberry Z10
    Sw release  10.2.1.2977
    OS Version  10.2.1.3247
    The problem is known by Blackberry but they didn't make a little effort to solve this problem and they wonder why nobody buy Blackberry. I come from Android platform and I regret buying Blackberry: call problems(I sent it to service because the people that I was talking with couldn't hear me), jack problems (the headphones does not work; I will send it again to service). This synchronisation problem is "the drop that fills the glass". Please don't buy Blackberry any more.
    http://btsc.webapps.blackberry.com/btsc/viewdocume​nt.do?noCount=true&externalId=KB33098&sliceId=2&di​...

    This is a Windows registry issue, if you search the Web using these keywords:
    "how to fix craddatabase error 5211"       you will find a registry editor that syas it can fix this issue.

Maybe you are looking for