Call a pl/sql package unix script

Hello

With the help of 11.2.0.3 on AIX.

Is it possible to call the pl/sql package unix script?

I am cretaing a file in a directory but would like it to automatically write to a directory to archive as well.

Could use either 2 utl_file.put_lines to 2 separate directories or 1 utl_file and cal script to archive files in another directory. ?

Thoughts?

Thank you

user5716448 wrote:

Thoughts?

Use UTL_FILE. FCOPY copy the file you created in the directory of the archive.

SY.

Tags: Database

Similar Questions

  • Call a PL/SQL Package

    Hi all

    I use ADF BC, JDev 11 G.
    I need to call a package stored to do the validation of data entered in the page layout. I would like to know how to call the AppmoduleImpl.java package no matter what an example for reference would be useful.
    Thanks in advance, help will be appreciated.

    Jyothi

    Use a method such as the following in your AppModuleImpl file.

      public Integer myMethod(String pParam1, int pParam2) {
        int returnValue = 0;
        String selectDML = "{? = call pkg_name.pkg_function(?,?)}";
    
        CallableStatement statement = getDBTransaction().createCallableStatement(selectDML, 1);
    
        try {
          statement.registerOutParameter(1, Types.INTEGER);
    
          statement.setInt(1, returnValue);
          statement.setString(2, pParam1);
          statement.setInt(3, pParam2);
          statement.execute();
    
          returnValue = statement.getInt(1);
    
          statement.close();
    
          return returnValue;
        } catch (Exception ex) {
          throw new JboException(ex);
        }
      }
    

    Above an example using a pkg with 1 output and 2 in params, customize to your needs.

    Then you can use it inside a bean managed as follows:

      private int returnValue;
    
      public int getReturnValue() {
        ApplicationModule am =
          BindingContext.getCurrent().getDefaultDataControl().getApplicationModule();
    
        AppModuleImpl appModuleImpl = (AppModuleImpl)am;
    
        returnValue = appModuleImpl.myMethod("aString", 0);
    
        return returnValue;
      }
    

    Hope that helps.
    Matthew.

  • Need to call the PL/SQL Package in the group dynamics of approval class that implements IDynamicApprovalGroup

    Hi all

    This is regarding the approval of invoice AP I need in my project where the user selects the users/people approval when creating the invoice based on logic. There may be any number of users who could be part of the approval group.

    Approval users information is stored in a table with a single Bill.

    When the user initiates invoice approval, approval of the Bill should go to all the people/users selected in the invoice.

    I created the dynamic of approval group which is the result of a java class. This java class implements IDynamicApprovalGroup. (what is the oracle Developer Guide).

    I called PL/SQL to java class package to get all the details of users of custom for the current invoice table.

    I used the DriverManager.getConnection method by hard coding (JDBC URL, Username, Pwd) connection details that works perfectly fine.

    But I don't want to hard-code the connection details because it will change in bodies SIT/UAT/PROD.

    Please ask you to guide me if there is no solution for the information of connection without hard coding it.

    Following code used to get the connection details

    try {}

    Class.forName ("oracle.jdbc.driver.OracleDriver");

    System.out.println ("= class loaded");

    }

    catch (ClassNotFoundException ex) {}

    System.out.println ("= class loading error");

    ex.printStackTrace ();

    }

    Fitting out = null;

    CallableStatement cstmt = null;

    Try

    {

    connection = DriverManager.getConnection ("jdbc:oracle:thin:@xxhostname:1521/SID", "FUSION", "*");

    Connection = GetConnection ();

    System.out.println ("= connection =" + connection);

    prepare the call

    cstmt = connection.prepareCall ("{call XX_AP_INV_DYN_APPROVAL_PKG. {GET_GROUP_PARTICIPANTS (?,?)} ») ;

    cstmt.setString (1, '12345');   ID on invoice

    Exit of the register

    cstmt.registerOutParameter (2, java.sql.Types.VARCHAR);

    Call the stored procedure

    cstmt. Execute();

    System.out.println ("= procedure being executed");

    approvalGroupMembers = cstmt.getString (2).split("#");

    System.out.println ("= output:" + cstmt.getString (2));

    }

    catch (Exception ex) {}

    ex.printStackTrace ();

    }

    Finally

    {

    Try

    {

    If (cstmt! = null)

    close the callable statement

    {

    cstmt. Close();

    cstmt = null;

    }

    System.out.println ("= stmt closed");

    }

    catch (SQLException ex)

    {

    System.out.println ("= stmt close err");

    ex.printStackTrace ();

    }

    Try

    {

    If (connection! = null)

    close the connection

    {

    Connection.Close;

    connection = null;

    }

    System.out.println ("= closed conn");

    }

    catch (SQLException ex)

    {

    System.out.println ("= Close conn err");

    ex.printStackTrace ();

    }

    }

    Thank you

    Dipak.

    HI Dembélé - you should be able to call the provider database from the java class. Documentation is here. However, you need to specify the name of the data provider that is the same in all environments. Do you know what it is? If it's not I'll take a look and get back to you.

    __

    Peter Maurer

    Relationship with the developers of Applications in fusion

    https://blogs.Oracle.com/fadevrel/

  • 'DBMS_FGA identifier must be declared' when it is called from PL/SQL package...

    Hello

    I'm calling dbms_fga dynamically (of sorts) of a package, and I get the error according to the title.

    I tried as many ways as I can think this call from another package, with each time similar results.

    The user/owner of the package has rights DBA, so it doesn't seem to be a permissions issue.

    Oracle Version is 11.1.0.6.0 on Suse.

    any ideas on this person?

    See you soon

    CODE:

    Attempt 1:

    PROCEDURE enable_sql_auditing (on_off Boolean false by default) is
    v_ssql varchar2 (900);
    cursor c1 is
    Select table_name
    of all_all_tables
    where owner = gcv_pkg_owner;
    Start
    for rec loop c1
    sys.dbms_fga.add_policy (object_schema = > "| gcv_pkg_owner |",)
    object_name = > "| Rec.TABLE_NAME: ",.
    POLICY_NAME = > "| Rec.table_name | ' _AUDIT "'.
    handler_schema = > "| gcv_pkg_owner: ",.
    handler_module = > 'FGA_SQL ',.
    activate = > true);
    end loop;
    end enable_sql_auditing;


    Attempt 2:

    PROCEDURE enable_sql_auditing (on_off Boolean false by default) is
    v_ssql varchar2 (900);
    cursor c1 is
    Select table_name
    of all_all_tables
    where owner = gcv_pkg_owner;
    Start
    for rec loop c1
    v_ssql: = ' start sys.dbms_fga.add_policy (object_schema = > "' | gcv_pkg_owner |) "', object_name = >"' | Rec.TABLE_NAME | " ', policy_name = > "' | Rec.table_name: "_AUDIT", select = > true); end;';
    run immediately (v_ssql);
    end loop;

    end enable_sql_auditing;

    Frenchwood wrote:
    The user/owner of the package has rights DBA, so it doesn't seem to be a permissions issue.

    But it is.

    DBA is a role.
    in PL/SQL, the permissions must be granted directly, rather than through roles.

    for example, you need to directly grant the Execute permission on the package for the required users.

  • Call the PL/SQL shell script

    Hi all

    I've seen several links and options for calling a PL/SQL shell script. I was wondering if there is something like DBMS_SCHEDULER. CREATE_PROGRAM-> executable that calls an external program in 11 GR 2.

    Here's what I have to. I have 11 GR 2 database with Dataguard. I have START triggering who begins a DBMS_SERVICE when the role becomes PRIMARY. In the same instance, I would stop the VIP on the former primary database and start the VIP on the new primary database.

    Thanks for the advice and assistance.

    Jan S.

    The URL below links to ask Tom. Inside, he talks about creating a Java procedure in your database that allows you to execute commands from the host OS (PL/SQL calls the proc of Java that runs the host command). There are several ways to run the OS commands, but this one is very flexible. I needed to use it for a task that I have who didn't fit one of the other methods very well.

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:no:P11_QUESTION_ID:3069633370832

  • Call the SQL of a script problem

    Hello
    I have a script for example query.sh:
    #! / bin/sh
    sqlplus-s ${ORACLE_USER} < < HIC
    set the position
    NewPage set to none

    SELECT 'ALTER TABLE' |' TEST_TABLE' | 'ADD PARTITION' |' P' | To_char (trunc (sysdate + 7), "IYYY"). » W'|| To_char (trunc (sysdate + 7), 'IW') | ' VALUES LESS (TO_DATE('''||) To_char (sysdate + 14, 'YYYYMMDD') | " ((', "YYYYMMDD")); "FROM DUAL;
    output
    HIC

    This will actually give me: ALTER TABLE TEST_TABLE add PARTITION P2010W46 VALUES LESS THAN (TO_DATE('20101122','yyyymmdd'));

    I'll do this output of the second script. for example create_part.sh

    #! / bin/sh

    SQL='/home/Bill/scripts/query.sh'

    sqlplus ${ORACLE_USER} < < EOF
    Set serveroutput size 1000000
    set the position

    $SQL

    output
    FO %


    When I run the 2nd script I get:

    SQL > SQL > SQL > SQL 2 > ALTER TABLE test_table add a SCORE from P2010W46 LESS THAN VALUES (TO_DATE ('20101122 ',' yyy))
    *
    ERROR on line 1:
    ORA-01861: literal does not match the format string

    I suspect that the output of the 1st script encapsulates a second line, and it defective runs correctly.

    East of Oracle 9i

    Please suggest a way to overcome this problem.

    Thank you in advance.

    In the first script, add the VALUE LINESIZE 1000

  • Component sql through shell script

    How to call a sql through UNIX shell script file?

    Rahul India wrote:

    export ORACLE_HOME=$ORACLE_BASE/product/10g
    
    cd $ORACLE_HOME
    set `sqlplus -s / <
    

    THIS SCRIPT IS OK?

    You will also need to set ORACLE_SID

    And I don't know why everyone puts the reference to sqlplus context of a 'set' assessment, nor why they put the reference to Scripture in a redirected input stream. What you need is

    sqlplus -s user/password  @r_100.sql
    

    And to make sure the environment is set correctly:

    export ORACLE_SID=whatever
    export ORAENV_ASK=NO
    . oraenv
    unset ORAENV_ASK=NO
    sqlplus -s user/password  @r_100.sql
    
  • ORA-06508, procedure cannot call the procedure of package

    I have a large stored procedure that calls a package (procedure) that manages a number of procedures to determine whether the process can continue or not.  (It checks authorization of the student to enroll in a class).  We have a web process calling the stored procedure, and that works fine.  What does not work, is a call to the package.  Oracle returned ORA-06508: PL? SQL: could not find program unit called.

    I have included instructions for debugging, so I know that it is the specific call to a procedure in the package fails with ORA-06508.  Thinking it's perhaps something in the package, I inserted a debug statement as the first line in the procedure called in the package.    (Debugging instructions call a procedure inserts of rows in a table of debugging with independent validation).

    When I log in the user account with sqlplus and run a test, everything works fine.  But when the web process is running under the same user, the process fails to call the procedure of package and fails with ORA-06508.

    It seems as if the web process runs with the rights of the appellant, or a role is not granted.

    Can someone help me understand what the problem is?

    offered hv, I appreciate your comments.

    We solved the problem: remove the package that couldn't be cited, then re-create.   That's all!

    Apparently, something in the database was tangled upward.   The server recently had problems with disk space, then it might have been related to that.  But we'll never know for sure.

    The stored procedure and packaging (procedures) which he called were owned by the same schema, and there is no mechanism that I can find to prevent one of the other appellant.  But that was the case - Oracle threw the ORA-06508 exception when the stored procedure called the package procedure.

    I replaced the stored procedure and package several times fine-tuning debugging code, but this has not fixed the problem.

    Finally let it drop and then re-create the package, it's which solved the problem.

    Regarding requests to view the code, there is no way that I could reproduce the problem, since the error that occurred was against the permissions and rules which packages run and the procedures of the Oracle.  Thanks for all the tips and suggestions.

  • How to create Maste Scrpt to call/execute another sql file

    Hello

    Can you please help me on below.

    I have 10 different .sql file and wanted to run in a sequence of another .sql file. Need sample file I can send it back to create my file master sql to call anothere Stored proc or .sql to comiple.

    as:

    a.SQL

    b.PRC

    c.PKH

    c.PKB

    d.SQL

    watnted to run these files from another .sql file, do I need to mention the path, if yes then how to define the path, the execution of another file. all sewage treatment.

    forward, thanks in advance

    Thank you

    Rob

    Hi, Rob.

    885137 wrote:

    Hello

    Can you please help me on below.

    I have 10 different .sql file and wanted to run in a sequence of another .sql file. Need sample file I can send it back to create my file master sql to call anothere Stored proc or .sql to comiple.

    as:

    a.SQL

    b.PRC

    c.PKH

    c.PKB

    d.SQL

    watnted to run these files from another .sql file, do I need to mention the path, if yes then how to define the path, the execution of another file. all sewage treatment.

    forward, thanks in advance

    Thank you

    Rob

    To call SQL scripts from another SQL script, do the same thing you would do to call by typing on the command line.  Put the @ symbol immediately before the name of the file:

    @a

    @b

    @c

    ...

    You don't need to say "@a.sql", ".sql" being the default value at the end of the file name.  If you find that explicitly ".sql" in the script, it is clear, then, by all means, go ahead.

    If you do not include a full path name, SQL * Plus assumes that they are in the default location.

    If you use 2 @ signs, then SQL * Plus will assume the Sub-script is in the same folder (directory) as the main script running, so you can say

    @@a

    @@b

    @@c

    ...

    How to include a path depends on your operating system. In Windows, for example, you could say:

    @d:\sql_scripts\sales\a

    @d:\sql_scripts\research\b

    ...

    Instead of the sign @, you can use the START command.

    See the SQL * Plus manual to learn more:

    https://docs.Oracle.com/database/121/SQPUG/ch_five.htm#sthref439

  • Create the PL/SQL package in SQL Developer 4.0.0.12

    Hello

    I built a model in SQL Developer 4.0.0.12 and I want to create a PL/SQL package.

    In ODMiner 11.1.0.4 of 'Tools' > 'Create pl/sql package' I can get a script to create the package and every thing is OK.

    but in SQL Developer, I select "Deploy" from the popup menu of each node and it generates a folder containing scripts associated with each node. I don't see any relevant script for creating a package.

    How can I create a PL/SQL package in my workflow?

    Thanks for any help you can provide in this situation.

    Please see this whitepaper to find out how to build the PL/SQL package for deployment of workflow:

    Oracle Data Miner (Extension of SQL Developer 4.0)

    PL/SQL script for the deployment of workflow

    http://www.Oracle.com/technetwork/database/options/advanced-analytics/odmrcodegenwhitepaper-2042206.PDF

  • Node affinity d ' execution for the PL/SQL Packages?

    Colleagues dbas,

    We have a problem of random performance on one of our database RAC 11 GR 1 material due to waiting for IO.

    In fact, we've tracked down the problem and noticed that the sql packages are executed on the bad weather causing node 1 and were executed on node 2 with good results.

    Now the question is how we apply these pl/sql packages, that are called via batch external, must be running on node 2?

    Affinity of the proceeding came to my mind, but I have no idea whatsoever how to apply for parcels and incorporated the pl/sql code.

    Can you please give me an advice?

    Thanks for your comments!

    Best regards

    Sebastian

    You must define a service to run on node 2 with failover to node 1 and give a your batch jobs a string of connection that connects to this service:

    Add srvctl service d a s batchserv - r node2 - a node1

    and in your tnsnames.ora,.

    batchserv =

    (description =

    (address_list =

    (failover = on) (load_balance = on)

    (address = (node1...) (address = (node2...))

    )

    (connect_data = (service_name = batchserv))

    )

    I recorded several demos of this thing of the kind,

    Database Oracle 12 c and g 11 tutorials free for Administration and developers SkillBuilders

    --

    John Watson

    Oracle Certified Master s/n

  • pass the parameter in PL/SQL on UNIX "such what."

    Hello
    I need the 4 parameters of Oracle procedure through Unix Shell script...
    procedure signature :-
    PROCEDURE Builder(csvFileName OUT VARCHAR2,pdfFileName   OUT VARCHAR2, fileId IN NUMBER, csvresult OUT VARCHAR2,pdfresult OUT VARCHAR2);
    UNIX Shell script:
    BudResult=$(exec_Builder $fileId)  
    echo $BudResult | read csvfileName pdfFileName csvresult pdfresult
    Problem: 1 suppose pdffile pdfresult has Null values in the procedures of the Oracle, and unix shell will read parameters with spaces so
    I am incorrect parameter values in UNIX script.
                   
    Oracle Procedure result:                   Unix Shell Result
    csvfile = ABC.csv                         csvfile = ABC.csv
    pdfFile = NULL                            pdfFile = Success
    csvresult = Success                       csvresult = 
    pdfresult = NULL                          pdfresult = 
                   
    2. suppose csvresult has value "Userdefined Exception" in oracle procedure but Unix reads it as following
    
    Oracle Procedure result:                 Unix Shell Result
    csvfile = ABC.csv                         csvfile = ABC.csv
    pdfFile = XYZ.pdf                         pdfFile = XYZ.pdf
    csvresult = Userdefined Exception         csvresult = Userdefined
    pdfresult = Success                       pdfresult = Exception Success
    In nut shell how to pass the parameter "like what" PL/SQL in UNIX...

    Thank you
    Sandy

    So, what kind of problem you know now? What output do you get it?

    echo oenResult=$oenResult
    
  • Calling a procedure of package with only Date setting

    Hi all

    Please, help me to call a procedure of package with Date from the sql command prompt parameter.


    Arif

    Check the procedure below.

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    
    PL/SQL procedure successfully completed.
    
  • by the way the setting of process flow to the owb unix script

    Hello
    I need help by calling a function that the return value should be passed as a parameter to the user in owb activity defined operator who would go on to turn a unix script on the server that uses the parameter passed.
    Thank you
    Ashvin.

    Sorry, I thought that X is a value you want to pass to the script...

    For example, specify PARAMETER_LIST properties:
    'Literal' - set to false
    -' Value' * ' / ' | X | '/'*

    Kind regards
    Oleg

  • call ondemand pl/sql to a JavaScript function

    try calling a pl/sql function to a javascript script to return data.

    All I get is a bunch of text HTML code in my cell in a table

    can we see what's wrong with the code javascript and pl/sql below.

    I'm trying to update a cell in a tabluar form the basis of the value of another dropdown in the same line

    (similar to this example http://htmldb.oracle.com/pls/otn/f?p=31517:160
    Thanks to Denis Kubicek
    --------------------------------------------------------------------------------------------------------------
    JavaScript in the footer
    --------------------------------------------------------------------------------------------------------------
    < script type = "text/javascript" >
    function f_increase_salary (p_this, p_rownum, p_sal)
    {

    var editable_item_to_set = "f04_" + p_rownum
    Sal var = value of $x (p_this)
    var Man_Code = Number (sal)


    get var = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_MANAGER', 0);
    Get.Add ('Man_Code', html_GetElement('Man_Code').value);
    gReturn = get.get ();

    If (gReturn)
    {$x (editable_item_to_set) .value = gReturn;  }
    on the other
    {$x (editable_item_to_set) .value = ";}  }

    get = null;

    }
    < /script >
    --------------------------------------------------------------------------------------------------------------
    function of PL/SQL returning data
    --------------------------------------------------------------------------------------------------------------
    DECLARE
    ANSWER1 VARCHAR2 (200);
    BEGIN
    Select Manager on ANSWER1 where personal EMP =: Man_Code

    HTP. PRN (ANSWER1);
    END;
    ------------------------------------------
    Thank you
    Frank

    Published by: Borg species 5618 on October 2, 2009 15:17

    This example is more recent and it finally covers your condition a lot better:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:239

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

Maybe you are looking for

  • Re: M Series Equium died when put in normal mode

    Hello Laptop was working fine last night to what I put it in normal mode. Since then (and maybe it's not related) when I press the switch on the fan starts with the initial burst, whirs the hard drive and the lights turn on but the screen remains bla

  • Pass parameter value between c# and TestStand

    Hello I'm currently futured, customize the User Interface complete I Test.seq master who has all the tests and I need to run only the selected test user in the user interface. so I thought to transmit the selected user code c# UserInterface test form

  • LabVIEW DAQ delayed

    Hello Thanks in advance for your advice - I've been teaching myself Labview for the past months and this forum was incredibly useful! I wrote the following to continuously sample data program and display the data in a chart in the form of wave (the s

  • Problem with sound when Aspire 5750 G connected via HDMI

    Hello I'm having a problem connecting my Aspire 5750 G to my TV through my HDMI cable. Previously, I've always been able to go in manage Audio devices to choose the HDMI option, but today this option disappeared. Nothing has changed with my TV or my

  • Required for .mp3 files ID3 tags?

    I recently bought a rocket (2 GB + 8 GB SDHC) to use on Suse Linux 10.1.  I have updated the firmware of the rocket to V01.01.22A. I quickly discovered that the "rocket" does not display a directory and file names, but the ID3 data. I also discovered