Dbms_lob-replace

I have a clob database field and I want to replace every occurence of a char with another one(for ex. all 'a's to 'b's). There is not a repalce function in dbms_lob package and I want to know if there is a practical way of doing this.
Thanks a lot.

It's not ideal but as you're looking for chunks of text this is probably the only way.
(1) Create a temporary LOB.
(2) Use DBMS_LOB.INSTR() to find "dangeous HTML", however you define that.
(3) Use DBMS_LOB.SUBSTR() and DBMS_LOB.WRITEAPPEND() to copy the safe HTML to the temporary lob.
(4) Overwrite the CLOB with the temporary LOB.
There may be smarter ways of doing this in 10g with regular expressions, but without knowing more about your scenario I wouldn't like to comment further.
Cheers, APC

Similar Messages

  • Problem with DBMS_LOB.

    Hi, I am working with Oracle XE, I created a table with the following structure:
    CREATE TABLE "HR". EMPLOYEE_DOCUMENTS "
    "NUM_DOCUMENS" ENABLE NUMBER NOT NULL,
    "EMPLOYEE_COD" NUMBER (6.0) NOT NULL ENABLE,
    "TIPO_DOCUMENTO" VARCHAR2 (12 BYTE) NOT NULL ENABLE,
    "GENERADO_EL" DATE NOT NULL ENABLE,
    "DOCUMENTO_BLOB" BLOB,
    "DOCS8_CLOBS" CLOB,
    CONSTRAINT "EMPLOYEE_DOCUMENTS_PK" PRIMARY KEY ( "NUM_DOCUMENS")
    In the field CLOB stored as a text as follows:
    A person who carries the card. # for the use of the credential # pursued by the law.
    With DBMS_LOB, replacing the characters # content in the field CLOB by the value 1306958172, but the text that remains the last # concatenates and not get results like this:
    A person who carries the card. 1306958172 for the use of the credential 1306958172 pur
    One more question, as can assign field contents CLOb the type BLOB field to save as a Word document, an example please.
    Tahnk.
    Roberto.

    In that place of my Store Procedure:
    declare
    clobs1 CLOB;
    clobs2 CLOB;
    BLOBS blob;
    clobs_aux CLOB;
    valor number;
    cadena varchar2(4000);
    nposicion number;
    ncontar number:=1;
    begin
    select docs8_clobs, documento_blob into clobs1,blobs
    from hr.EMPLOYEE_DOCUMENTS
    where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
    valor:=DBMS_LOB.INSTR(CLOBS1,'#',1,ncontar);
    clobs_aux:=clobs1;
    while valor<>0 loop
    nposicion:=valor+1;
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(VALOR));
    clobs2:=DBMS_LOB.SUBSTR(clobs_aux,valor-1,1);
    clobs2:=clobs2||' '||to_clob('1306958172');
    clobs2:=clobs2||' '||DBMS_LOB.SUBSTR(clobs_aux,nposicion,nposicion);
    CLOBS_AUX:=CLOBS2;
    if ncontar>=1 then
    update hr.EMPLOYEE_DOCUMENTS
    set docs8_clobs=clobs_aux
    where num_documens=12812;
    commit;
    end if;
    --Recuperar campo CLOB actualizado.
    select docs8_clobs, documento_blob into clobs1,blobs
    from hr.EMPLOYEE_DOCUMENTS
    where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
    CLOBS_AUX:=CLOBS1;
    valor:=DBMS_LOB.INSTR(CLOBS_AUX,'#',1,ncontar);
    ncontar:=ncontar+1;
    end loop;
    end;
    Roberto.

  • Changes to xml data in clob

    Hi,
    I have a table with xml_data in long raw form , i am converting the data in long raw to clob this process is working fine .
    but later i need to make changes to the xml_data in the clob , when the xml data is small the changes occur but in case of huge xml data the process gets hanged . I am using dbms_lob.instr , dbms_lob.substr function and a procedure for replace as there is not built in dbms_lob.replace function.....
    can anyone plzzzzzzzzz help me out with the same.......... its urgent
    Message was edited by:
    user500620

    Thank you, Kamal. I am learning as I going along with the project : )
    I do understand the examples that you have provided me with.
    This is the table structure I query against. (table name audit_v3)
    (column : adt_xml_desc CLOB )
    select to_char(
    substr(a.adt_xml_desc,
    INSTR(a.adt_xml_desc, '<CONTACT_HISTORY>',1,1),
    INSTR(a.adt_xml_desc, '</CONTACT_HISTORY>',1,1)-INSTR(a.adt_xml_desc, '<CONTACT_HISTORY>',1,1)+18 )
    from audit_v3 a
    where a.adt_id = 7397337;
    The result that I get = <CONTACT_HISTORY><USER><USER_ID>W951FVK</USER_ID><FIRST_NAME>Krishna</FIRST_NAME><LAST_NAME>Rajamani</LAST_NAME></USER><CONSUMER><CONS_SEQ_NBR>0</CONS_SEQ_NBR></CONSUMER></CONTACT_HISTORY>
    Now I want to store it in a varchar2 variable and then pass it to the xmltype to get individual data values. This is where I am having issue with.
    1. Do I store the value above in a varchar2?
    2. Can I pass the variable into the xmltype?
    Thank you very much, Kamal.
    declare
    xml xmltype ;
    test1 varchar2(1000);
    begin
    select to_char(v.adt_xml_desc) into test1 from audit_v3 v where v.adt_id = 7397337;
    xml := xmltype('''' ||test1||'''');
    /* xml := xmltype('<EVENT>
    <SWTSUPDATE TYPE="1">
    <MEMBERID>9822598</MEMBERID>
    <DATETIME>Fri Jun 09 14:51:33 CDT 2006</DATETIME>
    <USERID>W951FVK</USERID>
    </SWTSUPDATE>
    <CONTACT_HISTORY>
    <USER>
    <USER_ID>W951FVK</USER_ID>
    <FIRST_NAME>Krishna</FIRST_NAME>
    <LAST_NAME>Rajamani</LAST_NAME>
    </USER>
    <CONSUMER>
    <CONS_SEQ_NBR>1387445</CONS_SEQ_NBR>
    <FIRST_NAME>SPRINGHOUSE</FIRST_NAME>
    <LAST_NAME>ELLIS</LAST_NAME>
    </CONSUMER>
    </CONTACT_HISTORY>
    </EVENT>') ;
    dbms_output.put_line(xml.extract('/EVENT/CONTACT_HISTORY/USER/LAST_NAME/text()').getStringVal()) ;
    end ;

  • Error in using DBMS_LOB Package

    Hi,
    I am attaching a PDF File through a database procedure as shown below
    create or replace procedure load_document(document_id in number, filename IN varchar2, doc_desc IN VARCHAR2, doc_type IN VARCHAR2) as
    f_lob bfile;
    b_lob blob;
    --document_name varchar2(30);
    --mime_type varchar2(30);
    document_name oea_documents.document_name%TYPE;
    mime_type oea_documents.document_mime_type%TYPE;
    dot_pos number;
    v_file_type VARCHAR2(10);
    begin
    -- Find the position of the dot ('.') located in the filename
    dot_pos := instr(filename,'.');
    -- Get the filename without extension and use it as image name
    document_name := substr(filename,1,dot_pos-1);
    -- Build the mime type . Retrieve the file extension and add it to 'image/'
    v_file_type := SUBSTR( filename, dot_pos+1, Length(Filename) );
    IF ( UPPER(v_file_type) IN ('JPG','JPEG','TIF','TIFF','GIF') ) THEN
    mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
    ELSIF ( UPPER(v_file_type) = 'PDF' ) THEN
    mime_type := 'application/pdf';
    ELSIF ( UPPER(v_file_type) = 'DOC' )THEN
    mime_type := 'application/msword';
    ELSIF ( UPPER( v_file_type) = 'XLS') THEN
    mime_type := 'application/ms-excel';
    ELSE
    mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
    END IF;
    insert into oea_documents (document_id,
    document_name,
    document_mime_type,
    document,
    document_description,
    document_type
    values(document_id, document_name, mime_type, empty_blob(),doc_desc,doc_type) return document into b_lob;
    -- /!\ Directory name has to be UpperCase !
    f_lob := bfilename('FILE_LOAD',filename);
    o_dset_test('5');
    dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
    o_dset_test('6');
    dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    FILE_LOAD is a folder on the database server(unix).
    I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.
    while executing this procedure I am getting the error ora-22288(Invalid file or directory).
    But this occurs randomly
    For instance i tried to attach a pdf file with the name cross.pdf ,it gave me the above error and when i renamed the file as Cross.pdf it attached successfully.
    The error comes whilke executing the statement dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
    Please guide on the above issue.

    Hi,
    Welcome to the forum!
    user1356624 wrote:
    f_lob := bfilename('FILE_LOAD',filename);
    FILE_LOAD is a folder on the database server(unix).
    I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.The first argument to BFILENAME is the name of a directory object, as found in the directory_name column of all_directories. That is not the same thing as a folder name, which is found in the directory_path column of all_directories. Look up [CREATE DIRECTORY|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5007.htm#sthref6211] in the SQL Language manual for a description of Oracle's directory objects.
    If you have problems with this, post the results of
    SELECT  *
    FROM    all_directories;It might also be useful to see the Oracle "CREATE DIRECTORY" command that was used.
    As you probably noticed, this site compresses white space by default.
    When you post code or results on this site, type these 6 characters:
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Aug 10, 2009 3:35 PM
    Added link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help in using dbms_lob.read

    I need to upload a file into an Oracle table into a Blob column. The file name along with the file contents are all in one BLOB column.
    Once that is done I need to read from the file and extract the file contents and load it into a staging table.
    File being uploaded is a *.CSV* file.
    E.g. Of the .CSV file is: ABC.csv file and its contents will look like:
    1,Hello,Nisha
    2,Hi,Ravi
    3,Bye, Rahul
    Etc…..
    Therefore the table containing the BLOB column will contain:
    File Creation_date
    ABC.csv 09/11/2009
    How can I read a file from the BLOB column and upload into a staging table?
    Final Staging table should look like:
    Record Number Greet Name
    1 Hello Nisha
    2 Hi Ravi
    3 Bye Rahul
    I think I am suppose to use dbms_lob.read, but I am not really sure how to use it. If there is any script, kindly mail me the same.
    Thanks....

    Nisha,
    Check this example (test) and see if it can be any help. I have utl_file and sqlldr
    First Method -- I loaded alert.log successfully and you can imagine how big this file can be (5MB in my test case)
    create table t1clob
    ( clob_text clob);
    CREATE OR REPLACE DIRECTORY DIR AS '/path_to_csv_file/;
    DECLARE
       clob_data   CLOB;
       clob_file   BFILE;
    BEGIN
       INSERT INTO t1clob
       VALUES (EMPTY_CLOB ())
       RETURNING clob_text INTO clob_data;
       clob_file   := BFILENAME ('DIR', ABC.csv');
       DBMS_LOB.fileopen (clob_file);
       DBMS_LOB.loadfromfile (clob_data,
                              clob_file,
                              DBMS_LOB.getlength (clob_file)
       DBMS_LOB.fileclose (clob_file);
       COMMIT;
    END;Second Method: Use of Sqlldr
    Example of controlfile
    LOAD DATA
    INFILE alert.log "STR '|\n'"
    REPLACE INTO  table t1clob
       clob_text char(30000000)
    )Hope this helps.

  • How to insert 10 files from a directory to database,can i use dbms_lob??

    Hii
    I want to load 10files in my local drive into a table...how to do this.I'm able to do this individually using dbms_lob.loadfromfile and bfil but ,I want to copy all the files i that drive at time to my table...Is there any way to do this..?

    Okay... Here is some sample code that will help you store the files in binary format into db tables.
    create table t_blob(bid integer, blbdata blob);
    select * from t_blob;
    create or replace directory ext_tab_dir as 'C:\Oracle\ExtTab_Dir';
    grant read, write on directory ext_tab_dir to priya;
    declare
          src_file bfile;
          dest_file blob;
          len_file pls_integer;
    begin
          src_file:=bfilename('EXT_TAB_DIR','XML.doc');
          insert into t_blob values(1,empty_blob()) returning blbdata into dest_file;
          select blbdata into dest_file
            from t_blob
           where bid=1 for update;
          dbms_lob.fileopen(src_file,dbms_lob.file_readonly);
          len_file:=dbms_lob.getlength(src_file);
          dbms_output.put_line(len_file);
          dbms_lob.loadfromfile(dest_file,src_file,len_file);
          update t_blob
             set blbdata = dest_file
           where bid = 1;
          dbms_lob.fileclose(src_file);
    end;
    /I haven't used the wrap utility yet, so not much hands on with it. I guess the wrap utility at the OS level. Not sure if it will work at SQL prompt.

  • Using dbms_lob to load image into table

    I am trying to load a set of images from my DB drive into a table. This works fine when I try to load only 1 record. If I try to load more than 1 record, first gets created but I get this error, and it doesn't load the images for the rest of them.
    ORA-22297:     warning: Open LOBs exist at transaction commit time
    Cause:     An attempt was made to commit a transaction with open LOBs at transaction commit time.
    Action:     This is just a warning. The transaction was commited successfully, but any domain or functional indexes on the open LOBs were not updated. You may want to rebuild those indexes.
    Am I missing something in the code that's needed?
    in_file UTL_FILE.FILE_TYPE;
    bf bfile;
    b blob;
    src_offset integer := 1;
    dest_offset integer := 1;
    CURSOR get_pics is select id from emp;
    BEGIN
    FOR x in get_pics LOOP
    BEGIN
    insert into stu_pic(id,student_picture)
    values(x.id,empty_blob()) returning student_picture into b;
    l_picture_uploaded := 'Y';
    bf := bfilename('INTERFACES',x.student_id || '.' || p_image_type);
    dbms_lob.fileopen(bf,dbms_lob.file_readonly);
    dbms_lob.open(b,dbms_lob.lob_readwrite);
    dbms_lob.loadBlobFromFile(b,bf,dbms_lob.lobmaxsize,dest_offset,src_offset);
    dbms_lob.close(b);
    dbms_lob.fileclose(bf);
    EXCEPTION when dup_val_on_index then null;
    END;
    END LOOP;
    END;

    There are two methods you can use.
    1. Create an external table with those images(BLOB column) and then use that external table to insert into another table.
    Demo as follows:
    This is my pdf files
    C:\Saubhik\Assembly\Books\Algorithm>dir *.pdf
    Volume in drive C has no label.
    Volume Serial Number is 6806-ABBD
    Directory of C:\Saubhik\Assembly\Books\Algorithm
    08/16/2009  02:11 PM         1,208,247 algorithms.pdf
    08/17/2009  01:05 PM        13,119,033 fci4all.com.Introduction_to_the
    d_Analysis_of_Algorithms.pdf
    09/04/2009  06:58 PM        30,375,002 sedgewick-algorithms.pdf
                   3 File(s)     44,702,282 bytes
                   0 Dir(s)   7,474,593,792 bytes free
    C:\Saubhik\Assembly\Books\Algorithm>This is my file with which I'll load the pdf files as BLOB
    C:\Saubhik\Assembly\Books\Algorithm>type mypdfs.txt
    Algorithms.pdf,algorithms.pdf
    Sedgewick-Algorithms.pdf,sedgewick-algorithms.pdf
    C:\Saubhik\Assembly\Books\Algorithm>Now the actual code
    SQL> /* This is my directory object */
    SQL> CREATE or REPLACE DIRECTORY saubhik AS 'C:\Saubhik\Assembly\Books\Algorithm';
    Directory created.
    SQL> /* Now my external table */
    SQL> /* This table contains two columns. 1.pdfname contains the name of the file
    DOC>   and 2.pdfFile is a BLOB column contains the actual pdf*/ 
    SQL> CREATE TABLE mypdf_external (pdfname VARCHAR2(50),pdfFile BLOB)
      2         ORGANIZATION EXTERNAL (
      3           TYPE ORACLE_LOADER
      4            DEFAULT DIRECTORY saubhik
      5            ACCESS PARAMETERS (
      6              RECORDS DELIMITED BY NEWLINE
      7              BADFILE saubhik:'lob_tab_%a_%p.bad'
      8              LOGFILE saubhik:'lob_tab_%a_%p.log'
      9              FIELDS TERMINATED BY ','
    10              MISSING FIELD VALUES ARE NULL
    11               (pdfname char(100),blob_file_name CHAR(100))
    12              COLUMN TRANSFORMS (pdfFile FROM lobfile(blob_file_name) FROM (saubhik) BLOB)
    13            )
    14            LOCATION('mypdfs.txt')
    15         )
    16         REJECT LIMIT UNLIMITED;
    Table created.
    SQL> SELECT pdfname,DBMS_LOB.getlength(pdfFile) pdfFileLength
      2  FROM   mypdf_external;
    PDFNAME                                            PDFFILELENGTH
    Algorithms.pdf                                           1208247
    Sedgewick-Algorithms.pdf                                30375002
    SQL> Now, you can use this table for any operation very easily. Even for your loading into another table!.
    2. Use of DBMS_LOB like this
    /* Loading a image Winter.jpg in the BLOB column as BLOB!*/
    DECLARE
      v_src_blob_locator BFILE := BFILENAME('SAUBHIK', 'Winter.jpg');
      v_amount_to_load   INTEGER := 4000;
      dest_lob_loc BLOB;
    BEGIN
      --Insert a empty row with id 1
      INSERT INTO test_my_blob_clob VALUES(1,EMPTY_BLOB(),EMPTY_CLOB())
       RETURNING BLOB_COL INTO dest_lob_loc;
      DBMS_LOB.open(v_src_blob_locator, DBMS_LOB.lob_readonly);
      v_amount_to_load := DBMS_LOB.getlength(v_src_blob_locator);
      DBMS_LOB.loadfromfile(dest_lob_loc, v_src_blob_locator, v_amount_to_load);
      DBMS_LOB.close(v_src_blob_locator);
      COMMIT;
    --id=1 is created with Winter.jpg populated in BLOB_COL and CLOB_COL is empty.  
    END;Now user this code to create a procedure with parameter and use that in loop.

  • Using DBMS_LOB.LOADCLOBFROMFILE

    Dear all,
    I got some difficulty in trying to use DBMS_LOB.LOADCLOBFROMFILE. Suppose I have this procedure that load an OS file into a CLOB and read, however I keep getting error saying that
    ERROR at line 1:
    ORA-22275: invalid LOB locator specified
    ORA-06512: at "SYS.DBMS_LOB", line 890
    ORA-06512: at "HR.SOME_PROC", line 14
    ORA-06512: at line 1This is the procedure:
    create or replace procedure some_proc is
    note_clob clob;
    note_bfile bfile;
    note_var varchar2(10000);
    warning int;
    dest_off int:=1;
    src_off int:=1;
    lang_ctx int:=0;
    amount int:=dbms_lob.lobmaxsize;
    begin
    note_clob:=empty_clob();
    note_bfile:=bfilename('TEMP_DIR','note.txt');
    dbms_lob.fileopen(note_bfile);
    dbms_lob.loadclobfromfile(note_clob,note_bfile,1000,dest_off,src_off,0,lang_ctx,warning);
    --dbms_lob.read(note_clob,amount,1,note_var);
    dbms_lob.fileclose(note_bfile);
    --dbms_output.put_line(note_var);
    end some_proc;
    /I comment out the part that reads and prints for debugging purpose. Could anybody point me out where did I do wrong on LOADCLOBFROMFILE?
    best regards,
    Val

    Specify below line before loading into target...
    DBMS_LOB.CREATETEMPORARY(note_clob,true);

  • Using DBMS_LOB.COPY - (ORA-22275)

    Hi All,
    I need to copy BLOB value from one table to another.
    For that i am using DBMS_LOB.COPY.
    I am not sure if this is the right approach. If not, can someone help me out.
    Mentioned below is my sample procedure:
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    select BLOB_DATA
    into v_blob_data_d
    from blob_test_dest -- My Destination Table
    where id = i_ID
    for update;
    select BLOB_DATA
    into v_blob_data_s
    from blob_test -- My Source Table
    where id = i_ID;
    DBMS_LOB.COPY(v_blob_data_d, v_blob_data_s, amt);
    o_OutputStatus := 0;
    o_OutputMessage := 'SUCCESS';
    EXCEPTION
    WHEN OTHERS THEN
    o_OutputStatus := -1;
    o_OutputMessage := 'Procedure ins_upd_blob Failed at step no:- '||v_ErrorFlag|| ' SQL ERROR:- '||SUBSTR(SQLERRM,1,100);
    END;
    After execution i am getting following error:
    ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
    Thanks,
    Srikanth

    how about using merge instead of dbms_lob package?
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2)
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    merge into blob_test_dest b1
    using (select id, blob_data from blob_test) b2
    on (b1.id = i_id and b1.id = b2.id)
    when not matched then insert(b1.id, b1.blob_data) values(b2.id,b2.blob_data)
    when matched then update set b1.blob_data = b2.blob_data;
    END;
    /

  • Using dbms_lob in trigger 10gR2

    Hello,
    I'm trying to read from a clob using dbms_lob in my trigger and assigning the value to a variable. My trigger is compiling fine, but it doesn't seem to be working.
    I'm using 10gR2. Am I misunderstanding how to read from/assign to a variable in a trigger?
    Line from trigger code:
    v_serial_start := dbms_lob.instr(:new.search_xml_clob,'serial=') + 8;
    Thanks,
    Mimi

    Here's a quick example that works fine for me....
    ME_XE?create table clobberin_tyme
      2  (
      3     some_column    number,
      4     variable_value number default 0,
      5     some_clob      clob default empty_clob()
      6  );
    Table created.
    Elapsed: 00:00:03.98
    ME_XE?
    ME_XE?
    ME_XE?create or replace trigger clobberin_tymeT01
      2  before insert or update on clobberin_tyme
      3  for each row
      4  declare
      5     v_serial_start    number;
      6  begin
      7
      8     v_serial_start       := dbms_lob.instr(:new.some_clob,'serial=') + 8;
      9
    10     :new.variable_value  := v_serial_start;
    11
    12  end;
    13  /
    Trigger created.
    Elapsed: 00:00:02.62
    ME_XE?
    ME_XE?
    ME_XE?insert into clobberin_tyme (some_column) values (1);
    1 row created.
    Elapsed: 00:00:00.31
    ME_XE?
    ME_XE?select * from clobberin_tyme;
           SOME_COLUMN     VARIABLE_VALUE SOME_CLOB
                     1                  8
    1 row selected.
    Elapsed: 00:00:00.17
    ME_XE?
    ME_XE?update clobberin_tyme
      2     set   some_column = 2,
      3           some_clob = 'hello world serial= coco puffs, i am cucu for them';
    1 row updated.
    Elapsed: 00:00:00.25
    ME_XE?
    ME_XE?select * from clobberin_tyme;
           SOME_COLUMN     VARIABLE_VALUE SOME_CLOB
                     2                 21 hello world serial= coco puffs, i am cucu for them
    1 row selected.
    Elapsed: 00:00:00.01

  • Dbms_lob.fileopen failed though utl_file.fgetattr works fine

    Hi ,
    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod.
    I am working on loading MS .doc into Oracle.
    I have created dir using following code:
    BEGIN
    EXECUTE IMMEDIATE
    'CREATE OR REPLACE DIRECTORY TEST_SN1 AS'||
    '''\\inecg-sdc11\XYZ_ABC2\DT-AUTOMATION\DUMMY_12LNEW''';
    END;
    I have verified the existence of file(Status.doc) using utl_file.fgetattr using the following code:
    DECLARE
    ex BOOLEAN;
    flen NUMBER;
    bsize NUMBER;
    BEGIN
    utl_file.fgetattr('TEST_SN1', 'Status.doc', ex, flen, bsize);
    IF ex THEN
    insert into test_msg values('File Exists');
    ELSE
    insert into test_msg values('File Does Not Exist');
    END IF;
    insert into test_msg values('File Length: ' || TO_CHAR(flen));
    insert into test_msg values('Block Size: ' || TO_CHAR(bsize));
    commit;
    END;
    the code succuessfully returns the msg 'File exists' along with the file length .
    I have also tried opening the file using utl_file and dbmc_lob package+
    SQL> DECLARE
    2 vInHandle utl_file.file_type;
    3 vNewLine VARCHAR2(250);
    4 BEGIN
    5 vInHandle:= utl_file.fopen('TEST_SN1', 'Status.doc', 'R');
    6 utl_file.fclose(vInHandle);
    7 END;
    8 /
    PL/SQL procedure successfully completed.
    But the following code still produces error ORA-22288:+
    This is what the output was:
    SQL> declare
    2 l_bfile bfile;
    3 begin
    4 l_bfile := bfilename( 'TEST_SN1', 'Status.doc' );
    5 dbms_lob.fileopen( l_bfile );
    6 dbms_lob.fileclose( l_bfile );
    7 end;
    8 /
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at line 5
    Even though the file exists and Oracle is able to identify the file, I cant figure out what is
    stopping my code to open that file.
    Please help me to figure out the problem.
    For more undertstanding ,You can also refer the my conversation with Tom Kyte at following link:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:636223754581#2815252100346024210
    Thanks a million tons!
    Regards
    Saurabh Nolakha,
    Bangalore

    Hi,
    Thanks for your quick response.
    The file Status.doc which I am trying to access is in remote server at path *\\inecg-sdc11\XYZ_ABC2\DT-AUTOMATION\DUMMY_12LNEW* .Though the path is not mapped to the WINDOWS system where Oracle is installed but I am able to access the file(open and read) from that system.
    Do you mean that I need to map the network drive to that system?*
    if yes, then why UTL_FILE is working perfectly?*
    Also, in my requirement, theres a high possibility that the path(of remote server) may change in future(if mapped).So ,is there any alternative for that?*
    Please provide your useful suggestions
    Regards
    Saurabh Nolakha

  • Error when DBMS_LOB.FILEOPEN , why ?

    Hi..
    I create a directory , example : ULLOA
    "create or replace directory ULLOA as 'c:\';"
    This path (c:\) are inside of the server..
    But , when execute the block pl/sql
    l_bfile := bfilename( 'ULLOA', 'setup.txt' );
    dbms_lob.fileopen( l_bfile );
    Obtain the next error :
    ERROR en línea 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 475
    ORA-06512: at line 9
    Why?
    Are correctly defined the path c:\
    Am working in Windows 2000 and my BBDD is Oracle9i
    Atte
    Hector
    PD : Sorry my english

    Thanks Kamal
    See my execution :
    SQL> create or replace directory ULLOA as 'c:\';
    Directory created.
    SQL> declare
    2 l_bfile BFILE ;
    3 begin
    4 l_bfile := bfilename( 'ULLOA', 'setup.txt' ); 5 dbms_lob.fileopen( l_bfile );
    6 end ;
    7 /
    declare
    *ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at line 5
    SQL>
    SQL> spool C:\setup.txt
    SQL> prompt Hi Kamal.txt
    Hi Kamal.txt
    SQL> spool off
    SQL>
    SQL> create or replace directory ULLOA as 'c:\';
    Directory created.
    SQL> declare
    2 l_bfile BFILE ;
    3 begin
    4 l_bfile := bfilename( 'ULLOA', 'setup.txt' ); 5 dbms_lob.fileopen( l_bfile );
    6 end ;
    7 /
    declare
    *ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at line 5
    I have error , but ...
    MY GREAT ERROR IS THAT EXECUTE COMMAND IN THE CLIENT TO HAVE ERROR , BUT RUNNING THE COMMAND IN THE SERVER , ALL IS OK..
    Sorry gentleman..
    And thanks all

  • Dbms_lob , where did my time go ?

    Hi all
    After using 10046 to identify the sql that is causing the slowness in a program “ less commits cause my program to go slower” i realised that i am missing something ,
    There was a lot of time missing in the tkprof file , and no sql or wait event allocate the missing time , so i put the following test case together in an attempt to understand where the time is going .
    Version of test database : 11.1.0.6.0
    Name of test database: stdby ( :-) used my standby database)
    Database non-default values
    #     Parameter     Value1
    1:     audit_file_dest     /u01/app/oracle/admin/stdby/adump
    2:     audit_trail     DB
    3:     compatible     11.1.0.0.0
    4:     control_files     /u01/app/oracle/oradata/stdby/control01.ctl
    5:     control_files     /u01/app/oracle/oradata/stdby/control02.ctl
    6:     control_files     /u01/app/oracle/oradata/stdby/control03.ctl
    7:     db_block_size     8192
    8:     db_domain     
    9:     db_name     stdby
    10:     db_recovery_file_dest     /u01/app/oracle/flash_recovery_area
    11:     db_recovery_file_dest_size     2147483648
    12:     diagnostic_dest     /u01/app/oracle
    13:     dispatchers     (PROTOCOL=TCP) (SERVICE=stdbyXDB)
    14:     memory_target     314572800
    15:     open_cursors     300
    16:     processes     150
    17:     remote_login_passwordfile     EXCLUSIVE
    18:     undo_tablespace     UNDOTBS1More accurately I used existing example from http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4084920819312
    I hope Tom does not mind .
    create table t ( x clob );
    create or replace procedure p( p_open_close in boolean default false,
                                     p_iters in number default 100 )
      as
          l_clob clob;
      begin
          insert into t (x) values ( empty_clob() )
          returning x into l_clob;
          if ( p_open_close )
          then
              dbms_lob.open( l_clob, dbms_lob.lob_readwrite );
          end if;
          for i in 1 .. p_iters
          loop
              dbms_lob.WriteAppend( l_clob, 5, 'abcde' );
          end loop;
          if ( p_open_close )
          then
        dbms_lob.close( l_clob );
    end if;
    commit;
    end;I did the tracing and the run of the pkg with this
    alter session set timed_statistics = true;
    alter session set max_dump_file_size = unlimited;
    alter session set tracefile_identifier = 'test_clob_commit';
    alter session set events '10046 trace name context forever, level 12';
    exec p(TRUE,20000);
    exitDid the tkprof of the 10046 trace file with
    tkprof stdby_ora_3656_test_clob_commit.trc stdby_ora_3656_test_clob_commit.trc.tkp sort=(prsela,exeela,fchela) aggregate=yes waits=yes sys=yesWith output of
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.02       0.02          0          0          0           0
    Execute      1     46.89     147.81      38915     235267     492471           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2     46.92     147.83      38915     235267     492471           1
    Misses in library cache during parse: 1
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2        0.00          0.00
      latch: shared pool                             24        0.05          0.07
      latch: row cache objects                        2        0.00          0.00
      log file sync                                   1        0.01          0.01
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse      117      0.11       0.10          0          0          2           0
    Execute    426      0.37       0.40          6          4          9           2
    Fetch      645      0.17       0.51         63       1507          0        1952
    total     1188      0.65       1.03         69       1511         11        1954
    Misses in library cache during parse: 22
    Misses in library cache during execute: 22
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                     19778        1.12         30.31
      direct path write                           19209        0.00          0.44
      direct path read                            19206        0.00          0.37
      log file switch completion                      8        0.20          0.70
      latch: cache buffers lru chain                  5        0.01          0.02
        3  user  SQL statements in session.
      424  internal SQL statements in session.
      427  SQL statements in session.And it’s here where the time is being lost.The time of the main pkg p(TRUE,2000) takes 147.83 sec, which is correct , but what is making this time up.
    From sorted trace file
    SQL ID : catnjk0zv6jz1
    BEGIN p(TRUE,20000); END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.02       0.02          0          0          0           0
    Execute      1     46.89     147.81      38915     235267     492471           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2     46.92     147.83      38915     235267     492471           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 81
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      latch: shared pool                             24        0.05          0.07
      latch: row cache objects                        2        0.00          0.00
      log file sync                                   1        0.01          0.01
      SQL*Net message to client                       1        0.00          0.00
      SQL*Net message from client                     1        0.00          0.00
    SQL ID : db78fxqxwxt7r
    select /*+ rule */ bucket, endpoint, col#, epvalue
    from
    histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket
    intresting , oracle is still using the rule hint in 11g ?
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.00       0.00          0          0          0           0
    Execute     98      0.05       0.05          0          0          0           0
    Fetch       98      0.04       0.17         28        294          0        1538
    total      199      0.10       0.22         28        294          0        1538
    Misses in library cache during parse: 0
    Optimizer mode: RULE
    Parsing user id: SYS   (recursive depth: 3)
    Rows     Row Source Operation
         20  SORT ORDER BY (cr=3 pr=1 pw=1 time=8 us cost=0 size=0 card=0)
         20   TABLE ACCESS CLUSTER HISTGRM$ (cr=3 pr=1 pw=1 time=11 us)
          1    INDEX UNIQUE SCAN I_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=0 us)(object id 408)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                        28        0.02          0.12
    SQL ID : 5n1fs4m2n2y0r
    select pos#,intcol#,col#,spare1,bo#,spare2,spare3
    from
    icol$ where obj#=:1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute     19      0.03       0.03          0          0          0           0
    Fetch       60      0.00       0.04          1        120          0          41
    total       81      0.04       0.08          1        120          0          41
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 2)
    Rows     Row Source Operation
          1  TABLE ACCESS BY INDEX ROWID ICOL$ (cr=4 pr=0 pw=0 time=0 us cost=2 size=54 card=2)
          1   INDEX RANGE SCAN I_ICOL1 (cr=3 pr=0 pw=0 time=0 us cost=1 size=0 card=2)(object id 42)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         1        0.04          0.04None of the parse , execute ,fetch and wait times makes up the 147.83 seconds.
    So i turned to oracles trcanlzr.sql that Carlos Sierra wrote and parsed the same trace file to find the offending sql .
    And it starts getting intrestting
    Trace Analyzer 11.2.6.2 Report: trcanlzr_75835.html
    stdby_ora_3656_test_clob_commit.trc (6970486 bytes)
    Total Trace Response Time: 148.901 secs.
    2009-MAY-03 20:03:51.771 (start of first db call in trace).
    2009-MAY-03 20:06:20.672 (end of last db call in trace).
    RESPONSE TIME SUMMARY
    ~~~~~~~~~~~~~~~~~~~~~
                                              pct of                  pct of                  pct of
                                    Time       total        Time       total        Time       total
    Response Time Component    (in secs)   resp time   (in secs)   resp time   (in secs)   resp time
                        CPU:      47.579       32.0%
              Non-idle Wait:       0.467        0.3%
         ET Unaccounted-for:     100.825       67.7%
           Total Elapsed(1):                             148.871      100.0%
                  Idle Wait:                               0.001        0.0%
         RT Unaccounted-for:                               0.029        0.0%
          Total Response(2):                                                     148.901      100.0%
    (1) Total Elapsed = "CPU" + "Non-Idle Wait" + "ET Unaccounted-for".
    (2) Total Response = "Total Elapsed Time" + "Idle Wait" + "RT Unaccounted-for".
    Total Accounted-for = "CPU" + "Non-Idle Wait" + "Idle Wait" = 148.872 secs.
    Total Unccounted-for = "ET Unaccounted-for" + "RT Unaccounted-for" = 100.854 secs.{font:Courier}
    {color:red}
    {size:19}100.825 seconds Wow , that is a lot 67.7 % of the time is not accounted for {size}
    {color}
    {font}
    I even used TVD$XTAT TriVaDis eXtended Tracefile Analysis Tool with the same conclution .
    {font:Courier}
    {color:green}
    {size:19}Looking at the raw trace file i see a lot of lines like this{size}
    {color}
    {font}
    WAIT #7: nam='direct path read' ela= 11 file number=4 first dba=355935 block cnt=1 obj#=71067 tim=1241337833498756
    WAIT #7: nam='direct path write' ela= 12 file number=4 first dba=355936 block cnt=1 obj#=71067 tim=1241337833499153
    WAIT #7: nam='db file sequential read' ela= 1095 file#=4 block#=399 blocks=1 obj#=71067 tim=1241337833501366{font:Courier}
    {color:green}
    {size:19}
    What is even more interesting is the sql for "PARSING IN CURSOR #7" is not in the trace file !
    The question is where is the time going or is the parser of the 10046 trace file just not putting the detail in ? How do i fix this, without speculating, if I do not know where the problem is ?
    I thought of doing a strace on the process . Where else can i look for my 100 sec
    Please point me in a direction where i can look for my 100,825 seconds as this is a test case with a production system that is loosing the same amount of time but with a lot more sql arround its dbms_lob.writeappend.
    {size}
    {color}
    {font}
    Edited by: user5174849 on 2009/05/16 11:17 PM

    user5174849 wrote:
    After using 10046 to identify the sql that is causing the slowness in a program “ less commits cause my program to go slower” i realised that i am missing something ,
    There was a lot of time missing in the tkprof file , and no sql or wait event allocate the missing time , so i put the following test case together in an attempt to understand where the time is going .
    Version of test database : 11.1.0.6.0
    What is even more interesting is the sql for "PARSING IN CURSOR #7" is not in the trace file !
    The question is where is the time going or is the parser of the 10046 trace file just not putting the detail in ? How do i fix this, without speculating, if I do not know where the problem is ?
    I thought of doing a strace on the process . Where else can i look for my 100 sec
    Please point me in a direction where i can look for my 100,825 seconds as this is a test case with a production system that is loosing the same amount of time but with a lot more sql arround its dbms_lob.writeappend.I guess that the separate cursor that is opened for the LOB operation is where the time is spent, and unfortunately this part is not very well exposed via the usual interfaces (V$SQL, 10046 trace file etc).
    You might want to read this post where Kerry identifies the offending SQL via V$OPEN_CURSOR: http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/
    The waits of this cursor #7 are quite likely rather relevant since they probably show you what the LOB operation is waiting for.
    The LOB is created with the default NOCACHE attribute therefore it's read and written using direct path operations.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • DBMS_LOB problem

    Hi,
    I am trying to load an xml file into my xmltable by using one user defined function called "getClobDocument".
    Here is the function source code.
    create or replace function getClobDocument(
    filename in varchar2,
    charset in varchar2 default NULL)
    return CLOB deterministic
    is
    file bfile := bfilename('XMLDIR',filename);
    charContent CLOB := ' ';
    targetFile bfile;
    lang_ctx number := DBMS_LOB.default_lang_ctx;
    charset_id number := 0;
    src_offset number := 1 ;
    dst_offset number := 1 ;
    warning number;
    begin
         dbms_output.put_line('file_name '||filename);
    if charset is not null then
    charset_id := NLS_CHARSET_ID(charset);
    end if;
    targetFile := file;
    dbms_output.put_line( DBMS_LOB.getLength(targetFile));
    DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    DBMS_LOB.LOADCLOBFROMFILE(charContent, targetFile,
    DBMS_LOB.getLength(targetFile), src_offset, dst_offset,
    charset_id, lang_ctx,warning);
    DBMS_LOB.fileclose(targetFile);
    dbms_output.put_line('char_content '||charContent);
    return charContent;
    end;
    I inserted an xml file called po.xml into the xml tabel .But i selected the data from xml table only one line is isplayed.
    The rest of the xml file is not inserted into the xml table.
    I am also getting the following error.
    "PL/SQL: numeric or value error: host bind array too small"
    can anybody tell the reason for it.
    cheers
    RRK

    Just for the sake of clarification ... What value are you specifying for p_dir variable?
    It should be a directory object created in the database.
    It can be created with a command like
    CREATE OR REPLACE DIRECTORY BFILE_DIR AS 'e:\middle-east\ssm';
    and the user who is going to call the function should have read access on this directory object which can be granted with a command like
    grant read on directory BFILE_DIR to FUNCTIONCALLINGUSER;
    I hope this helps with what you are trying
    Best Regards

  • DBMS_LOB.WRITEAPPEND Max buffer size exceeded

    Hello,
    I'm following this guide to create an index using Oracle Text:
    http://download.oracle.com/docs/cd/B19306_01/text.102/b14218/cdatadic.htm#i1006810
    So I wrote something like this:
    CREATE OR REPLACE PROCEDURE CREATE_INDEX(rid IN ROWID, tlob IN OUT NOCOPY CLOB)
    IS
    BEGIN
         DBMS_LOB.CREATETEMPORARY(tlob, TRUE);
         FOR c1 IN (SELECT ID_DOCUMENT FROM DOCUMENT WHERE rowid = rid)
         LOOP
              DBMS_LOB.WRITEAPPEND(tlob, LENGTH('<DOCUMENT>'), '<DOCUMENT>');
              DBMS_LOB.WRITEAPPEND(tlob, LENGTH('<DOCUMENT_TITLE>'), '<DOCUMENT_TITLE>');
              DBMS_LOB.WRITEAPPEND(tlob, LENGTH(NVL(c1.TITLE, ' ')), NVL(c1.TITLE, ' '));
              DBMS_LOB.WRITEAPPEND(tlob, LENGTH('</DOCUMENT_TITLE>'), '</DOCUMENT_TITLE>');
              DBMS_LOB.WRITEAPPEND(tlob, LENGTH('</DOCUMENT>'), '</DOCUMENT>');
              FOR c2 IN (SELECT TITRE,TEXTE FROM PAGE WHERE ID_DOCUMENT = c1.ID_DOCUMENT)
              LOOP
                   DBMS_LOB.WRITEAPPEND(tlob, LENGTH('<PAGE>'), '<PAGE>');
                   DBMS_LOB.WRITEAPPEND(tlob, LENGTH('<PAGE_TEXT>'), '<PAGE_TEXT>');
                   DBMS_LOB.WRITEAPPEND(tlob, LENGTH(NVL(c2.TEXTE, ' ')), NVL(c2.TEXTE, ' '));
                   DBMS_LOB.WRITEAPPEND(tlob, LENGTH('</PAGE_TEXT>'), '</PAGE_TEXT>');
                   DBMS_LOB.WRITEAPPEND(tlob, LENGTH('</PAGE>'), '</PAGE>');
              END LOOP;
         END LOOP;
    END;
    Issue is that some page text are bigger than 32767 bytes ! So I've got an INVALID_ARGVAL...
    I can't figure out how can I increase this buffer size and how to manage this issue ??
    Can you please help me :)
    Thank you,
    Ben
    Edited by: user10900283 on 9 févr. 2009 00:05

    Hi ben,
    I'm afraid, that doesn't help much, since you have obviously rewritten your procedure based on the advise given here.
    Coluld you please post your new procedure, as formatted SQL*Plus, embedded in {noformat}{noformat} tags, like this:SQL> CREATE OR REPLACE PROCEDURE create_index(rid IN ROWID,
    2 IS
    3 BEGIN
    4 dbms_lob.createtemporary(tlob, TRUE);
    5
    6 FOR c1 IN (SELECT id_document
    7 FROM document
    8 WHERE ROWID = rid)
    9 LOOP
    10 dbms_lob.writeappend(tlob, LENGTH('<DOCUMENT>'), '<DOCUMENT>');
    11 dbms_lob.writeappend(tlob, LENGTH('<DOCUMENT_TITLE>')
    12 ,'<DOCUMENT_TITLE>');
    13 dbms_lob.writeappend(tlob, LENGTH(nvl(c1.title, ' '))
    14 ,nvl(c1.title, ' '));
    15 dbms_lob.writeappend(tlob
    16 ,LENGTH('</DOCUMENT_TITLE>')
    17 ,'</DOCUMENT_TITLE>');
    18 dbms_lob.writeappend(tlob, LENGTH('</DOCUMENT>'), '</DOCUMENT>');
    19
    20 FOR c2 IN (SELECT titre, texte
    21 FROM page
    22 WHERE id_document = c1.id_document)
    23 LOOP
    24 dbms_lob.writeappend(tlob, LENGTH('<PAGE>'), '<PAGE>');
    25 dbms_lob.writeappend(tlob, LENGTH('<PAGE_TEXT>'), '<PAGE_TEXT>');
    26 dbms_lob.writeappend(tlob
    27 ,LENGTH(nvl(c2.texte, ' '))
    28 ,nvl(c2.texte, ' '));
    29 dbms_lob.writeappend(tlob, LENGTH('</PAGE_TEXT>'), '</PAGE_TEXT>')
    30 dbms_lob.writeappend(tlob, LENGTH('</PAGE>'), '</PAGE>');
    31 END LOOP;
    32 END LOOP;
    33 END;
    34 /
    Advarsel: Procedure er oprettet med kompileringsfejl.
    SQL>
    SQL> DECLARE
    2 rid ROWID;
    3 tlob CLOB;
    4 BEGIN
    5 rid := 'AAAy1wAAbAAANwsABZ';
    6 tlob := NULL;
    7 create_index(rid => rid, tlob => tlob);
    8 dbms_output.put_line('TLOB = ' || tlob); -- Not sure, you can do this?
    9 END;
    10 /
    create_index(rid => rid, tlob => tlob);
    FEJL i linie 7:
    ORA-06550: line 7, column 4:
    PLS-00905: object BRUGER.CREATE_INDEX is invalid
    ORA-06550: line 7, column 4:
    PL/SQL: Statement ignored
    SQL>

Maybe you are looking for

  • Creation of G/L account

    Hi Gurus, There is a requirement to create around 100+ G/L accounts. Txn FS15 & FS16 allow only to copy G/L accounts. Is there any prog / txn that will allow me to create G/L accounts at one go. rgds, nk

  • Corrupted Adobe X Standard installation

    I have just bought a Dell Windows 7 computer and have managed to corrupt the Adobe X Standard software that comes free with it.  I do not have an installation disk for this software or a backup - stupid I know!  I have run the repair installation and

  • DO we need to run Info Package every time before DTP Process to load the da

    Hi friends, IN BW 7.0 do we need to run every time the Info Package before DTP process to load the data into target or only one time we need to run the Info package then from that point onwards we need to run DTP process, Please let me know. basicall

  • Safar Hangs When Quitting

    Hi, Just recently, Safari hangs when I quit it. It then needs to be Force Quit. I use Safaricon for the GUI and I also use Uno, but I have for years and I have never experienced this hanging happening (so I think I can rule them out). I emptied the C

  • Is it okay if i leave the battery charges all the time or should i charge in a special way??

    is it okay if i leave the battery charges all the time or should i charge in a special way??