BFILE From SqlDataSource

I'm using Orale 10.2. on a Win2K server in ODP.NET V Beta Release 10.2.0.2.
I'm trying to insert a record in the db with a BFILE field using a SqlDatasource.
The insert statement is:
InsertCommand='INSERT INTO "MYTABLE" ("FIELD1_ID", "FIELD2_ID", "NOMEFILE") VALUES (:myvar1, :TextBoxField2, BFILENAME(:NomeDir, :NomeFile))'
The record is created but the content of the filename and directory name got from the BFILE field are:
t e s t _ d i r instead of test_dir
M y F i l e . d o c instead of MyFile.doc
Using an insert from SQLPlus the filename and directory name are correct.
Any idea?
Thanks a lot
Regards
Marco

Give the ODP.NET forum a try.
ODP.NET

Similar Messages

  • Oracle 9i +Java: Change string encoding from UTF-16 to Windows-1251

    Dear colleagues,
    I have a very urgent case: need to change encoding of the string retrieved from the file (with encoding UTF-16) to Windows-1251 and put it to db table, to CLOB field.
    Code of the Java function
    +public static void file2table(String sql, String fileName, String characterSet, int asByteArray) throws SQLException, IOException {+
    Connection con = null;
    Writer writer = null;
    Reader reader = null;
    +try {+
    con = getConnection();
    PreparedStatement ps=con.prepareStatement(sql);
    reader = new InputStreamReader(new BufferedInputStream(new FileInputStream(new File(fileName))), characterSet);
    BufferedReader br = new BufferedReader(reader);
    String s;
    +while ((s = br.readLine()) != null) {+
    byte[] defaultBytes=s.getBytes(characterSet);
    String win1251str=new String(defaultBytes, "windows-1251");
    +if(asByteArray>0) {+
    ps.setBytes(1, defaultBytes);
    +//ps.setBytes(1, win1251str.getBytes("windows-1251"));+
    +} else {+
    ps.setString(1, s);
    +}+
    ps.executeUpdate();
    +}+
    con.commit();
    +} finally {+
    +if (reader != null) {reader.close();}+
    +if (con != null) {con.close();}+
    +}+
    +}+
    I was check, all bytes from the file received correctly. But if I put readed bytes to database table, result text in table is broken.

    >
    Yes, currently I already have filled table with all file lines in result table but with incorrect encoding
    >
    No you haven't - not using the code you posted. You can't save LOB data using only the BLOB or CLOB.
    That isn't data that you strored - it is garbage that is being stored as the LOB locator.
    I ask you why you were trying to store the data that way instead of the way the doc shows you and you said
    >
    Because var. s is type of Java String.
    For method setClob must be use type of CLOB
    >
    You are teriibly confused about LOBs. A BLOB or CLOB Java datatype is the LOB LOCATOR and doesn't contain any data.
    Yes - it is true that method setClob must be of type CLOB but that CLOB instance HAS TO BE THE LOB LOCATOR - not the data.
    You access LOB data using streams. To store LOB data you have to RETRIEVE (not send) a LOB locator from the database and then use the locator's stream to send the actual data.
    So if you are creating a new record in the table you typically do an INSERT that includes an EMPTY_LOB() and have the newly created LOB locator returned to you. Then you use that locators stream to send the actual data.
    Since you are not doing that your approach will not work.
    Here is a link to the 9i JDBC Dev Guide
    http://docs.oracle.com/cd/B10501_01/java.920/a96654.pdf
    See page 8-2 to start with
    >
    BLOB and CLOB data is
    accessed and referenced by using a locator, which is stored in the database table and
    points to the BLOB or CLOB data, which is outside the table.
    To work with LOB data, you must first obtain a LOB locator. Then you can read or
    write LOB data and perform data manipulation. The following sections also
    describe how to create and populate a LOB column in a table.
    The oracle.sql.BLOB and CLOB classes implement the java.sql.Blob and
    Clob interfaces, respectively (oracle.jdbc2.Blob and Clob interfaces under
    JDK 1.1.x). By contrast, BFILE is an Oracle extension, without a corresponding
    java.sql (or oracle.jdbc2) interface.
    Instances of these classes contain only the locators for these datatypes, not the data.
    After accessing the locators, you must perform some additional steps to access the
    data. These steps are described in "Reading and Writing BLOB and CLOB Data" on
    page 8-6 and "Reading BFILE Data" on page 8-22.
    Note: You cannot construct BLOB, CLOB, or BFILE objects in your
    JDBC application—you can only retrieve existing BLOBs, CLOBs,
    or BFILEs from the database or create them using the
    createTemporary() and empty_lob() methods.
    >
    Read the above quotes several times until you understand what they are telling you. These are the two main concepts you need to accept:
    >
    To work with LOB data, you must first obtain a LOB locator.
    You cannot construct BLOB, CLOB, or BFILE objects in your JDBC application
    >
    See the example code and description starting on page 8-11 for how to populate a LOB column in a table
    >
    Create a BLOB or CLOB column in a table with the SQL CREATE TABLE statement,
    then populate the LOB. This includes creating the LOB entry in the table, obtaining
    the LOB locator, creating a file handler for the data (if you are reading the data from
    a file), and then copying the data into the LOB.
    >
    Until you start using the proper methodology you are just wasting you time and will not be successful.

  • Webutil_file_transfer for bfile

    Is there a way to have webutil download a bfile from the DB to the client?
    Thanks,
    Michelle

    Doh, sorry. I posted too quickly. We just solved the problem for BLOBs, and I guess it gave me tunnel vision.
    Maybe, if you don't get another answer, you could call a function you set up on the database which moves a BFILE into a global temporary table, then follows the instructions in that link? Then do the reverse if you also need to save the file back?
    -=cf

  • Blob (bfile)+ ole2

    hello gurus
    i would like to know how is possible within Oracle Forms (i am still using 6i) to retrieve a MS office document stored in an oracle DB and showing it using ole2 automation.
    I miss just the step of retrieving from DB and loading it into memory or somewhere on the client filesystem, so let it be opened with the right MS office application (chosen with ole2)
    My actual idea is to create a block based on the table that stores the blob (bfile) column, but i don't know how to store the blob (bfile) object in the forms application.. there is a particular object to use? or i must just load the key (or rowid) and then requering the table using it? and after loading the blob (bfile) from table, how can i convert it to be usable for ole2?
    thanks in advance!
    claudio

    Chapter 7 in the Oracle Call Interface Programmer's Guide discusses [LOB and BFILE operations|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci07lob.htm#g452677]. Given that you are posting here, I assume you are interested in using the OCI interface and that you are familiar with the basics of OCI programming. If not, you'll want to read the other chapters in the OCI Programmer's Guide.
    Justin

  • Strategy and Process on how to best enqueue from the file system

    I have a single database that must accept BFILES from one location via a directory folder, http text documents via proxy server, and unstructured XMLTYPE CLOB from another database.
    I have created an ANYDATA queue, and will try to transform the dequeued output to XMLTYPE payloads for a pl/sql callback.
    My problem is how to monitor both the file system BFILE folder, and the XMLTYPE CLOBS, to automatically begin then enqueue process. The queue would have to accept from (1) to anynumber of files, and given that requirement the use of an array batch is what I would like to use, but need to populate the array.
    Any help would be most appreciated.
    David

    Thank you for the quick reply.
    The database version is 10.2.0.3.
    There are three sources of documents coming into the system.
    Source 1: Outside entity (in-front of a secure firewall) who must place their XML (XSD compliant) files on a shared file system server (the BFILES).
    Source 2: Internal entity (behind firewall) who publishes their XML files to a defined database directory on the database server.
    Source 3: Enterprise Intranet contributors submitting their individual files via url.
    On entry for each file they must be validated for XSD compliance then if passed submitted to the main enqueue for propagation to 5 additional process queues with separate callback procedures.
    If reasonably possible, separate agents of some sort would "listen" at each folder location, then begin the enqueue process when either a batch of files or a single file is placed in the directory folder.
    AQ itself has no such mechanism to monitor locations, and a scheduled job makes sense - however the job would have to continuously run given the very short processing requirement. However, using DBMS_SCHEDULER may be the best solution given ALL rhe requirements.
    Thank you for your professionalism - I appreciate the assistance.

  • Filegetname

    Hi,
    I´ve a problem while using the "filegetname" procedure from the DBMS_LOB package. I wanna get the alias-path and the filename from a stored bfile.
    Trying this code Oracle throws an error(argument 2 is null, not valid or...)argument 2 is "DirAlias_name":
    set serveroutput on;
    CREATE OR REPLACE PROCEDURE getNameBFILE_proc IS
    File_loc BFILE;
    DirAlias_name VARCHAR2(50);
    File_name VARCHAR2(40);
    BEGIN
    SELECT Anleitung INTO File_loc FROM Betriebsmittel
    WHERE Nummer='yy';
    DBMS_LOB.FILEGETNAME(File_loc,DirAlias_name, File_name);
    DBMS_output.put_line(DirAlias_name || File_name);
    END;
    "Anleitung" is a column of the type BFILE from table "Betriebsmittel". The primary key column is "Nummer" and "yy" exists.
    Thanx for any advice.
    Toser Ban

    I see that the output displayed UTL_DIR and NAME are all in CAPS. If the OS is Case Sensitive and if the DIRECTORY NAME and FILE NAME does not match, you are quite likely to the get 22285 error. Please check your Directory name and File name again.
    Regards,
    Murali Mohan

  • PRO*C에서 EMBEDDED SQL STATEMENTS를 사용해서 LOB DATATYPES에 접근하는 예제

    제품 : PRECOMPILERS
    작성날짜 : 2001-07-12
    PRO*C에서 EMBEDDED SQL STATEMENTS를 사용해서 LOB DATATYPES에 접근하는 예제
    ==========================================================================
    Pro*C에서 LOB를 사용하는 방법에는 다음 3가지가 있습니다.
    (1) PL/SQL blocks에서 DBMS_LOB package를 이용하는 방법
    (2) OCI function을 이용하는 방법
    (3) Embedded SQL statements을 이용하는 방법
    다음은 (3)번째 방법에 대한 pro*c에서 지원하는 명령어들입니다.
    o APPEND: Appends lob value at the end of another LOB.
    EXEC SQL LOB APPEND :src TO :dst;
    o ASSIGN: Assigns LOB or BFILE locator to another.
    EXEC SQL LOB ASSIGN :src TO :dst;
    o CLOSE: Close LOB or BFILE.
    EXEC SQL LOB CLOSE :src;
    o COPY: Copy all or part of LOB value into another LOB.
    EXEC SQL LOB COPY :amt FROM :src [AT :src_offset] TO :dst [AT dst_offset];
    o CREATE TEMPORARY: Creates a temporary LOB.
    EXEC SQL LOB CREATE TEMPORARY :src;
    o ERASE: Erase the given amount of LOB data starting from a given offset.
    EXEC SQL LOB ERASE :amt FROM :src [AT :src_offset];
    o FILE CLOSE ALL: Closes all the BFILES open in the current session.
    EXEC SQL LOB FILE CLOSE ALL;
    o FILE SET: Set DIRECTORY alias and FILENAME in a BFILE locator.
    EXEC SQL LOB FILE SET :file DIRECTORY = :alias, FILENAME = :filename;
    o FREE TEMPORARY: Free the temporary space for the LOB locator.
    EXEC SQL LOB FREE TEMPORARY :src
    o LOAD FROM FILE: Copy all or part of BFIL into an internal LOB.
    EXEC SQL LOB LOAD :amt FROM FILE :file [AT :src_offset]
    INTO :dst [AT :dst_offset];
    o OPEN: Open a LOB or BFILE for read or read/write.
    EXEC SQL LOB OPEN :src [ READ ONLY | READ WRITE ];
    o READ: Reads all or part of LOB or BFILE into a buffer.
    EXEC SQL LOB READ :amt FROM :src [AT :src_offset]
    INTO :buffer [WITH LENGTH :buffer];
    o TRIM: Truncates the LOB vlaue.
    EXEC SQL LOB TRIM :src to :newlen;
    o WRITE: Writes contents of the buffer to a LOB.
    EXEC SQL LOB WRITE [APPEND] [FIRST | NEXT | LAST | ONE ]
    :amt FROM :buffer [WITH LENGTH :buflen] INTO :dst [AT :dst_offset];
    o DESCRIBE: Retrieves the attributes from a LOB.
    EXEC SQL LOB DESCRIBE :src GET attribute1 [{, attributeN}]
    INTO :hv1 [[INDICATOR] :hv_ind1] [{, :hvN [[INDICATOR] :hv_indN] }];
    Attributes can be any of the following:
    CHUNKSIZE: chunk size used to store the LOB value
    DIRECTORY: name of the DIRECTORY alias for BFILE
    FILEEXISTS: whether BFILE exists or not
    FILENAME: BFILE name
    ISOPEN: whether BFILE with this locate is OPEN or not
    ISTEMPORARY: whether specified LOB is temporary or not
    LENGTH: Length of BLOBs and BFILE in bytes, CLOBs and NCLOBs
    in characters.
    다음은 LOB를 사용하는 sample을 실행하는 방법입니다.
    1. 먼저 scott user에서 다음을 실행합니다. (create directory를 할 수 있는 권한이
    있어야 하며, directory는 사용하시는 환경에 맞도록 수정해 주십시요.)
    drop table lob_table;
    create table lob_table (key number, a_blob BLOB, a_clob CLOB);
    drop table lobdemo;
    create table lobdemo (key number, a_blob BLOB, a_bfile BFILE);
    drop directory dir_alias;
    create directory dir_alias as '/users/app/oracle/product/8.1.7/precomp/demo/proc';
    insert into lob_table values(1, utl_raw.cast_to_raw('1111111111'), 'aaaaaaaa');
    commit;
    2. 다음 코드는 out.gif 파일을 위에서 지정한 directory에 만들고 lob_table의
    내용에 들어있는 BLOB의 내용을 저장하는 sample입니다.
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    /* Define constants for VARCHAR lengths. */
    #define UNAME_LEN 20
    #define PWD_LEN 40
    /* Declare variables. No declare section is
    needed if MODE=ORACLE. */
    VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle-supplied struct */
    varchar password[PWD_LEN]; /* varchar can be in lower case also. */
    /* The following 3 lines avoid inclusion of oci.h during precompilation
    oci.h is needed only during compilation to resolve calls generated by
    the precompiler
    #ifndef ORA_PROC
    #include <oci.h>
    #endif
    #include <sqlca.h>
    OCIBlobLocator *blob;
    OCIClobLocator *clob;
    FILE *fp;
    unsigned int amt, offset = 1;
    #define MAXBUFLEN 5000
    unsigned char buffer[MAXBUFLEN];
    EXEC SQL VAR buffer IS RAW(MAXBUFLEN);
    /* Declare error handling function. */
    void sql_error(msg)
    char *msg;
    char err_msg[128];
    size_t buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    printf("\n%s\n", msg);
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    printf("%.*s\n", msg_len, err_msg);
    EXEC SQL ROLLBACK RELEASE;
    exit(EXIT_FAILURE);
    void main()
    /* Connect to ORACLE--
    * Copy the username into the VARCHAR.
    strncpy((char *) username.arr, "SCOTT", UNAME_LEN);
    /* Set the length component of the VARCHAR. */
    username.len =
    (unsigned short) strlen((char *) username.arr);
    /* Copy the password. */
    strncpy((char *) password.arr, "TIGER", PWD_LEN);
    password.len =
    (unsigned short) strlen((char *) password.arr);
    /* Register sql_error() as the error handler. */
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
    /* Connect to ORACLE. Program will call sql_error()
    * if an error occurs when connecting to the default database.
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("\nConnected to ORACLE as user: %s\n", username.arr);
    /* Allocate the LOB host variables and select the BLOB value */
    EXEC SQL ALLOCATE :blob;
    EXEC SQL ALLOCATE :clob;
    EXEC SQL SELECT a_blob INTO :blob FROM lob_table WHERE key=1;
    /* Open external file to which BLOB value should be written */
    fp = fopen("out.gif", "w");
    EXEC SQL WHENEVER NOT FOUND GOTO end_of_lob;
    amt = 5000;
    EXEC SQL LOB READ :amt FROM :blob AT :offset INTO :buffer;
    fwrite(buffer, MAXBUFLEN, 1, fp);
    EXEC SQL WHENEVER NOT FOUND DO break;
    /* Use polling method to continue reading the next pieces */
    while (TRUE)
    EXEC SQL LOB READ :amt FROM :blob INTO :buffer;
    fwrite(buffer, MAXBUFLEN, 1, fp);
    end_of_lob:
    fwrite(buffer, amt, 1, fp);
    printf("\nG'day.\n\n\n");
    /* Disconnect from ORACLE. */
    EXEC SQL ROLLBACK WORK RELEASE;
    exit(EXIT_SUCCESS);
    3. 다음 코드는 위에서 만든 out.gif file을 lobdemo에 저장하는 sample입니다.
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    /* Define constants for VARCHAR lengths. */
    #define UNAME_LEN 20
    #define PWD_LEN 40
    /* Declare variables. No declare section is
    needed if MODE=ORACLE. */
    VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle-supplied struct */
    varchar password[PWD_LEN]; /* varchar can be in lower case also. */
    /* The following 3 lines avoid inclusion of oci.h during precompilation
    oci.h is needed only during compilation to resolve call generated by
    the precompiler
    #ifndef ORA_PROC
    #include <oci.h>
    #endif
    #include <sqlca.h>
    OCIBlobLocator *blob;
    OCIBFileLocator *bfile;
    char *alias = "DIR_ALIAS";
    char *filename = "out.gif";
    unsigned int amt = 50;
    unsigned int filelen;
    /* Declare error handling function. */
    void sql_error(msg)
    char *msg;
    char err_msg[128];
    size_t buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    printf("\n%s\n", msg);
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    printf("%.*s\n", msg_len, err_msg);
    EXEC SQL ROLLBACK RELEASE;
    exit(EXIT_FAILURE);
    void main()
    /* Connect to ORACLE--
    * Copy the username into the VARCHAR.
    strncpy((char *) username.arr, "SCOTT", UNAME_LEN);
    /* Set the length component of the VARCHAR. */
    username.len =
    (unsigned short) strlen((char *) username.arr);
    /* Copy the password. */
    strncpy((char *) password.arr, "TIGER", PWD_LEN);
    password.len =
    (unsigned short) strlen((char *) password.arr);
    /* Register sql_error() as the error handler. */
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
    /* Connect to ORACLE. Program will call sql_error()
    * if an error occurs when connecting to the default database.
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("\nConnected to ORACLE as user: %s\n", username.arr);
    /* Allocate the LOB locator */
    EXEC SQL ALLOCATE :blob;
    EXEC SQL ALLOCATE :bfile;
    /* Initialize the DIRECTORY alias of the BFILE and FILENAME */
    EXEC SQL LOB FILE SET :bfile
    DIRECTORY = :alias, FILENAME = :filename;
    EXEC SQL INSERT INTO lobdemo values (1, EMPTY_BLOB(), :bfile);
    EXEC SQL SELECT a_blob, a_bfile INTO :blob, :bfile FROM lobdemo
    WHERE key = 1;
    EXEC SQL LOB OPEN :bfile;
    /* Get the BFILE length */
    EXEC SQL LOB DESCRIBE :bfile
    GET LENGTH INTO :filelen;
    printf("File length is: %d\n", filelen);
    amt = filelen;
    /* Read BFILE and write to BLOB */
    EXEC SQL LOB LOAD :amt FROM FILE :bfile INTO :blob;
    EXEC SQL LOB CLOSE :bfile;
    printf("\nG'day.\n\n\n");
    /* Disconnect from ORACLE. */
    EXEC SQL COMMIT WORK RELEASE;
    exit(EXIT_SUCCESS);
    4. 다음은 실행한 결과 입니다.
    첫번째 sample :
    Connected to ORACLE as user: SCOTT
    G'day.
    두번째 sample :
    Connected to ORACLE as user: SCOTT
    File length is: 10
    G'day.

  • NoSQL + SQL LOBs

    Hello, everyone!
    I have one question about Oracle NoSQL. It can store huge ammount of data and operate it using oracle.kv.lob package.
    It can also translate data to a common relational Oracle Database 11gR2 using External Tables mechanism.
    But combining these two mechanisms getting me a big trouble.
    In ideal way I want to write:
    SELECT PK, oracle_BLOB
    FROM NoSQL_ExternalTable
    WHERE PK in (<list of integer>);
    BUT (now difficult part begins)
    1)As documentation says, method toOracleLoaderFormat of Formatter interface returns String only. So you can not return unstructured data or especially 1GB of unstructured data in an ordinal way. The workaround is to use temporary files: unload NoSQL BLOB to a stream, write the stream to a temp file and then read this file using oracle BFILE locator. Yes, I encapsulated filewritting mechanism in toOracleLoaderFormat. But this method is slow, on kvlite database it takes 1:41 minutes to select 1,8 GB file and temp file is a really bottleneck.
    2) As far as I encapsulated filewritting mechanism in toOracleLoaderFormat function, every time preprocessor invokes this method, a new 1 GB file is created.
    And as long as NoSQL does full scan on its database using ETables, every SELECT results in ALL files extracted in temp directory.
    As a crutch I used another file with list of PK that I needed. It is taken to be that this file will have been formed BEFORE main SELECT procedes.
    So initially formatter function reads this file and then compares Key part of incoming KeyValueVersion variable with contents of this file. If the Key is in list then extracting proceeds.
    For example, PK file contains 1000, 1001, 1003 and NoSQL DB contains recors with keys like
    exttab/1000/-/document/archive1000.zip
    exttab/9000/-/document/archive9000.zip
    Preprocessor invokes Formatter with parameter kvv (key part) = exttab/1000/-/document/archive1000.zip, Formatter parses key, extracts 1000.
    Then it reads PK file, finds record 1000 and puts huge 2GB archive to temp dir. When it doesn't find record 9000 it doesn't put a huge archive to temp dir.
    ==================================================================================
    Is there any idea how to perform seamlesly SELECT of BLOB (BFILE) from NoSQL to "SQL" database in a less complicated way and in acceptable time?
    ==================================================================================
    Edited by: 1004734 on May 8, 2013 3:26 PM

    Charles, sorry, I tried to send the file from my personal mail (mail.ru domain), but your mail is unroutable.
    By the way I tried to create eTable:
    CREATE TABLE nosql_data_blob_test (PK integer,
    docfilename varchar2(120),
    docdata blob)
    organization external
    (type oracle_loader
    default directory ext_tab
    access parameters
    (records delimited by newline
    preprocessor nosql_bin_dir:'nosql_stream'
    fields terminated by '|'
    PK CHAR(30),
    docfilename char(60)
    COLUMN TRANSFORMS (docdata FROM LOBFILE (docfilename) FROM (temp_dir) BLOB)
    location (ext_tab:'nosql_blob.dat'))
    PARALLEL;
    After setting all parameters (publishing, etc..) I tried SELECT and got error which in short sounds like Oracle can not see temp_dir but tries to look up ext_tab directory.
    But even when I manually copy the file from temp_dir to ext_tab I got another very strange error:
    ora-12801 error signaled in parallel query server P000
    ora-29913 error in executing odciexttablefetch callout
    ora-29400 data cartridge error
    KUP-04095 preprocessor command
    /home/oracle/kvhome/exttab/bin/nosql_stream encountered error
    "java.lang.IllegalStateException: Error of parsing line 1 of
    /home/oracle/kvhome/data/TEXT: content is not allowed in prolog.
    /home/oracle/kvhome/data/ is ext_tab directory
    /home/oracle/kvhome/exttab/bin/ is nosql_bin_dir directory
    TEXT is the file I tried to get as blob
    What am I doing wrong? May be preprocessor tries to parse TEXT file?
    I go holydays up to 12 may, see you that day.
    Edited by: Arsenikum on 09.05.2013 2:43

  • Get path and file name from Bfile

    Hi,
    I'm using Bfile to store images in a database. Is there a way to get the path and file name of the image from Bfile, because I need to pass that information into an image processing function.
    Many thanks.
    Sheldon

    Can you use FILEISOPEN in the DBMS_LOB package?
    See http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl03prg.htm#281893
    -- CJ

  • Use data set from a SqlDataSource as an input table for another query

    I have a ASP.net winforms app with C# code behind. I am trying to provide a forecasting function that would allow users to perform "what if" analysis on parts of the database without changing the underlying database. Currently this forecast works
    by taking the production schedule from a table and running it against the forecasting query. What I'm trying to accomplish is allowing the user to have a copy of the data in a gridview so they can edit it and see the differences between their schedule and
    the current.
    My first attempt involved having a SqlDataSource create a temporary table and populate it with data from the main database. This allows for the first part (giving the user a copy of the data set to manipulate without changing the original). I tried to create
    a second SQLDataSource and reference the temporary table but it is not valid and appears that the temp table only exists in the session called by the first SqlDataSource. 
    Currently the first data source looks like this
    CREATE TABLE #mastersched(
    product [char](16) NULL,
    ,date [datetime] NULL,
    INSERT INTO #mastersched
    product
    ,date
     select  
    product
    ,date
           from (Main database table);
    select  
    product
    ,date
    from #mastersched
    I need to use the table #mastersched in a join statement within the forecasting query to return another dataset to be displayed either in a gridview, chart, report, etc.

    Hello REIData,
    This issue is more regarding ASP.NET, I suggest you posting it to the suitable forum:
    http://forums.asp.net/
    There are ASP.NET experts who will help you better.
    Thanks for your understanding.                                       
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Text content from BFILE

    Dear friends,
    I am trying to get text content out of my BFILE(a pdf or doc
    file) how am i suppose to do it.
    Best Regards
    Sachin

    I am trying to get text content out of my BFILE(a pdf or doc
    file) how am i suppose to do it.You have to use the INSO Filter, wich create from pdf/doc/...
    files an html output which Intermedia Text then uses for
    indexing. See Documentation for details.
    Regards,
    Thomas

  • Download from BFILE problem

    Hello,
    I have the following problem:
    1. I can upload PDF files into BFILE(s) - in the DATA_PUMP_DIR (dba_directories table)
    2. The uploaded file can be opened/viewed with Adobe Acrobat Reader.
    3. I use a stored procedure do download the PDF files from my browser.
    4. the download works ok but the file can no longer be opened/viewed using Adobe Acrobat Reader.
    5. I did a hex compare of 2 pdf files (the uploaded file and the downloaded file) and I think it is a CR vs CRLF conversion problem.
    I am using Oracle 10g XE on a Linux box and Windows as a client. The upload/download is part of a APEX application.
    This is the code used to download the BFILE:
    Note: v_mime is set to 'application/pdf'.
            x_bfile := BFILENAME ('DATA_PUMP_DIR', p_file);
            DBMS_LOB.fileopen (x_bfile, DBMS_LOB.LOB_READONLY);
            -- 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 );
            -- the filename will be used by the browser if the users does a save as
            htp.p('Content-Disposition:  attachment; filename="'||substr(v_file_name,instr(v_file_name,'/')+1)|| '"');
            -- close the headers
            owa_util.http_header_close;
            BEGIN
                LOOP
                    DBMS_LOB.READ (x_bfile,
                                   n_size,
                                   n_pos,
                                   x_buffer);
                    HTP.prn (UTL_RAW.cast_to_varchar2 (x_buffer));
                    -- increment number of bytes read
                    n_pos := n_pos + n_size;
                END LOOP;
            EXCEPTION
                WHEN NO_DATA_FOUND THEN
                    NULL;
            END;Any suggestions?
    Thanks,
    Catalin Florean.

    You could try using wpg_docload.download_file instead of htp.prn.
    Here is part of the procedure I use for downloading MP3 files from BFILES:
                    owa_util.http_header_close;
                    dbms_lob.createTemporary(TBlob, true);  
                    dbms_lob.open(Lob_loc, dbms_lob.file_readonly);
                    dbms_lob.loadfromfile( TBlob, Lob_loc, dbms_lob.getlength(Lob_loc) );
                    dbms_lob.fileclose(Lob_loc);
                    -- download the BLOB           
                    wpg_docload.download_file( TBlob );    
                    dbms_lob.freeTemporary( TBlob );You would replace my Lob_loc variable with your x_bfile.

  • How can I recover BFILE images from a table?

    I`m a Spanish student, so excuse me for my poor english.
    I have used LOB objects to insert images into some tables of a DataBase. However, I have tried to recover the inserted images to put those into a Developer 6 Form, and I haven4t done it.
    ?Have I need an specific procedure?
    ?Is There some option in Developer 6 to do it easily?
    Please, help me.

    If you have access to a PC I believe - if memory serves me correctly - that the free download SubRip can rip the highlight overlays back to graphics files from the Menu VOBs
    There is a subtitle ripping program for Mac - D-Subtitler - which may do the same job but I have never found it to be as good at ripping stuff as SubRip.
    I guess the only other way is if they are not too complex is to recreate the overlays in Photoshop using frame grabs for reference?

  • Migration from RAW LONG to BFILE

    As part of our next release, we are looking at modifying the way we currently store image data. The current table has a RAW LONG column, and i want to move to external storage BLOBs. The new table will be in a different schema.
    I believe I can covert the RAW column to BLOB, but that doesn't solve the external problem.
    AT a high level, it seems like I will need to do the following:
    - Go through the current rows and create an external image
    - Reload all of the images into new table with BFILE column pointing to new image location
    Anyone have any recommendations as to the steps I may need to perform??
    _mike
    Edited by: nibeck on Apr 22, 2009 2:49 PM
    Edited by: nibeck on Apr 22, 2009 2:49 PM

    take a look at this doc...
    http://www.stanford.edu/dept/itss/docs/oracle/10g/win.101/b10118/o4o00288.htm

  • Selecting from BFILE column

    Hi,
    I have a database column with BLOB type.
    sql > desc FAX_SEND
    Name Null? Type
    FILE_FAX_NAME VARCHAR2(50)
    FILE_FAX_PICTURE BLOB
    INSERT_DATE DATE
    I want to know if there is a value in the file column.
    sql > select insert_date,FILE_FAX_PICTURE from FAX_SEND
    SP2-0678: Column or attribute type can not be displayed by SQL*Plus
    How can i know that via sqlplus ?
    Thanks

    Hi,
    I'm not sure I understand the problem.
    You can use column names in a INSERT and UPDATE statements. for example:
    UPDATE  my_table
    SET     column_3 = x
    ,       column_4 = column_2 + column_3;When you use a column name to the right of the "=" sign, it always refers to the old value.
    In the 3rd line of the example above, column_4 is set to the old value of column_2 plus the old value of column_3, not the new value (x) that was given to column_3 in the 2nd line.
    If you have a problem, post
    (1) a little sample data (three ros, maybe) before UPDATE, and
    (2) what those same rows should be after the UPDATE,
    (3) explanation, (such as "I want to add the parameter :amt to column_5 and subtract :amt from column_6.")

Maybe you are looking for

  • Follow-up Action at UD-QM

    Dear All,   I want to implement follow-up action at Usage Decision, I have done the set up in Selected set for UD, Where  to declare the Mail IDs of the concern person? Please guide me. Regards, Neel

  • Interactive script editor: read values of answers into non-branching action

    Dear all, When we develop a new interactive script, I would like to read the value of the answers into a non-branching action. For examle: Are you ill? yes/no If no --> are you staying on another addres then [customer_adres]? yes/no if no --> please

  • Formatting Media Card

    I am trying to use a Media card I used in my last (non-Blackberry) phone.  The phone shows that the card has been inserted, but says "Media Card cannot be read.  Verify that the memory card is formatted."  I followed the instructions on KB10527, but

  • Problem rating multiple photos

    I used to be able to select multiple photos and assign a rating. Yesterday it stopped allowing me to do that. If I select multiple photos only the one highlighted vice all selected gets the rating. Any way to get it to go back to allowing multiple im

  • Outlook invitations have incorrect date

    Hope someone can help, when I create meeting rooms and send out the invitations to all participants the time and date of the 'event' is displayed correctly in the email message generated by Adobe Connect Pro, but if I want to send out a calendar remi