Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338

    Unanswered: Inserting records into a BLOB field

    We have a table with a BLOB field.
    Now whenever I try to insert the Filename C:/x1.txt into this field it isnot getting inserted.

    Please send me the query required to load this filename contents C:/x1.txt into the BLOB column.


    Thanks,
    Jay

  2. #2
    Join Date
    Jan 2005
    Posts
    6
    Hi

    Try this


    EXEC SQL BEGIN DECLARE SECTION;
    SQL TYPE IS BLOB_FILE blobDocument;
    EXEC SQL END DECLARE SECTION;



    strcpy(blobDocument.name, szFilename); // szFilename holds the name of the file to insert
    blobDocument.name_length = strlen(szFilename);
    blobDocument.file_options = SQL_FILE_READ;

    EXEC SQL insert into myTable
    (
    ..., DOCUMENT, ...
    )
    values
    (
    ..., :blobDocument, ...
    );



    I assume you use embedded SQL in C, don't you?
    You should declare your environment more precise.

    Ciao

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •