Copy a file in the oracle directory

I create a directory in statement create or replace directory john_test_dir as 'e:\jp_test\image_dir';

now, I need to copy an image in e:\jp_test\image_dir how can we do this?

by,.
jp_valapad

compile code below and post the error message

create or replace procedure proc_blob_inser is
l_blob blob.
l_bfile bfile.

Start
insert into tbl_blob_demo values (1, empty_blob ()) return DATA_BLOB in l_blob;
l_bfile: = BFILENAME ('JOHN_TEST_DIR', 'a.gif');
DBMS_LOB. FileOpen (l_bfile);
DBMS_LOB. LoadFromFile (l_blob, l_bfile, DBMS_LOB. GetLength (l_bfile));
DBMS_LOB. FileClose (l_bfile);
end;

The directory name must be in the capital

Published by: rajneesh kumar on November 24, 2008 16:19

Tags: Database

Similar Questions

  • How to *. ZIP has *. CSV file in the Oracle Directory?

    Hello! How are you doing guys?

    I have a question;

    How to Zip, a CSV file in the oracle directory?

    I use this method, but a mistake;

    Error; Invalid file operation, this line: utl_file.get_raw (v_arquivo_out, strbufferdd);

    ___The Script___

    v_arquivo_out: = utl_file.fopen ('ORA_DIR',-/ oracle/files/ORA/ORADIR /)

    "DOC. CSV', - file name

    "WORLD BANK");

    UTL_FILE.get_raw (v_arquivo_out, strbufferdd);  <-this line a mistake.

    strbufferdd: = UTL_COMPRESS.lz_compress (strbufferdd, 6);

    V_SDIRECTORY: = TO_CHAR (SYSDATE, ' DD_MM_YYYY_HH24.MI.) SS') | "_RETORNA. ZIP';

    psDsc_File: = v_sDirectory;

    v_arquivo_out2: = utl_file.fopen ('ORA_DIR',-/ oracle/files/ORA/ORADIR /)

    psDsc_File,

    'W');

    -as_zip.

    Utl_File.Put_Raw (v_arquivo_out2, strbufferdd);

    UTL_FILE.fclose (v_arquivo_out);

    UTL_FILE.fclose (v_arquivo_out2);

    ___End SCRIPT___

    Help me?

    Thank you to all the world, I have the solution;

    Please see the procedure;

    CREATE OR REPLACE PROCEDURE 'PR_RELAT_CSV '.

    (

    peCod_Prog in DOCUMENT. Type of Cod_Prog %,

    psDsc_File out varchar2

    )

    IS

    -variaveis para land

    v_arquivo_out utl_file.file_type;

    v_separator varchar2 (1): = "";

    v_sDirectory varchar2 (200);

    src_file BFILE.

    v_content BLOB;

    v_blob_len INTEGER.

    v_file UTL_FILE.file_type;

    v_buffer RAW (32767).

    v_amount directory: = 32767;

    v_pos INTEGER: = 1;

    BEGIN

    -DADOS PREENCHIDOS. ABAIXO, CRIAR PREENCHER E O LAND CSV

    V_SDIRECTORY: = TO_CHAR (SYSDATE, ' DD_MM_YYYY_HH24.MI.) SS') |

    ' _RETORNA. CSV';

    psDsc_File: = v_sDirectory;

    v_arquivo_out: = utl_file.fopen ('ORA_DIR',-/ oracle/files/oradir/ora /)

    psDsc_File,

    'W');

    cabecalho - write

    UTL_FILE.put_line (v_arquivo_out,

    "Organize" | v_separator | ' OPTIONS / Options'.

    v_separator | "AP" | v_separator | "CODE" |

    v_separator | 'Description of the PN | v_separator |

    "Station". v_separator | "Initial SN | v_separator |

    "Final SN | v_separator | 'Note ' | v_separator |

    'Pos ' | v_separator,

    (FALSE);

    -write linhas

    / * n : = 0 ; Contador * /.

    for rec_ (SELECT DISTINCT a.*, d.DSC_ITEM, e.COD_PN_MAT

    OF pcm_subestacao one

    LEFT JOIN (select b.cod_prog,

    c.num_arj,

    c.cod_itens,

    c.DSC_ITEM,

    c.COD_SEST_CONJ

    of pcm_desenho b

    INNER JOIN TABLE (fu_pcm_Combinar_Subestacao ('SYSTEM', b.cod_prog, b.num_arj, 0, null, null, null,)) c

    ON b.num_arj = c.num_arj

    and b.cod_prog = peCod_Prog) d

    ON a.cod_sest_conj = d.cod_sest_conj

    INNER JOIN pcm_mat_geral e

    ON e.cod_cemb_mat = a.cod_cemb_estc

    WHERE a.cod_prog = peCod_Prog

    loop of the order of a.num_arj, num_ns_i, num_ns_fn)

    / * n : = n + 1 ; Contador linhas * /.

    UTL_FILE.put_line (v_arquivo_out,

    Chr (34) | Chr (32) | rec_. NUM_ARJ | Chr (32) |

    Chr (34) | v_separator | Chr (34) | Chr (32) |

    rec_. DSC_ITEM | Chr (32) | Chr (34) | v_separator |

    Chr (34) | Chr (32) | rec_. COD_PN_SEST | Chr (32) |

    Chr (34) | v_separator | Chr (34) | Chr (32) |

    rec_. COD_CEMB_SEST | Chr (32) | Chr (34) |

    v_separator | Chr (34) | Chr (32) | rec_. DSC_PN_SEST |

    Chr (32) | Chr (34) | v_separator | Chr (34) |

    Chr (32) | rec_. COD_PN_MAT | Chr (32) | Chr (34) |

    v_separator | Chr (34) | Chr (32) | rec_. NUM_NS_I |

    Chr (32) | Chr (34) | v_separator | Chr (34) |

    Chr (32) | rec_. NUM_NS_FN | Chr (32) | Chr (34) |

    v_separator | Chr (34) | Chr (32) | rec_. DSC_OBS |

    Chr (32) | Chr (34) | v_separator | Chr (34) |

    Chr (32) | rec_. IND_POS | Chr (32) | Chr (34) |

    v_separator,

    (FALSE);

    end loop;

    UTL_FILE.fclose (v_arquivo_out);

    src_file: = BFILENAME ('ORA_DIR', psDsc_File);

    DBMS_LOB. FileOpen (src_file, dbms_lob.file_readonly);

    v_content: = utl_compress.lz_compress (src_file);

    v_blob_len: = DBMS_LOB.getlength (v_content);

    V_SDIRECTORY: = TO_CHAR (SYSDATE, ' DD_MM_YYYY_HH24.MI.) SS') |

    ' _RETORNA. CSV. ZIP';

    psDsc_File: = v_sDirectory;

    v_file: = utl_file.fopen ('ORA_DIR',-/ oracle/files/ORADIR/ORA /)

    psDsc_File,

    "WORLD BANK");

    Everything v_pos< v_blob_len="">

    DBMS_LOB. READ (v_content, v_amount, v_pos, v_buffer);

    UTL_FILE.put_raw (v_file, v_buffer, TRUE);

    v_pos: = v_pos + v_amount;

    END LOOP;

    UTL_FILE.fclose (v_file);

    EXCEPTION

    WHILE OTHERS THEN

    IF UTL_FILE.is_open (v_file) THEN

    UTL_FILE.fclose (v_file);

    END IF;

    LIFT;

    END PR_RELAT_CSV;

  • you have to copy a file to the root directory...

    IM using winscp to copy a netapp host utility, but it must be copied into the directory "root" and run it from that directory.

    Of course, using winscp, as I can only log in with a user account that I created in esx and not root. How to copy a file to the directory root?

    That's what the Solution says to do, does that mean that I have to copy the files in the root directory?

    ESX host utilities install script fails when it is called in 'su' environment

    Keywords: VMware ESX host utilities

    Solution

    Utilities of the host needs to the environment of the root, or by logging in as "root" or by switching to the root with su - environment

    Installing the utilities of the host in the root environment by running the command: su -

    You can use root - as long as you allow root ssh access - what is advised.

    Another alternative is to download Veeam FastSCP (free) and use it - with this you can authenticate with your user account non-root, but you can elevate your privileges specifying the root account. It is the method and the tool I use. You'll have to excuse my lack of terminology Linux

  • Save the file imported into oracle directory

    Hello.
    I'm on a project where I need to import a CSV (imported by using app APEX 4.0.1) in a specific oracle (complete and functional) table, and then save the file imported to the server.
    This part of the savings on the disk where I have my doubts.
    I know that I can use utl_file to write the file to an Oracle Directory, but that I have to open the blob (file) twice: one for import to the table and the other to write to the disk - because I want to just save if the file is successfully imported.

    Is there a more direct way to do this?

    Thank you
    vssantos

    NO, you could use an external program to C and then to write a wrapper for an Oracle to store the BLOB in an Oracle Directory. : http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:6379798216275

    Thank you

    Tony Miller
    Webster, TX

    Time passes fast like the wind, but the flies from fruits such as bananas.

    If you answer this question, please mark the thread as closed and give points where won...

  • Need to create files on unix (path of the oracle directory)

    Is it possible to create a file in the path of the oracle directory (in the unix folder).

    I use a dynamic procedure to create the external Tables, when the given model file is present, the procedure to create the external table, if the file is not present then it should create an empty file so that the corresponding external table would return zero (0) records. It must not fail.
    It must be through plsql not not using unix script.

    ..............

    UTL_FILE. FGETATTR (V_DIR_NAME, V_FILE_NAME, V_EXISTS, V_FILE_LENGTH, V_BLOCKSIZE);

    IF v_exists is FALSE
    -Create an empty file
    v_file_name: = empty_file;
    end if;

    -Create the table script that dynamically creates the external table

    v_sql: = 'CREATE TABLE' | V_RX_NAME | » ( '|| RTrim(v_cols,',_') |') ' ||
    'EXTERNAL ORGANISATION'.
    ' (TYPE ORACLE_LOADER ' |)
    "DEFAULT DIRECTORY" "|" " v_dir_name | '"'||
    'ACCESS SETTINGS'.
    ' (RECORDS DELIMITED BY THE NEW LINE ' |)
    ' LOAD WHEN (' |) RTrim(v_null_cols,'and_') |') ' ||
    "BADFILE"' | rec_mkt_name. SUBJECT_AREA_NAME | » _'|| rec_mkt_name. PARAM_NAME |'. BAD "' |
    ' DISCARDFILE "' | rec_mkt_name. SUBJECT_AREA_NAME | » _'|| rec_mkt_name. PARAM_NAME |'. THROW "' |
    "LOGFILE"'| " rec_mkt_name. SUBJECT_AREA_NAME | » _'|| rec_mkt_name. PARAM_NAME |'. JOURNAL "' |
    "' FIELDS TERMINATED BY" ~ "POSSIBLY PROVIDED BY" ' "' |
    "THE MISSING FIELD VALUES ARE NULL.
    ') LOCATION ("' |) V_FILE_NAME | " ') RELEASE UNLIMITED LIMIT ';
    GV_CURR_STEP: = v_sql;
    dbms_output.put_line (V_FILE_NAME);

    EXECUTE IMMEDIATE v_sql;
    ...........

    Try to use utl_file.fopen with 'W '.

  • Read the csv file in the Windows directory

    Hi all

    I have a requirement to fill an Oracle table with the CSV file in the Windows directory.
    Please help me to achieve this goal.

    Thank you.

    Published by: Amit1cs on June 4, 2013 08:46

    Then I suggest you mark this thread as answered and repost on the SQL/PLSQL forum. This forum is for Developer SQL related questions.

    Good luck in your task!

  • Files in the adump directory

    Hello

    In my database, I am not enabled auditing, but generate files in the adump directory.
    Here is the result of the setting see checking the
    SQL > see the parameter checking

    VALUE OF TYPE NAME
    ------------------------------------ ----------- ------------------------------
    audit_file_dest string/home/oracle/admin/orcl/adump
    audit_sys_operations boolean FALSE
    audit_syslog_level string
    AUDIT_TRAIL NONE string

    files in adump contains information of users who are connected as sysdba to database.
    Here I write the content inside files in the adump directory

    File /home/oracle/admin/orcl/adump/ora_31292.aud check
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64 bit Production
    With partitioning, OLAP and Data Mining options
    ORACLE_HOME = /home/oracle/product/10.2.0/Db_1
    Name of the system: Linux
    Name of the node: testserver.xxxxx.com
    News Release: 2.6.9 - 42.ELsmp
    Version: #1 SMP kills Aug 12 23:32:02 EDT 2006
    Machine: x86_64
    Name of the instance: orcl
    Redo thread mounted by this instance: 1
    Oracle process number: 173
    The Unix process PID: 31292, image: [email protected] (TNS V1 - V3)

    Kill Jun 2 14:37:21 2009
    ACTION: 'CONNECT'
    USER DATABASE: ' / '.
    PRIVILEGE: SYSDBA
    The CLIENT USER: oracle
    TERMINAL CLIENT: pts/5
    STATUS: 0


    How to disable these files generation? is there a specific reason for the generation of these files?

    Thank you
    Sandeep

    Some operations are always checked. See http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm#i1007559

  • an error occurred trying to rename a file in the destination directory code 5

    When I try the installed software on this time its error getting
    ; an error occurred trying to rename a file in the destination directory code 5

    Hi Sissi,

    1. What is the full error message do you get?

    2. This only happens when you try to install a particular program?

    3. using the administrator account?

    Step 1:

    You can try to take ownership of the file or the folder and check.

    How to capture a file or a folder in Windows

    Step 2:

    I also suggest you temporarily disable the antivirus software third and firewall on the computer and check to see if that fixes the problem.

    If disabling the antivirus software solves the problem, you may need to configure the settings of the antivirus as a result program. Please contact the software vendor for assistance in this regard.

    Note: Make sure that you enable the antivirus software, other security and firewall after the test programs.

  • When you copy a file in the same folder, is it possible to choose where "copy of" add original file name?

    When you copy a file in the same folder, is it possible to choose where "copy of" add original file name?

    Someone has an idea?

    No, it is not possible.

  • reproductive Extender invalid files in the installation directory - how to correct?

    My computer Guard stops. When it restarts, it displays a message 'invalid or missing files in the installation directory. Please reinstall Extender Player". How can I fix it?

    Hello

    1. have you done any change in software on the computer lately?
    2. are you able to boot in safe mode?
    3. do you have the Extender player installed on your computer?
    If so have you tried to re - install?
     

    Method 1.
    If you are able to boot to the desktop then disable automatic reboot.

    My computer properties > Advanced tab > startup and recovery settings > uncheck automatically restart.
     

    Method 2.
    Check to see if the problem exists in Safe Mode, if the computer works as expected in mode without failure, then we can solve the problem in the clean boot state.

    Note: Configure the computer to start in the State of clean boot to Safe Mode and check.
    a. refer to the article below for the procedure safe mode in Windows XP
    A description of the options to start in Windows XP Mode
    http://support.Microsoft.com/kb/315222
     
    b. you need to perform a clean boot to find the program that is causing and then disable or remove.
    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353/en-us
    Note: When you are finished troubleshooting, follow the steps as explained in the article to reset the computer to start as usual.

    I hope this helps.
  • Illustrator crashes when saving files in the default directory not in Mac OS 10.10 or OS 10.11. What is the solution?

    Illustrator crashes when saving files in the default directory not in Mac OS 10.10 or OS 10.11. What is the solution?

    There is no solution.

    If that is your only question, you should be happy.

    El Capitan Yosemite and CS5 are not compatible. For some people it can run more or less, for others not so much.

  • Hi, I have the latest version of lightroom. It works fine until last night when I tried to import some files in lightroom. It will come out with a message "could not copy a file at the location requested. (113)

    Hi could someone help me with this problem.

    I tried to import pictures to destination Macintosh HD or my external hard drive but it continue to go out with the same message "could not copy a file at the location requested. (114) items 1-100: articles 101-114.

    Interestingly, it was working fine up until yesterday.

    I tried restarting computer, I have the latest version of lightroom, I use Mac Os x Yosemite 10.10.4

    Thank you very much

    Hi josepht,.

    Looks like your destination folder does not have a full read and write permissions.

    Try to set the destination as a specific folder that contains all the permissions on your local or external drive, then, check.

    Kind regards

    Claes

  • Could not copy a file at the location requested

    I used 4 LR several years but now I can't import my files to LR - "some import operations were not performed. Failed to copy a file to the requested location. »

    I can't fix this annoyance, I'm sorry.

    Well, then I suggest that there is cut here... you do not check the folder where the picture is supposed to be copied, you checked another folder...

  • Could not copy a file at the location requested. Mac OS 10, Version 10.10 [1].  I JUST bought this new macbook pro and Lightroom installed, imported 2 lots of pictures, but all of a sudden he kept denying my imports with "could not read the file" or "coul

    Could not copy a file at the location requested. Mac OS 10, Version 10.10 [1].

    I JUST bought this new macbook pro and Lightroom installed, imported 2 lots of pictures, but all of a sudden he kept denying my imports with "could not read the file" or "couldn't copy file at the location requested.  Help, please!

    Your use of the word "files" (in the plural) still makes me believe that you have not checked the permissions on the folder that is appropriate (in the singular).

    You must determine the Destination of the Lightroom Import dialog window Panel and see which folder Lightroom is really tr6ing to copy photos in (which may have been accidentally changed and is not what you may have used in the past) and change the permissions to write to this folder.

  • I can't import pictures from a card file or anything like that.  I get "could not copy a file at the location requested.  It's never happened before.

    I can't import pictures from a card file or anything like that.  I get "could not copy a file at the location requested.  I've never had this happen before.  I use a MacBook Pro

    well, I understood my question, maybe the same thing for you...    The catalogue was somehow the problem, I created a new catalog and everything works well again.  I assumed that the catalog has been damaged during the import failed because the network connection.   hope that helps

Maybe you are looking for

  • iTunes does not search device, can it?

    OK, I kinda a stupid question, but I was not able to find a simple answer so far. I just deleted my Mac and do a clean install of El Capitan.  My music is stored on an iPad (IOS 7.1) and he plays very well, but when I try to use the button 'Search' a

  • Reset the Apple ID when the phone user changing

    I gave my iPhone 4 to my girfriend with his SIM inside. I did a reset and restore from his Mac using the backup of the phone, she lost, but he always preferred my apple not his ID. How can I reset that please? Thank you

  • Can't see the two extenders on mywifiext

    Just bought an EX6100 extension. Before this purchase, I was able to open in www.mywifiext.net my previously purcahsed EX7000 Extender. Now I can't open the EX7000 in mywifi only the EX6000. That said I can't manage the EX7000 or make updates to ot a

  • Windows security updates do not work!

    This happened a few months previously and to Microsoft tech support sent me a batch file for restore and restart the updates. I did not now and can't remember where they would go if I googled them. Support Tech does not answer my emails, so I hope so

  • Can my aspire am3470-uc30p upgrade gpu?

    Can my aspire am3470-uc30p upgrade gpu?