Create directory from procedure using IN parameter-Directory name with path

Hi,
I wrote a procedure which takes directory name(C:\temp) as IN parameter and create oracle directory using EXECUTE IMMEDIATE by the procedure. Proc compiled fine but when i try to execute it (exec prc_lx_e_m_fund_activty ('C:\interface','test1.txt','20040102') , i am getting the following error with the execute immediate statement mentioned below.
create or replace
PROCEDURE prc_lx_e_m_fund_activty
i_output_dir IN VARCHAR2,
i_output_file_name IN VARCHAR2,
i_interface_date IN VARCHAR2
AS
EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY OUTPUT_PATH AS ' || ''''||i_output_dir||'''' ||';'; -- Where i_output_dir=C:\temp (I am passing this parameter as IN)
END
ORA-01481: invalid number format model
ORA-06512: at "DBO.PRC_LX_E_M_FUND_ACTIVTY", line 326
ORA-00911: invalid character
ORA-06512: at line 10
Process exited.
Regards,
Nagarjun.

You don't need to put it in a string first. Your actual problem was that you included a ";" on the end of your statement which you don't require with execute immediate.
This would do the job...
EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY OUTPUT_PATH AS '''||i_output_dir||'''';or this (if you are on 10g upwards)
EXECUTE IMMEDIATE q'[CREATE OR REPLACE DIRECTORY OUTPUT_PATH AS ''||i_output_dir||'']';However, I would seriously question why you are creating directories dynamically in code.
The purpose of creating directories and granting permission to read and/or write to them is to maintain security over which users can access various places on the file system. If you give this flexibility of creating directories to users then effectively they can kill your database server and/or hack into information that they shouldn't.

Similar Messages

  • Creating new flat file using TextEdit w/specified name and path

    Hi all,
    I am working on an Applescript to create a blank new plain text file (in /tmp with a unique filename derived from today's date and time) and am missing something 'cause I keep getting an error message.
    Here's the code:
    <pre class=command>
    set Today to (do shell script "/bin/date +%Y%m%d%H%M%S") as string
    set DefaultFilename to (Today & "TMP.txt") as text
    set TMPpath to "/tmp/" as text
    set TMPFile to (TMPpath & DefaultFilename)
    tell application "TextEdit"
    set NewDoc to make new document with properties {name:DefaultFilename, path:TMPpath}
    end tell
    </pre>
    When I run the above code snippet I get the Applescript error message:
    TextEdit got an error: NSArgumentsWrongScriptError
    I understand that the properties listed in the make command should be a record, and that the individual properties comprising the record should each be text.
    What am I missing here? Something obvious I suspect.
    Any ideas would be greatly appreciated!
    Ed

    You're trying to use Unix-style paths for a Cocoa app, and that won't work.
    You need to use Mac-style paths, that is, colon-delimited, not unix-style (slash-delimited) paths.
    <pre class=command> set Today to (do shell script "/bin/date +%Y%m%d%H%M%S") as string
    set DefaultFilename to (Today & "TMP.txt") as text
    set TMPpath to ":private:tmp:" as text
    set TMPFile to (TMPpath & DefaultFilename)
    tell application "TextEdit"
    set NewDoc to make new document with properties {name:DefaultFilename, path:TMPpath}
    end tell</pre>
    A slightly better solution is to use the path to command rather than a hard-coded path. path to temporary items will give you the path to the current OS temporary file directory, which is more reliable than hard-coded strings, especially since non-English versions of the OS mght not use the same path names.
    <pre class=command> set TMPpath to path to temporary items as text</pre>

  • How to create data_block from procedure ?

    hi all
    can anyone to help me :
    how to create data_block from procedure ?
    i want to join 2 or 3 table and use order by
    then show some field in my form
    i can not use view because order by can not use in view
    please send sample code for this procedure
    thanks.

    1) >i can not use view because order by can not use in view
    SQL>create or replace view V_test as
      2  select * from (
      3  select 1 id from dual union
      4  select 2 id from dual union
      5  select 3 id from dual union
      6  select 4 id from dual union
      7  select 5 id from dual union
      8  select 6 id from dual ) t
      9  order by t.id
    10  /
    View created.
    SQL>select * from v_test;
            ID
             1
             2
             3
             4
             5
             6
    6 rows selected.2). >how to create data_block from procedure?
    You must create procedure and use ref cursor.

  • How do i use my own domain name with creative cloud?

    how do i use my own domain name with creative cloud?
    i don't want to post web pages from behance.net. i want to use the domain name i have for my material. is there a hosting service for this? if not, can someone give me some pointers so I can publish?
    thanks!!
    Lori

    http://forums.adobe.com/community/behance is where you would ask about publishing to "something else" from that program
    I use OLD Dreamweaver, and upload my HTML with an FTP program to my own web site... I will GUESS you can do that, if you can save HTML to your hard drive to then be able to upload to your web site

  • I have a new ipod and when I sign in to Words with Friends it says that user name is already in use. How can I continue using the same user name with a different ipod?

    I have a new ipod and added all my apps to it. When I sign in to Words with Friends it says that "user name is already in use" because it is linked to my old ipod. How can I use the same user name with my new ipod?

    Was the iPod setup via iTunes on this computer?
    Setup via wifi?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    Do the songs play in iTunes?           
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod        
    Try syncing using the manual method                 

  • Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File - Export - Album name with number).

    Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File -> Export -> Album name with number).
    Exporting a single Event retains the Event name which is what I'd expect. But highlighting more than one event and exporting it renames the images to Events 001.JPG, Event 002.JPG etc.
    I was recently on holidays and had all my events nicely split on Dad's computer but when I went to export it I couldn't retain any of this information. Now I have to replicate this all again on my computer.
    It wasn't possible to export the entire library as the external drive was fat32 format an I didn't want all of it. It would be nice to export a bunch of events to someone and have it retain the name.
    Does anyone have a work around or will this be fixed at some point by Apple?

    Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File -> Export -> Album name with number).
    Exporting a single Event retains the Event name which is what I'd expect. But highlighting more than one event and exporting it renames the images to Events 001.JPG, Event 002.JPG etc.
    I was recently on holidays and had all my events nicely split on Dad's computer but when I went to export it I couldn't retain any of this information. Now I have to replicate this all again on my computer.
    It wasn't possible to export the entire library as the external drive was fat32 format an I didn't want all of it. It would be nice to export a bunch of events to someone and have it retain the name.
    Does anyone have a work around or will this be fixed at some point by Apple?

  • How return parameter ref Cursor from procedure using dynamic SQL?

    I sorry, but i very need help.
    I using Oracle 8.0.6
    I need to return parameter of type ref Cursor from procedure.
    create or replace package PlanExp is
    type cursortype is ref cursor;
    procedure ShowPlan (cursorparam out
    cursortype.............);
    end PlanExp;
    create or replace package body PlanExp is
    procedure ShowPlan (cursorparam out cursortype,
    .............) Is
    sql_str varchar2(1000);
    sql_str_select varchar2(100);
    sql_str_from varchar2(100);
    sql_str_where varchar2(500);
    Return_Code integer;
    Num_Rows integer;
    cur_id_sel integer;
    tSum_Plan DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Ch DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Day DBMS_SQL.NUMBER_TABLE;
    begin
    /* calculating string variables ........... /*
    sql_str := 'select ' || sql_str_select ||
    'from ' || sql_str_from ||
    'where ' || sql_str_where ||
    'group by ' || sql_str_select;
    cur_id_sel := dbms_sql.open_cursor;
    dbms_sql.parse(cur_id_sel, sql_str, dbms_sql.native);
    dbms_sql.define_array(cur_id_sel, 1, tSum_Plan, 20, 1);
    dbms_sql.define_array(cur_id_sel, 2, tSum_Plan_Ch, 20, 1);
    dbms_sql.define_array(cur_id_sel, 3, tSum_Plan_Day, 20, 1);
    Return_Code := dbms_sql.execute(cur_id_sel);
    delete from TEMP_SHOWPLAN;
    Loop
    Num_Rows := dbms_sql.Fetch_Rows(cur_id_sel);
    dbms_sql.column_value(cur_id_sel, 1, tSum_Plan);
    dbms_sql.column_value(cur_id_sel, 2, tSum_Plan_Ch);
    dbms_sql.column_value(cur_id_sel, 3, tSum_Plan_Day);
    if Num_Rows = 0 then
    exit;
    end if;
    Exit When Num_Rows < 20;
    End Loop;
    dbms_sql.close_cursor(cur_id_sel);
    end;
    end PlanExp;
    How return cursor (cursorparam) from 3 dbms_sql.column_value-s ?

    I am using Oracle 8.1.7, so I don't know if this will work in
    8.0.6 or not:
    SQL> CREATE TABLE test
      2    (col1                    NUMBER,
      3     col2                    NUMBER,
      4     col3                    NUMBER)
      5  /
    Table created.
    SQL> INSERT INTO test
      2  VALUES (1,1,1)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (2,2,2)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (3,3,3)
      3  /
    1 row created.
    SQL> CREATE TABLE temp_showplan
      2    (tSum_Plan               NUMBER,
      3     tSum_Plan_Ch            NUMBER,
      4     tSum_Plan_Day           NUMBER)
      5  /
    Table created.
    SQL> EDIT planexp
    CREATE OR REPLACE PACKAGE PlanExp
    IS
      TYPE CursorType IS REF CURSOR;
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2);
    END PlanExp;
    CREATE OR REPLACE PACKAGE BODY PlanExp
    IS
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2)
      IS
        sql_str                VARCHAR2 (1000);
        cur_id_sel             INTEGER;
        return_code            INTEGER;
      BEGIN
        DELETE FROM temp_showplan;
        sql_str := 'INSERT INTO   temp_showplan '
               || ' SELECT '   || sql_str_select
               || ' FROM '     || sql_str_from
               || ' WHERE '    || sql_str_where;
        cur_id_sel := DBMS_SQL.OPEN_CURSOR;
        DBMS_SQL.PARSE (cur_id_sel, sql_str, DBMS_SQL.NATIVE);
        return_code := DBMS_SQL.EXECUTE (cur_id_sel);
        DBMS_SQL.CLOSE_CURSOR (cur_id_sel);
        OPEN cursorparam FOR SELECT * FROM temp_showplan;
      END ShowPlan;
    END PlanExp;
    SQL> START planexp
    Package created.
    Package body created.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC PlanExp.ShowPlan (:g_ref, 'col1, col2,
    col3', 'test', ' 1 = 1 ')
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    TSUM_PLAN TSUM_PLAN_CH TSUM_PLAN_DAY
             1            1             1
             2            2             2
             3            3             3

  • How to get return type as Table of Index by BINAR from Procedure using JDBC

    Hi,
    We have stored procedure which takes Varchar as input and rerurn muiltiple recored of type Table of index by BINARY
    We created the procedure with in a package, its header part like below:
    CREATE OR REPLACE PACKAGE emp_pkid_pkg
    AS
    TYPE r_emp IS RECORD ( employe_profile_id NUMBER
    , client_profile_id VARCHAR2(240)
    , email VARCHAR2(240)
    , terms_acp VARCHAR2(1)
    TYPE tp_emp_profile IS TABLE OF r_emp INDEX BY BINARY_INTEGER;
    PROCEDURE er_employe_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_emp_profile
    END emp_pkid_pkg;
    This procedure has body part, wich has origial business logic like below.
    CREATE OR REPLACE PACKAGE BODY emp_pkid_pkg
    AS
    PROCEDURE pr_customer_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_customer_provision_profile
    IS
    CURSOR c_emp_prov_instance ( c_guid employe_provision_instance.guid%TYPE )
    etc ...
    END emp_pkid_pkg;
    We could execute the below script from oracle client tool and get the response.
    DECLARE
    e_cust emp_pkid_pkg.tp_emp_profile;
    BEGIN
    emp_pkid_pkg.er_employe_prov_profile ( 'ef45t6543y98'
    , e_cust
    FOR i in e_cust.FIRST..e_cust.LAST LOOP
    DBMS_OUTPUT.PUT_LINE ( e_cust(i).employe_profile_id
    ||'#'|| e_cust(i).client_customer_id
    ||'#'|| e_cust(i).email
    ||'#'|| e_cust(i).term_acp);
    END LOOP;
    END;
    We have requirement to get the results from procedure usind JDBC callable statement call.
    We have tried to call the procedure via JDBC callable statement but it didn't work.
    We have constructed it like the following. It was throwing error "java.sql.SQLException: invalid column type: emp_pkid_pkg.tp_emp_profile
    CallableStatement cs2 = con.prepareCall("{call emp_pkid_pkg.er_employe_prov_profile(?,?)}");
    cs2.registerOutParameter(2, OracleTypes.CURSOR, emp_pkid_pkg.tp_emp_profile);
    cs2.setString(1,empId);
    Not sure whether I am doing the logic correctly. But i tryed with diff type. Still am getting same error like above.
    Please point me to the correct approach.
    Thanks
    Edited by: 921689 on 18-Mar-2012 17:20

    >
    We have requirement to get the results from procedure usind JDBC callable statement call.
    >
    Can't be done - the reason has nothing to do with JDBC so you are in the wrong forum.
    Repost in the PL/SQL forum and I can give you an example of what you have to do
    PL/SQL
    First the TYPEs you defined are PL/SQL types so can't be referenced outside PL/SQL; you need to define SQL types.
    Second you will need to use a procedure that returns a REF CURSOR or is a PIPELINED procedure. Since your procedure doesn't fall into either category you can't use it with JDBC to do what you want.
    If your query was a PIPELINED function then you could simply query it like it was a table. I have a PIPELINED function name 'get_emp' so this works.
    select * from table(get_emp(30));Post in the PL/SQL forum and I can give you the code for the procedure. I'm not going to clutter up this forum with inappropriate material.

  • Can't Create PDF "from file" using any MS Office files

    Acrobat 8.1.1 Pro. (OS = XP), as part of the CS3 premium edition.
    I can no longer get Acrobat to recognize any of the MS Office applications extensions (.doc, .ppt, etc...) for use with either Create PDF "From File" or when using the Combine Files feature to Merge or Package. The extensions are no longer even listed as an option in the dialog box, or in the Preference settings under "Convert to PDF".
    FYI- I can still use the PDF Maker functionality from within the MS Office application to create a PDF.
    Any Idea what could have happened, or more importantly how to fix?
    ***Update***
    I have re-installed the Acrobat 8 application, and the problem still exists.
    I'm truly puzzled.

    I get this with my PC and I ran detect-repair and reinstalled. Some PDF's I can open and other's I cannot. I can send the email to a cohort and they can open fine.
    "Can't create file: Right-click the folder you want to create the file in and then click Properties on the shortcut menu to check your permissions for the folder"
    Any ideas would be great.
    Thanks!

  • Create PDF from Scanner using Acrobat X Pro

    I am using trial Acrobat X Pro. When I attempt to Create PDF documents from Scanner using Epson Perfection 4490 Photo flat-bed scanner I get pop-up that states Epson cannot be started.  This also occurs when I Create PDF from Scanner > Custom Scan > Scanner when I select Epson Perfection 4490 scanner. My scanner is turned on when I attempt to create PDF from scanner. I have no problem scanning documents and then creating PDF documents from file, but I would like to eliminate this step.  Thanks in advance--any suggestions would be greatly appreciated.

    This is a tricky problems as hundreds have had the same problem. Research on the net demonstrated that no one had the solution. Some have even thrown perfectly good scanners away. The problem is most likely  obtaining permission from Win 7 security. Don't bad mouth Adobe Acrobat or your scanner software. This solution will work and has been tested to work. You must be logged in as administrator. This will not help Mac User.
    1. Find the file acroscanbroker.exe
    2. Select properties
    3. Select security tab
    4. Select "users/*********
    5. Edit settings
    6. Full control  Check box
    7. Modify         Check box
    8. Read and Execute    Check box
    9. Read            Check box
    10. Write           Check box
    Your scanner should now work and any grayed out menus should come to life.

  • Create PDF from scanner using 8 and 10.5 or 10.6

    Just curious what the solution is for Mac Acrobat  when trying to create a pdf from your scanner.
    I understand the Mac OS 10.5 + 10.6 changed it's twain support.
    Once or twice I've create a pdf from a epson 1660 perfection scanner using Mac OS 10.4
    Under File>Create PDF>From Scanner> and the list of scanners would show up.
    I understand in 10.5 and 10.6 you can use image capture to achieve the same results.  I like the acrobate interface which allowed the continuation of pages being scanned into the same file name.
    Did adobe address this issue in future updates or product lines is is that feature gone for good.
    Is there anyway using 10.5 or 10.6 using adobe 8, 9 etc... that allows for this process to happen again?

    The 1660 Perfection scanner (which I have) is not a OS X native scanner, it is PPC code. If you want to run it under OS 10.5 you need to run Acrobat under Rosetta. I don't believe that option exists for Acrobat under OS 10.6

  • Cannot creat pdf from Powerpoint using Acrobat Pro X

    I cannot create pdf files from Powerpoint 2010 using Acrobat Pro X.  I am using Windows 7 32-bit. There are no updates for my Acrobat Pro X and so the PDFMaker is up to date.  When trying to save to a pdf, the program will crash.  The problem signature from Powerpoint states that the problem name is "APPCRASH" and that the fault module named MPS.dll.  HELP!

    Here's a slightly better version.
    set urllist to {"http://www.cnn.com", "http://www.apple.com", "http://www.macintouch.com"}
    set numURLs to (count urllist)
    on pageloaded(timeoutvalue) -- in seconds
    delay 2
    repeat with i from 1 to timeout_value
    tell application "Safari"
    if (do JavaScript "document.readyState" in document 1) is "complete" then
    return true
    else if i is timeout_value then
    return false
    else
    delay 1
    end if
    end tell
    end repeat
    return false
    end page_loaded
    tell application "Safari"
    activate
    end tell
    tell application "System Events"
    tell process "Safari"
    set frontmost to true
    repeat with i from 1 to (numURLs)
    tell application "Safari"
    set URL of document 1 to item i of urllist
    end tell
    my page_loaded(5)
    keystroke "p" using {command down}
    click menu button "PDF" of sheet 1 of window 1
    click menu item 2 of menu 1 of menu button "PDF" of sheet 1 of window 1
    keystroke return
    end repeat
    end tell
    end tell
    Eric

  • Create collection from photos used in a book

    I have a collection of about 800 photos. Created a book layout using about 80 of the photos. As I look at the filmstrip in the Book module, I can see that some of them are marked with "1" to indicate they are used in the book. So far, so good. I would like to create a new collection (or somehow filter) consisting of only the 80-or-so photos used in the book. Is this possible in LR5?

    Found a way...
    - create a new collection, and set it as the target
    - open the book
    - click/select each picture (one at a time)
    - press B to add it to the target collection
    Have to select each picture in the book, but it's pretty fast...

  • Can i use a personal domain name with iweb 06?

    I have 2 personal domain names. and i read some where that i can host with.mac and still use my personal domain name. does any one know how to do that or is that just a feature with iweb 08. i bought this comp in 07 new so guess its iweb 06 or 07. little help here?

    AlexandreaJane:
    Welcome to the Apple Discussions. Yes you can. See: http://discussions.apple.com/thread.jspa?threadID=1164519&tstart=0 and Personal Domains.
    OT

  • Steps to create SO from PO using IDOCs..

    hi frnds..
    i have to create a SO from PO with in same client.
    PO>IDOC>SO..
    IDOC is of type orders05..
    regards..

    Hi,
    >>>Now when we create the PO and check the status in WE02 we get the error status 56 , EDI: Partner profile inbound not available.
    this means that the partner profile was not created correctly
    I'd suggest using logical system as a partner profile
    my book contains PO and SO partner profile creation
    http://www.sappress.com/product_basic.cfm?account=&product=H3059
    Regards,
    Michal Krawczyk

Maybe you are looking for

  • Erro cálculo de imposto

    Olá... Estou com erro no cálculo de imposto no seguinte cenário: Pedido com dois itens para consumo, cada item tem distribuição para dois centros de custo. Quando existem entradas parciais os impostos da primeira nota fiscal são lançados corretamente

  • Hierarchy nodes as characteristics in a query

    Hi all, I would like to ask if there is a way to use hierarchy nodes of InfoObject 0cost_elemnt as characteristics in a query. In other words I have a grouping of cost elements in R/3 and uploaded this group as a hierarchy in BW. Now the users want t

  • Does a truncate table solve corrupt blocks in a table

    Hi Guys, Got a question: Does a truncate table solve corrupt blocks in a table? I have found corrupt blocks in rman, located them, they are in 1 table. And contacted the business, and have permission to drop and recreate the table, but my question is

  • Aperture browser behaving oddly

    I'm using Aperture 2.1.4 on OS-X 10.6.8.  Recently the Aperture browser has been acting up.  I can only scroll left and right through the browser if I do not have a thumbnail selected.  If I do have an image selected I cannot scroll to other parts of

  • HT1414 What do I do next to restore my iPhone  software?

    I would like for the software of my 3G iphone to be restored so that the Wi-fi will work and that I can do int In the process of restoring the iphone, an unknown error 1013 occurred an stopped the process