How to create sub-directory by PL/SQL in run-time?

Hello,
I have directory defined in Oracle DB and I need to create a sub-directory by run-time PL/SQL code and move my file into the sub-directory.
The DB version is 10.2.0.3.0.
How can i do it without creating a new directory in DB each time i need to create a sub-directory?
Thanks!

Or, as directory objects are replacable you can just change them using dynamic SQL...
e.g.
execute immediate 'create or replace directory my_home as ''/home''';
execute immediate 'create or replace directory my_home as ''/home/newfiles''';
of course this isn't going to work if the directly object is going to be used by multiple users at the same time, but if it's for a dedicated process then it would.
(it also relies on the operating system directories having appropriate read/write permissions, but that's outside the ability of Oracle to control)
Personally though, I'd avoid having things moving about dynamically.
The design of my process would specify where files are going to be located and the correct number of directory objects defined and created up-front.
Any 'incoming' files would have to be located in one of those known locations, whether that's under the control of the 'users' supplying the files, or some other process (o/s script maybe?) that receives the files and moves them to the known location.

Similar Messages

  • How to create sub views in Oracle SQL

    I am trying to write a select statement through TOAD that needs to build a view and then query from that view further in the same statement. I don't mean create a VIEW in the common sense of running a CREATE VIEW command, I mean creating one dynamically within an SQL statement. Here's what I mean - in DB2 sql I can write the following:
    WITH COUNT_NUM
    COUNT_ADS
    AS
    (SELECT
    COUNT(AD_ID)
    FROM AD
    WHERE CONTRACT_ID = '000234123'
    SELECT * FROM COUNT_NUM;
    Obviously this is a real simple example but you get the idea. Using this syntax you can create numerous sub-views to build data into your final select. My question is how to do this for Oracle. I have searched tons of help pages and sites but the only reference is to creating permanent views. I do not want to create temporary views either as I do not have adequate system permissions - I only want to create dynamic ones within my SQL.
    Thanks in advance for any help!

    In Oracle, the equivalent concept is known as an in-line view. The Oracle version of your statement is:
    SELECT *
    FROM (SELECT COUNT(AD_ID) count_ads
          FROM AD
          WHERE CONTRACT_ID = '000234123')Essentially, you can use an in-line view anywhere you would use a "real" view or a table, so the follwoing is also possible:
    SELECT a.contract_id, a.count_ads, b.count_pages
    FROM (SELECT contract_id,ad_id,COUNT(*) count_ads
          FROM ad
          GROUP BY contract_id,ad_id) ads,
         (SELECT ad_id,count(*) count_pages
          FROM ad_pages
          GROUP BY ad_id) ad_pages
    WHERE ads.ad_id = ad_pages.ad_idHTH
    John

  • How to create a Web Application when SQL is running in SQL Authentication mode ?

    Hi,
    I a have the following config:
    SQL server 2012 with mixed authentication, running in the LAN
    IIS server with SharePoint 2013 SP1, running in a DMZ --> SharePoint contacts the SQL server with a SQL login (not a Windows login, the required port has been opened in the FW)
    SharePoint is working fine but when I want to create a new Web Application, I get an error: "Could not connect to MySQLServer\MySQLInstance,MyPortnumber using integrated security: Cannot
    connect to database master at SQL server. The database might not exist, or the current user does not have permission to connect to it."
    I think, since I use SQL authentification,  I have to use PowerShell. I found a script on the Internet but this script was not made to create a Web App which a SharePoint installed with SQL authentication.
    Can you help to adapt the script ?
    Thks
    THE SCRIPT Documentation:
    New-SPWebApplication -ApplicationPool <String> -Name <String> [-AdditionalClaimProvider <SPClaimProviderPipeBind[]>] [-AllowAnonymousAccess <SwitchParameter>] [-ApplicationPoolAccount <SPProcessAccountPipeBind>]
    [-AssignmentCollection <SPAssignmentCollection>] [-AuthenticationMethod <String>] [-AuthenticationProvider <SPAuthenticationProviderPipeBind[]>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseName
    <String>] [-DatabaseServer <String>] [-HostHeader <String>] [-Path <String>] [-Port <UInt32>] [-SecureSocketsLayer <SwitchParameter>] [-ServiceApplicationProxyGroup <SPServiceApplicationProxyGroupPipeBind>] [-SignInRedirectProvider
    <SPTrustedIdentityTokenIssuerPipeBind>] [-SignInRedirectURL <String>] [-Url <String>] [-WhatIf [<SwitchParameter> ]] [<CommonParameters>]
    The Example:
    $siteName = “PowerShell for SharePoint”
    $port = 80
    $hostHeader = “lab.ps4sp.com”
    $url = “http://lab.ps4sp.com&#8221;
    $appPoolName = “PS4SPAppPool”
    $managedAccount = “PS4SPspservice”
    $dbServer = “PS-SQL”
    $dbName = “PS4SP_SP2010_LAB_ContentDB”
    $allowAnonymous = $true
    $authenticationMethod = “NTLM”
    $ssl = $false
    New-SPWebApplication -Name $siteName -Port $port -HostHeader $hostHeader -URL $url -ApplicationPool $appPoolName -ApplicationPoolAccount (Get-SPManagedAccount “$managedAccount”) -DatabaseName $dbName -DatabaseServer $dbServer -AllowAnonymousAccess: $allowAnonymous
    -AuthenticationMethod $authenticationMethod -SecureSocketsLayer:$ssl
    Charles

    Hi Scott,
    Based on your aticle, I changed my script by adding the credential, but I still have an error.
    Il also put the SQL specific port in the $dbServer variable.
    Any idea ?
    MY SCRIPT:
    $siteName = "TEST Site"
    $port = 80
    $hostHeader = "sharepoint.test.be"
    $url = "http://sharepoint.test.be"
    $appPoolName = "TestAppPool"
    $managedAccount = "DISNET\administrator"
    $authenticationMethod = "NTLM"
    $dbServer = "DSPORT-SQL02\DSPORTPRDEXT,50123"
    $dbName = "WSS_TEST_Content"
    $dbServer_secPassword = ConvertTo-SecureString "MySQLPassword" -AsPlaintext -Force
    $dbServer_Creds = New-Object System.Management.Automation.PsCredential "DMZSharePointLoginSQL", $dbServer_secPassword
    New-SPWebApplication -Name $siteName -Port $port -HostHeader $hostHeader -URL $url -ApplicationPool $appPoolName -ApplicationPoolAccount (Get-SPManagedAccount "$managedAccount") -AuthenticationMethod $authenticationMethod -DatabaseName
    $dbName -DatabaseServer $dbServer -DatabaseCredentials $dbServer_Creds
    Charles

  • How to create and Pass DBLINK name at the run time

    Hi,
    Please help me out ....
    ACCEPT DB_USER PROMPT 'Enter the DB user name :'
    like this i will get the DB_USER name and i want to create one dblink with that userbame at the runtime
    and in all my .sql file i have to append that user name and dblink .. how to do this ....
    for example ,
    1.sql file contains a query like this
    select *
    from <user>.emp@<dblink>
    where ename= 'KING'
    ACCEPT DB_USER PROMPT 'Enter the DB user name :'
    user enter : SCOTT
    and the dblink should create a name like SCOTT_DBLINK
    and it should make the select clause in the .sql file as
    SELECT *
    FROM SCOTT.EMP@SCOTT_DBLINK
    WHERE ename = 'KING';

    Hi,
    Do you want to actually CREATE DATABASE LINK on the fly? - Don't there are all sorts of implications there.
    If not, go ahead and read about [SQL*Plus Substitution Variables|http://www.oracle.com/technology/support/tech/sql_plus/htdocs/sub_var.html]
    Regards
    Peter

  • How to create a single large bitmap data at run time?

    Hi All,
    Please help me in overcoming the issue that is mentioned below.
    Requirement:   Create single very large bitmap data which contain some 30 PNG images loaded and for each image it should have some text.  Images and text are loaded dynamically (AS2 code. Images are stored in a remote server). The bitmap data display should show 8 images at a time and corresponding text. We can see rest content by scrolling (kinetic scroll is implemented). How can I go for it?
    Some questions:
    · Is there any limit for size of bitmap data ( As per link there is restriction on the height of the bitmap we can create in AS2 (max value is 2880 which is not enough for some 30 element list http://help.adobe.com/en_US/FlashLite/2.0_FlashLiteAPIReference2/WS84235ED5-9394-4a52-A098 -EED216C18A66.html ) How to overcome this limitation?
    · If we create individual bitmap data for 30 individual PNG files, we find some jerks in scroll. How can we have smooth scrolling?
    Thanks and Regards,
    Manjunath

    Thank you very much for the reply.
    The number of bitmaps are not 30 always. It can vary in real time and since all PNG files are stored in a remote server which are also vary during runtime; so we can not predefine the number of child movieclips. It could be 10 at some duration and may be 20 at some other time.
    Any help?

  • How to create Dynamic prompts for a field at run time

    HI all
    I have a table which has 2 columns name attribute1 and attribute1_meaning.
    Attribute1_meaning is the the meaning of attribute 1.
    ex if attribuite1 is 500.. attribute1_meaning tells us if its MHz. RAM or whatever.
    So IN my form I want to display the prompt of attribute1 as the value attribute1_meaning
    Is there a way to do this ?
    thanks

    It also depends on your form layout. Francois' solution works if you only display one record. If you display multiple records this won't work, since an item can only have one prompt at a time. There is no set_item_instance_property for the prompt.
    In that case you can create two fields attribute1 and attribute1_meaning. You can set the visual attribute of field attribute1_meaning to look like a normal prompt.

  • How to create and add an XML node at run time ?

    Hello and thanks to All of You i've been learning a lot since i use this forum..
    I'm having another problem, !!! i would like that my executeShape function insert a new XMLChildnode called "adverts"  to my Pages:XML via the evenListener of the execute_bt. I tryed copying the nodes and it works but it copy a blank "adverts" node in betwen each node copied. so i tryed with appendChild, but it works only once, then it say error. so i tryed with inserChildafter or inserChildbefore but this one doesnt work at all because "advert" doesnt exist. I understand why all my suggestions does'nt work (copied or append or insertchild), but i dont figure out how to get what i want . i love AS but im no advance in enought..
    My XML structure that I want is quite simple : i just want that every time I press the execute_bt, a new "adverts" is added to the Pages XML
    <Pages>
      <page id="Page1">
        <adverts>
          <adfile>Null</adfile>
          <adwidth>1</adwidth>
          <adheight>50</adheight>
          <adposx>514</adposx>
          <adposy>200</adposy>
        </adverts>
       <adverts>
           <adfile>Null</adfile>
           <adwidth>1</adwidth>
           <adheight>50</adheight>
           <adposx>514</adposx>
           <adposy>200</adposy>
         </adverts>
      </page>
    </Pages>
    Here is the code of the clip:
    execute_bt.addEventListener(MouseEvent.MOUSE_UP,executeShape);
    var _adWidth:uint=uint(Adwidth.text);
    var _adHeight:Number=Number(Adheight.text);
    var _adFileName:String=String(adFileName.text);
    var _adpage:String=String(PageInstanceName.text);
    var _adPosx:Number;
    var _adPosy:Number;
    var _adArrayID:int;
    var currentColor:Number;
    var i:int=0;
    var element:int=0;
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        Pages.page.appendChild(<adverts />);
       Pages.page.adverts.appendChild(<adfile />);
        Pages.page.adverts.appendChild(<adwidth />);
        Pages.page.adverts.appendChild(<adheight />);
        Pages.page.adverts.appendChild(<adposx />);
        Pages.page.adverts.appendChild(<adposy />);
        Pages.page.adverts.adfile=String(Container.name);
        Pages.page.adverts.adwidth=String(uint(Adwidth.text));
        Pages.page.adverts.adheight=String(Number(Adheight.text));
        Pages.page.adverts.adposx= String(Container.x);
        Pages.page.adverts.adposy=String(Container.y);
       //var templist:XMLList= Pages.page.adverts.copy();
        //templist[0].adfile = String(Container.name);
        //templist[0].adwidth = String(uint(Adwidth.text));
        //templist[0].adheight = String(Number(Adheight.text));
        //templist[0].adposx = String(Container.x);
        //templist[0].adposy = String(Container.y);
        //Pages.page.appendChild(templist);
        //Pages.page.insertChildAfter(Pages.page.adverts[0], templist);
        trace(Pages);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

    Sorry , i Found the solution......:
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        var adverts:XML= new XML;
        adverts=<adverts />;
        adverts.adfile=<adfile />;
        adverts.adwidth=<adwidth />;
        adverts.adheight=<adheight />;
        adverts.adposx=<adposx />;
        adverts.adposy=<adposy />;
        adverts.adfile=String(Container.name);
        adverts.adwidth=String(uint(Adwidth.text));
        adverts.adheight=String(Number(Adheight.text));
        adverts.adposx= String(Container.x);
        adverts.adposy=String(Container.y);
        Pages.page.appendChild(adverts);
        trace(adverts);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

  • How to create sub report in BI Publisher

    Hi,
    i have created sample report in BI Publisher .But I do not know how to create sub report in BI Publisher.
    How to create parent-child report?
    Can you provide details through example?
    Thanks

    This blog post seems to be quite useful: http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html
    Also, there is a whitepaper: http://www.oracle.com/technology/products/xml-publisher/docs/BIP-SubTemplate.pdf
    The focus is on formatting template for your report, but should have the same principals.

  • How to create a directory in application server

    Hi all,
    How to create a directory in application server through Progaram??
    eg:\tmp - is already existing
    I want to create \tmp\fi 
    Within \tmp\fi - i should able to store my file,,,
    Kindly help me urgent...

    Hello San,
    Either contact Basis guys at ur end for the same or u can do it dynamically via a piece of ABAP code, i hope it wll help u.
    call function 'GUI_CREATE_DIRECTORY'
         exporting
    dirname = '//<ip_address>/qfilesvr400/<host>/usr/sap/TST/SYS/Folder1'
         exceptions
              failed  = 1
              others  = 2.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • How to create user defined metrics for SQL Server target?

    The customer is not able to create a user defined metrics for SQL Server target.
    This is very important for him to use this product.
    He is asking how to create user defined metrics?
    I sent him Note 304952.1 How to Create a User-Defined SQL Metric in EM 10g Grid Control
    But it would work for an Oracle DB, but his target is SQL Server DB
    Not able to find the "User-Defined Metrics" link from Database home page.
    How to create user defined metrics for SQL Server target?

    http://download-uk.oracle.com/docs/cd/B14099_19/manage.1012/b16241/Monitoring.htm

  • How to create a linked server to SQL in Oracle?

    I am able to create a linked server to Oracle in SQL.. But I do not know the steps to create a linked server too SQL in Oracle.
    How to create a linked server to SQL in Oracle? After creating the linked server to SQL, I would like to create triggers in Oracle DB to insert records into SQL DB.

    There are 2 products in Oracle you can use to link to a MS SQl Server. The first one is for free and it is called Database Gateway for ODBC. With a suitable 3rd party ODBC driver you can connect to any foreign database. The second gateway is our commercial gateway and it is called Oracle Database Gateway for MS SQL Server. It is designed for MS SQl Server connections and more powerful then Dg4ODBC. It know how to map a lot of Oracle functions to SQL Server equivalents and you can also use it to directly call SQL Server procedures or functions. This dedicated SQL server gateway is also able to participate in distributed transactions.
    But again, this is a commercial gateway and you have to purchase a license for that second gateway, the Database Gateway for MS SQl Server.
    - Klaus

  • How to create conditional update trigger in sql server

    How to create conditional update trigger in sql server

    You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
    Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
    CREATE TRIGGER Trg_TableName_Upd
    ON TableName
    FOR UPDATE
    AS
    BEGIN
    IF UPDATE(Col3) OR UPDATE (Col5)
    BEGIN
    ....your actual logic here
    END
    END
    UPDATE() function will check if column was involved in update operation and returns a boolean result
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to create Sub Queries In Webi

    Hi,
    we are creating webi reports by using BICS connection..
    Now my requirement is how to create sub queries in webi.
    Any one give me suggestions how to achieve this
    Regards,
    G

    Hi Bhargav,
    Below is thread related to same topic-
    http://scn.sap.com/thread/3430274
    ~Anuj

  • How to create sub columns in interactive report

    can u tell me , how to create sub columns in
    interactive report. i really need it.i search lot but i dont get proper information.
    help plz...
    example : -
    |_____total_ persons _____|
    | persons | male | female |
    100 200 3000
    400 500 600

    i am nile.
    select id as id,
    male as male,
    female as female
    from persons.
    i want interactive report with main column total persons(static text) in that male , female.
    e.g.
    |___total persons_| - - - - -> main cloumn
    | male | female | - - - - -> sub columns
    100 200
    300 400
    Edited by: user9512075 on Aug 29, 2008 1:46 AM
    Edited by: user9512075 on Aug 29, 2008 1:47 AM
    Edited by: user9512075 on Aug 29, 2008 1:48 AM
    Edited by: user9512075 on Aug 29, 2008 1:49 AM

Maybe you are looking for

  • Question Regarding Cursor

    I need to create a Cursor where in the SELECT clause I am using Replace function. The replace value is coming from a variable. declare cursor csr is select replace(col1,'{DATE}',v_date) from tab1; begin v_date := fun_get_date(); for c in csr loop end

  • LMS 3.2 CS Discovery finding "0" devices

    All of a sudden, after my "friendly" Windows server admin re-booted my LMS 3.2 box (without stopping the daemon!), my Discovery jobs are returning zero devices discovered. Prior to this, I was discovering 135 devices; which is correct for our environ

  • How to declare data type for DATE format

    Hi, I need the data format in this format  DD-MM-YYYY HH:MI:SS So, I m using    select TO_CHAR(Date_Column, 'DD-MM-YYYY HH:MI:SS')  from dual; Now, In my procedure I need to assign this to a OUT  variable, what should be the Data type of out variable

  • Unload dato to XML by commandline

    Hi, sorry to bother you with my question, maybe someone had already posted it but I can't find any answer to my problem. I need to export a Table into an XML file but not using the Oracle interface but a script or a dos command I hope someone could h

  • Problem authorizing songs bought with old email

    I have songs that I bought when my Apple ID was associated with a different email address. This appears to have caused a problem in that I can't transfer these songs onto new iPods or iPhones. What can I do to fix this problem?