automate related orders and CREATE a DIRECTORY

Hello


I use to do this CREATE a DIRECTORY, and I need help with some other associates
orders and automate this process in a PL/SQL procedure in which I submit a directory path
(for example, "c:\webapps\newapp1") and process like this:


1 check if the directory object exists already.
2. If the object does not exist, create it (e.g., "CREATE DIR appdir1 as path")


And I'll also have a procedure to verify a specified file and process as follows:


1. If the file does not exist, create it
2. If exists, overwrite or add him.


Could someone please help me find a concise list of these commands?


All responses are greatly appreciated.


Long life and prosperity.

Create a directory on your operating system, should you write code in Java to do the actual work and call these Java within your PL/SQL procs. Search for dbms_java and also visit AskTom.oracle.com and search for "running the OS command" and you'll get a bunch of examples.

You could remove all directories by looping through the rows returned by selecting dba_directories, the command string of FALL of construction using EXECUTE IMMEDIATE to do. However, be very careful. Oracle creates directories for its own use, and you don't want to drop those. If you want to delete all of the directories that you created, then make sure to use a naming convention that identifies these directories that you created and only let down those specific.

Karen

Tags: Database

Similar Questions

  • Failed to create the directory

    Hello

    I logged in as user oracle on the server then started sqlplus logeen as User1 and created a directory in an oacle in folder
    Create directory user1 as "oracle/s1/user1.

    received message - created directory
    but when I checked the folder without ws created direcory. in oracle/s1 with name user1

    user8731258 wrote:
    Hello

    I logged in as user oracle on the server then started sqlplus logeen as User1 and created a directory in an oacle in folder
    Create directory user1 as "oracle/s1/user1.

    received message - created directory
    but when I checked the folder without ws created direcory. in oracle/s1 with name user1

    Command to CREATE a DIRECTORY does NOT create the physical directory.
    Physical directory must be created manually.

  • Create the directory of procedure to aid directory with path parameter name

    Hello
    I've written a procedure that takes name (C:\temp) to a directory as a parameter and creates the directory oracle using EXECUTE IMMEDIATE of the procedure. Proc compiled fine but when I try to run it (exec prc_lx_e_m_fund_activty ("C:\interface','test1.txt','20040102"), I get the following error with the execute immediate statement 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
    .
    .
    .
    .
    RUN IMMEDIATELY 'CREATE OR REPLACE DIRECTORY OUTPUT_PATH AS | ''''|| i_output_dir | " ' || « ; » ; -Where i_output_dir = C:\temp (I'm 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 is complete.

    Kind regards
    Mason.

    Try this

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace
      2  PROCEDURE prc_lx_e_m_fund_activty
      3  (
      4  i_output_dir IN VARCHAR2,
      5  i_output_file_name IN VARCHAR2,
      6  i_interface_date IN VARCHAR2
      7  )
      8  AS
      9  begin
     10  EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY OUTPUT_PATH AS '|| i_output_dir ;
     11* END;
     12  /
    
    Procedure created.
    
    SQL> exec prc_lx_e_m_fund_activty('''c:\temp''','aa','bb');
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> SET LINES 10000
    SQL> SELECT * FROM ALL_DIRECTORIES;
    
    OWNER                          DIRECTORY_NAME                 DIRECTORY_PATH
    ------------------------------ ------------------------------ ----------------------
    SYS                            OUTPUT_PATH                    c:\temp
    
  • Hello, I had a problem with my band. It does not really suppose he numbered scenes everything in order and he has so far in until I missed an and changed for the good order. But now when I go back to where I left and I have create a new scene

    Hello, I had a problem with my band. It does not really suppose he numbered scenes everything in order and he has so far in until I missed an and changed for the good order. But now when I go back to where I left and I have create a new scene number come up as * it and I need to change personally. is their any way I can change it to order normally?

    Hello

    You can manage this through the "Manage scene numbers" option in the menu 'Production '.

    There is a setting in this dialog box to assign scene numbers automatically to the new scenes.

  • Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column determines if the entry price column is subtracted from the price of output column or output subtracted

    Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column; Determines if the entry price column is subtracted from the price of output column (buy) or subtracted from (Sell) entry exit. Thank you for your help

    Hi B',.

    Buying and selling in column B

    Price of entry in column c.

    Exit in column D price

    Formula (and outcome) in column E

    If the column will B always contained 'Buy' or 'Sell', it works. It is default to a calculation of 'sell' if sale or has been specified.

    E2: = IF (B = "Buy", D - C, C - D)

    If you want to delay the calculation until the amounts entered in C and D, use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, C - D) ")

    If you want to delay the calculation until all three ducks are on a line (B contains buy or sell, C and D contain both data), use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, IF(B="Sell",C-D,) "" ")))

    Third version used in this table.

    Kind regards

    Barry

  • Problem installing Webroot for MSN (part of the Internet software of MSN Premium subscription) "error 5: access is denied" and "Setup could not create the directory"C:; Program Files/Webroot/security /...

    Original title: problem installing Webroot for MSN (part of the Internet software of MSN Premium subscription)

    Try installing Webroot to MSN but when I run the installer, I get "error 5: access is denied" and "Setup could not create the directory"C:; Program Files/Webroot/security/current/plugins/antimalware/Backup ". OS is XP with Service Pack 3. I tried to delete my existing Webroot program and turning to the bottom/off other security options... Any suggestions? Thank you.

    Thanks for the reply. I was able to finally get the new Webroot program to install after running a Microsoft Fix affecting the directory uninstall the old prgm Webroot and meets a new error code (1603), which led me to this site to permissions Grant full control to the SYSTEM account.

    http://support.Microsoft.com/kb/834484

  • I have 10 pdf files I want to merge to make 1 large pdf. I want to be able to search the content of each of them, in order to make 1 large pdf let me do this... I hope. Which product do I need to merge and create this big 1 pdf in Adobe?

    I have 10 pdf files I want to merge to make 1 large pdf. I want to be able to search the content of each of them, in order to make 1 large pdf let me do this... I hope. Which product do I need to merge and create this big 1 pdf in Adobe?

    You can use Acrobat Pro to combine multiple PDFs into a single PDF.

    You may be able to use Acrobat Standard as well - not sure.

    In my view, there is also a the Adobe online subscription service hosts that combine multiple PDFs into a single PDF.

    As for search. To make available content of every PDF should be text with a font mapping of characters of the regular police having families (each character we see ("glyph") represents a specific numerical value, which is held in the file under the hood) which in turn has a correct mapping to Unicode.  If there are pages that are the output of text parser image then make sure you use OCR to get the result of the OCR to support search/search.

    With all the 'one' PDF support find simple. Using Acrobat Pro, you can embed a search Index. This is a simple step. For full service advanced search use Acrobat Pro to create a stand alone catalogue Index (see the help file).

    Be well...

  • Whenever I try to create a text box indesign automatically for me and place the text in the middle.

    Whenever I try to create a text box indesign automatically for me and place the text in the middle. I can get the text moves if I play with the object ' menu ' detected block options, but it does every time. "

    Hello, welcome to the forum of InDesign. I'm a different Steve.

    What version of InDesign are you using? What operating system do you use?

    Tell us exactly how you create your text box (frame).

    The easiest way is to choose the tool of Type (T). Click and drag an image where you want to go.

    But, if you place the text to another program like Microsoft Word, click file > Place. Select the file and click Open. Drag-and-drop placement of text cursor to position it on the page.

  • Please, I initially created my account to the Brazil. However, I now live in the Panama. How can I change my account in order to correctly proceed to payment and so on? Or I have to cancel my account of the Brazil and create a new one?

    Please, I initially created my account to the Brazil. However, I now live in the Panama. How can I change my account in order to correctly proceed to payment and so on? Or I have to cancel my account of the Brazil and create a new one?

    Hello

    Please see change the country associated with your Adobe ID

    Hope that helps!

    Kind regards

    Sheena

  • How can I create and drop a directory

    I have a program that will create and remove a directory. This is my code

    I don't you can create an Active Directory like this

    create or replace the Signature directory as ' / images/sig/oo1 "; It works very well

    now I want to do it in the code

    Declare a variable
    strDir as Varchar2 (100);

    strDir: = ' / images/sig/oo1. "

    create or replace directory Signature as strDir
    is it possible

    kama021 wrote:
    I have a directory not created by me. I copied the image there and used this directory which worked without any errors. the file has been copied successfully. but I use mine it get invalid error even of file operations. some can tell me why it is so

    UTL_FILE, than any package aside server runs under oracle user OS (OS user oracle is installed, to be precise). Therefore, you must make sure oracle user OS can read/write the directory.

    SY.

  • A user with ACCESS and CREATE automatically get FUSION?

    Hi all

    I am running into an issue while using OWM (10.2.0.4.2) and granting of privileges. I have 3 levels of users: a Viewer (ACCESS_ANY_WORKSPACE), the editor in Chief (CREATE_WORKSPACE) and the Auditor (full control). I want to have my editor can do, it of having access to any workspace, be able to create their own workspaces and do not have the ability to MERGE their workspaces back to live. Without ACCESS_ANY_WORKSPACE, they cannot see their own workspaces.

    I revoked ACCESS and CREATE from the PUBLIC. When I grant CREATE_WORKSPACE to my editor, they get full control of this workspace without FUSION. When I add in ACCESS_WORKSPACE or ACCESS_ANY_WORKSPACE when they create a new workspace, they are granted full control on this workspace including the MERGER.

    Is it possible to be able to have a user have access to all areas of work, being able to create their own workspaces, but not have them able to merge workspaces? The editor has not any MERGER of the privileges granted, and I can not revoke FUSION of a workspace that they have created.

    Any thoughts?

    Thank you!
    Mike

    Hi Mike,.

    Users have always full privileges on any space they create. The only additional privilege that is required to merge the child workspace is the privilege to ACCESS the parent workspace. Given that you grant the user ACCESS_ANY_WORKSPACE, they would have all the necessary privileges to merge, and there is no way to avoid this without removing one or more of these privileges.

    However, one possibility would be to create a trigger that only run during merge operations using dbms_wm. SetTriggerEvents and triggered an error every time one user other than the auditor tried to merge a workspace. The other possibility is to create a separate user to create all the workspaces. The listener would still have the ACCESS_ANY_WORKSPACE privilege, but would not be able to merge the workspace without privilege is granted explicitly because they possess is more working space.

    Kind regards
    Ben

  • Suddenly - whenever I right click on 'New' in 'my documents' or on the desktop or in a folder, in order to create a folder or file, windows says "Please wait while that corel suite 11 is installed.

    Suddenly - whenever I right click on 'New' in 'my documents' or on the desktop or in a folder, in order to create a folder or file, windows says "Please wait while that corel suite 11 is installed. I click on cancel, but it keeps coming back. I have not Corel. If I click on cancel about 13 times it finally stops! But I can't use right click on 'new' installation at all, it seems. Also I have problems with Outlook - I wonder if I need to re - install Windows XP or is there a simpler solution?

    Thanks for yr help.

    Yes, Outlook often think files 'have not been closed properly' and takes forever to 'check' the. I give him extra time to close before stopping computer...

    Aeoliansands,

    Welcome to the Microsoft Answers community.

    You can download and run the Installer Cleanup utility:

    http://download.Microsoft.com/download/E/9/D/E9D80355-7AB4-45B8-80E8-983A48D5E1BD/msicuu2.exe

    - or try reinstalling Corel.

    Your second question is related to Microsoft Outlook and would be better suited in the Groups of Discussion Outlook. Please visit this link to find a community that will provide the support you want.

    I hope this helps!

    Lisa
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Create the directory - County list showing on all Pages of the book

    Hi to all the InDesign scripting

    I am trying to create a directory with InDesign CS6, that contains the name of the person, addresses, cities, etc.

    I have a question which is to show the number of entry per city,

    for example, there are 30 names under a city (in front of spreads and pages),

    How to automatically display the number of registration County about InDesign?

    And how InDesign find what kinds of use on this page?

    (If I have two pages should show total registration under the same city is 30)

    I found a script to add # sequential to paragraph styles, but I couldn't pick up the latest issue on the page by using the variable text - function headers running in InDesign, not the last issue under the same city.

    Any help would be appreciated!

    Best regards

    V

    Hi UFV

    Assuming that you need to do one city at the maximum per page and use you a single paragraph for your titles in the city style and assuming that use you a paragraph for your entries to name style then the following should do it.

    Trevor

    // City Listings Count Script by Trevor www.creative-scripts.com (Coming soonish)
    // Trevor {at} creative-scripts {dot} com
    // http://forums.adobe.com/message/5837823#5837823
    
    app.doScript("addListingsCount()", ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Add Listings Count");
    
    function addListingsCount () {
        var  doc = app.activeDocument,
                cityParagraphStyle = doc.paragraphStyles.itemByName ("City Title"), // Change to correct paragraphStyles name
                nameParagraphStyle = doc.paragraphStyles.itemByName ("Entry Name"), // Change to correct paragraphStyles name
                countParagraphStyle = doc.paragraphStyles.itemByName ("Entries Count"), // Change to correct paragraphStyles name
                cityFinds = [],
                entryFinds = {};
    
        // Get GeometricBound for Title Text Frames
        var   pageMargins = [], pageGeos = [], textFrameGeos = [],
                 vp = doc.viewPreferences.verticalMeasurementUnits,
                 distanceFromTopMarginToTheTopOfTheEntriesCountTextFrame = UnitValue (".8cm").as(vp);  // Change distance as needed
                 heigtOfTheEntriesCountTextFrame = UnitValue (".5cm").as(vp);  // Change height as needed
        pageMargins[0] = doc.pages[0].marginPreferences;
        pageGeos[0] = doc.pages[0].bounds;
        textFrameGeos[0] = pageGeos[0];
        textFrameGeos[0][0] += pageMargins[0].top - distanceFromTopMarginToTheTopOfTheEntriesCountTextFrame;
        textFrameGeos[0][1] += pageMargins[0].left;
        textFrameGeos[0][2] = textFrameGeos[0][0] + heigtOfTheEntriesCountTextFrame;
        textFrameGeos[0][3] -= pageMargins[0].right;
    
        pageMargins[1] = doc.pages[1].marginPreferences;
        pageGeos[1] = doc.pages[1].bounds;
        textFrameGeos[1] = pageGeos[1];
        textFrameGeos[1][0] += pageMargins[1].top - distanceFromTopMarginToTheTopOfTheEntriesCountTextFrame;
        textFrameGeos[1][1] += pageMargins[1].left;
        textFrameGeos[1][2] = textFrameGeos[1][0] + heigtOfTheEntriesCountTextFrame;
        textFrameGeos[1][3] -= pageMargins[1].right;
    
        app.changeTextPreferences = app.findTextPreferences = null;
        app.findTextPreferences.appliedParagraphStyle = cityParagraphStyle;
        cityFinds = doc.findText();
        app.findTextPreferences.appliedParagraphStyle = nameParagraphStyle;
    
        var l = cityFinds.length,
              c = 0, nameFinds, pageOffsets = [], pageOffset, fl, city;
    
        while (c < l) {
            pageOffset = cityFinds[c].parentTextFrames[0].parentPage.documentOffset;
            nameFinds = ([]).concat.apply ([],doc.pages [pageOffset].textFrames.everyItem().findText ());
    
            city = cityFinds[c].contents;
            fl = nameFinds.length;
            pageOffsets [c] = pageOffset;
            entryFinds [city] = (entryFinds [city]) ? entryFinds [city] + fl : fl;
            c++
            }
    
        while (l--) doc.pages[pageOffsets[l]]
                              .textFrames.add ({
                                   geometricBounds: textFrameGeos [pageOffsets[l] % 2],
                                   contents: "Total Listings: " + entryFinds [cityFinds[l].contents],
                                   name: "Listings Count"
                                   });
        doc.pages.everyItem().textFrames.itemByName ("Listings Count").texts[0].appliedParagraphStyle = countParagraphStyle;
    }
    
    // Note if you ever want to remove these text frame you can do
    // app.activeDocument.pages.everyItem().textFrames.itemByName ("Listings Count").remove()
    
  • Create the directory in the operating system through PL/SQL

    Hi gurus,

    I'm creating a procedure to automate the creation of the external tables and Oracle (using the dynamic SQL) directories.

    I wonder if it is possible to create the directory in the operating system through the procedure.

    As in SQL more
    SQL > host mkdir/oracle/test

    THX,
    Levi Pereira

    http://www.Oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:4500682002852519:P11_QUESTION_ID:952229840241

  • Custom OR automatic TAB ORDER?

    Hello

    I'm new to LC Designer. I develop a multi-page PDF form. It is to have both static and dynamic (conditional) fields. Number of fields is around 100. I lived in the TAB order, and I found there are two types of TAB COMMAND available i.e. automatic and custom. I don't know what to choose among these options.

    My question: what ORDER of TAB should be used @ what?

    answer pls.

    Thank you.

    -

    Afonso

    Hi Afonso,

    My personal preference is the automatic tab order. I find that when you go to a custom tab order, he can go out of sync as more objects are added to the form. Custom order can be re-established, but it can be tedious.

    In automatic mode, the tab order is very much affected by the relative x / y coordinates of the objects from the top left of the form. If an object on the right is even a fraction higher to an object on the left, then fine focus first. This highlights the advantage of using the snap to grid feature in the LC Designer. The other thing to remember is that, once the tab enter a subform, this will work its way through all the objects in the subform before going out to reconnect with the rest of the form. This can be handy to control the tabbing order.

    There is an example here by looking at some of the issues:

    http://www.assuredynamics.com/index.php/category/portfolio/tabbing-order/

    Hope that helps,

    Niall

    Ensure the dynamics

Maybe you are looking for