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

Tags: Database

Similar Questions

  • Unable to see the serveroutput sql shell script

    Hello experts,

    I have a shell script that I use to call a pl/sql procedure.
    This proc write dbms_output.
    I would like the dbms_output in a capture file when calling sqlplus to my shell script.


    Here is the code:
    ===============================
    ECHO '.
    sqlplus apps / $APPS_PWD < < ENDOFSQL
    Set serveroutput ON
    Set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    Start
    jdr_utils.listcustomizations('$I');
    end;
    /
    output
    ENDOFSQL
    "> > new.log"
    ===============================


    What I get in the "new.log" is given below:
    ===============================
    sqlplus apps/prj08app < < ENDOFSQL
    Set serveroutput ON
    Set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    Start
    jdr_utils.listcustomizations('/Oracle/Apps/IRC/candidateSelfService/WebUI/VisVacDispPG');
    end;
    /
    output
    ===============================
    ENDOFSQL


    I want to get is the given procedure dbms_output.
    Please suggest.

    Thank you
    Vinod

    Shell?

    Your call to sqlplus is between double quotes. (In ksh, at least) who gets taken literally (after substitution of the variables). To run the chain and echo its output use a backtick (') instead of a double quotation mark ("")

    Published by: Brian Bontrager Sep 29, 2011 15:51

  • Call the OBIEE Unix Shell Script

    Hi all

    Is it possible to make a call to a Unix Shell Script with the framework of the Action of OBIEE.

    Thanks in advance

    I don't think, but we can go for it instead side BI. Try to transfer the same features side shell script so that the script can identify your report using the tail of the log nqquery and execute the rest of your lines in shell script.

    This can done and works as expected. If you identify your report instead of this long logical query at all with my suggestion that you can go for a little keyword.

    Score pls help if

  • How to execute the pl/sql shell script

    Hi Experts


    I need to be able to call a pl/sql procedure shell script

    Linux and 11g

    I am new to java and followed the solution below
    The appeal of OS in Plsql commands

    After following the solution on top of link

    Declare
    x Varchar2 (2000);
    Begin
    x: = OSCommand_Run ('ls - the);
    -print x;
    DBMS_OUTPUT. Put_line (x);
    End;
    /

    give me output of 0 but the command is not executed.

    What must be changed or is there another solution?

    Thank you
    Archana

    See if that helps...

    [http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php]

  • How to call the pl/sql function in application of the ADF

    Hi Experts,

    I need to call the pl/sql function in application of ADF, I have logic written in my AM

    Method:

    public String reportStoredProcedure (locationID customerID, number,
    String tailNum) {}

    CallableStatement st = null;
    String v_sanctioned = null;
    If (locationID! = null & & customerID! = null & & tailNum! = null) {}
    System.out.println (locationID + "" + customerID + "" + tailNum);
    Tail string = "TAIL";
    String result = "N";

    try {}
    String stmt =
    "start XXWFS_SANCTIONS_PKG. CHECK_SANCTION(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11); end; « ;
    St = getDBTransaction () .createCallableStatement (stmt, 0);
    st.setNull (1, Types.VARCHAR);
    st.setNull (2, Types.NUMERIC);
    st.setObject (3, customerID);
    st.setNull (4, Types.NUMERIC);
    st.setNull (5, Types.NUMERIC);
    st.setObject (6, locationID);
    st.setNull (7, Types.NUMERIC);
    st.setNull (8, Types.NUMERIC);
    st.setObject (9, tail);
    st.setObject (10, tailNum);
    st.setObject (11, result);
    St.Execute ();
    System.out.println ("v_sanctioned in AM:" + v_sanctioned);
    } catch (Exception e) {}
    e.printStackTrace ();
    return "N";
    } {Finally
    If (st! = null)
    try {}
    St.Close ();
    } catch (Exception e1) {}
    E1. PrintStackTrace();
    return "N";
    }
    }
    } else {}
    System.out.println ("v_sanctioned is null");
    v_sanctioned = "N";
    }
    Return v_sanctioned;
    }


    Error:

    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'CHECK_SANCTION '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3858)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99)
    at model.view.CardAMImpl.reportStoredProcedure(CardAMImpl.java:182)
    at com.emboss.bean.ReadyToPrint.invokeVSanctioned(ReadyToPrint.java:485)
    at com.emboss.bean.ReadyToPrint.PrintingCards(ReadyToPrint.java:434)
    at com.emboss.bean.ReadyToPrint.printCards(ReadyToPrint.java:204)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:90)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged (Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Can someone help me how to call...

    Call it in function, not as a procedure you do

    try {
    String stmt =
    "begin :1 := XXWFS_SANCTIONS_PKG.CHECK_SANCTION(:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;";
    st = getDBTransaction().createCallableStatement(stmt, 0);
    st.registerOutParameter(1, Types.VARCHAR);
    st.setNull(2, Types.VARCHAR);
    st.setNull(3, Types.NUMERIC);
    st.setObject(4, customerID);
    st.setNull(5, Types.NUMERIC);
    st.setNull(6, Types.NUMERIC);
    st.setObject(7, locationID);
    st.setNull(8, Types.NUMERIC);
    st.setNull(9, Types.NUMERIC);
    st.setObject(10, tail);
    st.setObject(11, tailNum);
    st.setObject(12, result);
    st.execute();
     = st.getString(1);
    
  • Call the PL/SQL procedure with in out parameter of OIC clob

    Hello

    For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).

    I use a pl/sql problem test procedure:

    create or replace function Test (longField outside clob) return number is
    Number of result;
    Start
    longField: = 'prefix ';
    Result: = 12;
    Return (result);
    end Test;

    So I do all the stuff with the connection to the DB,

    I prepare the statement: "start: res: = test(:param); end; »
    So I OCIHandleAlloc (m_pCtx-> hpEnv,
    (void *) & m_hpStatement,.
    OCI_HTYPE_STMT,
    0,
    (NULL);
    and
    OCIStmtPrepare (m_hpStatement,
    m_pCtx-> hpErr,
    (...),
    (...),
    OCI_NTV_SYNTAX,
    OCI_DEFAULT);

    Before the binding I prepare parameters. For a clob I devote to the lob Locator:

    OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
    (ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
    OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);

    that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.

    I get an error
    ---------------------------
    Microsoft Visual C++
    ---------------------------
    Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.

    My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
    If Yes, what steps I need to do to succeed?

    Thank you for your response.

    Hello

    Of course, it is possible :)

    Show that you are your piece of code that is binding.
    Are you sure you had correctly the lob descriptor in the call to bind?

  • 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/

  • How to call the PL/SQL of EntityImpl procedure

    Hello

    I have a page that can create/update visitors. When a new customer is created themselves, a line gets inserted into the database table. I use EO for this feature.

    I need to create lines to two or three other table also when a new line is created in the main table. What is the best practice for this feature?

    The 2 options that I know:

    1 create a trigger on the main table and the appeal of trigger for inserting rows in other tables.

    2. call a PL/SQL of EntityImpl procedure after the permanent data is committed to the table. (If this is the best approach, could you please let me know how to get there)

    See you soon

    AJ

    In fact, Java Mail API is included in WLS and JDev, then you can simply add %MIDDLEWARE_HOME%\Oracle_Home\oracle_common\modules\javax.mail_2.0.0.0_1-4-4.jar to your project.

    Dario

  • Call the file sql plsql

    Hello
    I'm stuck for several days in this issue. Hope someone help me.

    I'm using Oracle 11.

    I am writing a utility to purge the data from the database based on certain criteria.
    We do not have physical (actual) the partitions present on our system (since we do not use Enterprise edition).
    We have 57 paintings representing 57 partitions. Then, we create a view of all of these 57 tables-

    CREATE or REPLACE VIEW MY_VIEW AS
    Select [column_names] from table1
    UNION ALL
    Select [column_names] in table2
    UNION ALL
    Select [column_names] in table 3
    UNION ALL
    :
    :
    :
    Select [column_names] of table57
    ;

    This superior query is saved in the 'body' of user_views.

    Now when a user wants to delete a partition-
    -I read the body of the request in the .sql file.
    -Edit the .sql file that is, remove the unwanted ' select * from many '
    -Loss of vision.
    -Recreate the view from the edited .sql file.


    The question is in the creation of the view on the fly of the procedure-
    -I'm not EXECUTE IMMEDIATE 'CREATE VIEW... ' and ' DBMS_SQL. PARSE' the request body exceeds 32,767 characters.


    So I chose the option of filing to write. In the file, I write the query VIEW and then I want to create the view from this file.

    Now, I'm not able to call the .sql that contains
    CREATE OR REPLACE VIEW MYVIEW AS
    Select...
    UNION ALL
    Select...
    :
    :
    Select...

    Length of character of this file is about 90000.



    Please guide me in this issue.
    Any new idea to manage very large display in the long term is also welcome...


    Thanks in advance
    Micheline
    ARGE view at run time is also welcome...


    Thanks in advance
    Micheline

    When you use DBMS_SQL, the declaration must not end with a semicolon, or you will get ora - 911.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • How to call the pl/sql function of the ofa

    Dear friends,

    I am trying to call a function of OPS page .but iam getting error as

    java.sql.SQLException: ORA-01861: literal does not match the format string

    ORA-06512: at line 1

    It is my function, callable statement

    FUNCTION CAR_LOAN_VALIDATION (P_PERSON_ID IN NUMBER

    P_DEDUCTION_START_DATE AS

    P_DEDUCTION_END_DATE AS

    P_LOAN_VALUE NUMBER

    )

    RETURN VARCHAR2

    IS

    l_message VARCHAR2 (100);

    l_contract_type VARCHAR2 (50);

    l_loan_eligible_date DATE;

    l_grade VARCHAR2 (15);

    l_old_loan_end_date DATE;

    l_max_loan_end_date DATE;

    l_remaining_amount NUMBER;

    l_eligible_amt NUMBER;

    BEGIN

    BEGIN

    SELECT - papf.person_id,.

    (SELECT the sense

    OF hr_lookups

    WHERE lookup_type = 'ADTC_CONTRACT_TYPE. '

    AND lookup_code = attribut3) contract_type;

    ADD_MONTHS (papf.original_date_of_hire, 11) loan_eligible_date,.

    DECODE (paaf.ass_attribute2,

    'President', '' President. ''

    SUBSTR (ass_attribute2, INSTR (ass_attribute2, '.', 1, 1) + 1,)

    3)

    ) grade.

    (SELECT nvl (MAX (deduction_end_date), null)

    OF xxadtc_car_loan_request

    WHERE person_id = p_person_id) old_loan_end_date;

    TO_DATE (ADD_MONTHS (p_deduction_start_date, 47)) max_loan_end_date

    -to_date (ADD_MONTHS (sysdate, 47)) max_loan_end_date

    IN l_contract_type

    l_loan_eligible_date

    l_grade

    l_old_loan_end_date

    l_max_loan_end_date

    OF per_all_people_f women's wear, per_all_assignments_f ADP

    WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date

    AND papf.business_group_id = 81

    AND papf.person_id = paaf.person_id

    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date

    AND papf.person_id = P_PERSON_ID;

    EXCEPTION

    WHILE others THEN

    DBMS_OUTPUT. Put_line ('error');

    END;

    -to obtain the amount of the previous car loan-

    BEGIN

    SELECT to_number (prrv.result_value)

    IN l_remaining_amount

    OF per_all_people_f women's wear.

    per_all_assignments_f ADP,

    pay_assignment_actions CIP,

    pay_run_results prr,

    prrv pay_run_result_values,

    petf pay_element_types_f,

    pay_input_values_f pivf,

    pay_element_classifications pec,

    pay_payroll_actions App,

    TPP per_time_periods

    WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date

    AND papf.person_id = paaf.person_id

    AND papf.business_group_id = 81

    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date

    AND paaf.assignment_id = pac.assignment_id

    AND pac.assignment_action_id = prr.assignment_action_id

    AND prr.run_result_id = prrv.run_result_id

    AND prr.element_type_id = petf.element_type_id

    AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date

    AND prrv.input_value_id = pivf.input_value_id

    AND SYSDATE BETWEEN pivf.effective_start_date AND pivf.effective_end_date

    AND pivf.NAME = 'balance '.

    AND petf.classification_id = pec.classification_id

    AND pac.payroll_action_id = ppa.payroll_action_id

    AND ppa.time_period_id = ptp.time_period_id

    AND TO_CHAR (ptp.pay_advice_date, 'Mon-YYYY') =

    To_char (SYSDATE, "Mon-YYYY")

    AND petf.element_name = "Fashions ready Ahlami"

    - and employee_number = '10185'

    AND papf.person_id = p_person_id;

    EXCEPTION

    WHEN no_data_found THEN

    -DBMS_OUTPUT. Put_line (' ERROR: no data!');

    l_remaining_amount: = 0;

    WHILE others THEN

    DBMS_OUTPUT. Put_line ('error');

    END;

    Select GET_CAR_LOAN_ELIGI_AMT (P_PERSON_ID)

    in l_eligible_amt

    Double;

    IF L_contract_type NOT IN ("Permanent") THEN

    l_message: = 'contract Type is invalid. "

    END IF;

    IF l_loan_eligible_date < SYSDATE THEN

    l_message: = 'Date to join is less then a year. "

    END IF;

    IF l_grade IN ('US', '00', 'AUS', ') THEN

    "l_message: = ' your are not eligible Grade."

    END IF;

    IF l_old_loan_end_date < SYSDATE THEN

    l_message: = 'previous loan period is not completed. "

    END IF;

    IF l_max_loan_end_date > P_DEDUCTION_END_DATE THEN

    l_message: = 'Maxinum number of monthly payment for 48 months;

    END IF;

    IF l_remaining_amount > 0 THEN

    l_message: = "amount of the previous car loan is waiting until";

    END IF;

    IF l_eligible_amt < p_loan_value THEN

    l_message: = 'Please check eligible amount ";

    END IF;

    RETURN nvl(l_message,'S');

    EXCEPTION

    WHEN NO_DATA_FOUND

    THEN

    RETURN "error";

    END CAR_LOAN_VALIDATION;

    END XX_CAR_LOAN_REQUEST_PKG;

    CODE THAT CAN BE CALLED BY CODE - CO STATEMENT

    {if (PageContext.GetParameter ("Submit")! = null)}

    OAViewObject vo2 = (OAViewObject) am.findViewObject ("XxadtcCarLoanRequestEOVO1");

    {if(VO1!=null)}

    VO1. GetCurrentRow () .setAttribute ("LoanStatus", "pending approval");

    int xxpersonId = pageContext.getEmployeeId ();

    String xxDeductionStartDate = vo2.getCurrentRow ().getAttribute("DeductionStartDate").toString ();//pageContext.getParameter("DeductionStartDate").toString();

    SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/mm/dd");

    ConvertedDate1 date = dateFormat1.parse ("xxDeductionStartDate");

    String xxDeductionEndDate = vo2.getCurrentRow ().getAttribute("DeductionEndDate").toString ();//pageContext.getParameter("DeductionEndDate").toString();

    SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy/mm/dd");

    ConvertedDate2 date = dateFormat2.parse ("xxDeductionEndDate");

    String xxLoanValue = vo2.getCurrentRow ().getAttribute("LoanValue").toString ();//pageContext.getParameter("LoanValue").toString();

    int iLoanValue = Integer.parseInt (xxLoanValue);

    System.out.println ("loop submit input");

    System.out.println ("xxpersonId id is:" + xxpersonId);

    System.out.println ("xxDeductionStartDate id is:" + xxDeductionStartDate);

    System.out.println ("xxDeductionEndDate id is:" + xxDeductionEndDate);

    System.out.println ("xxLoanValue id is:" + xxLoanValue);

    TXN OADBTransaction = am.getOADBTransaction ();

    String sql = "START: 1: = XXADTC_CAR_LOAN_REQUEST_PKG." CAR_LOAN_VALIDATION(:2,:3,:4,:5); END; « ;

    CallableStatement cs = txn.createCallableStatement(sql,1);

    String outputval = null; / / int outputval = 0;

    try {}

    System.out.println ("entry into loop try funtion callable validation");

    cs.setInt(2,xxpersonId);

    System.out.println ("cs setInt (2, xxpersonId);") is executed");

    cs.setString(3,xxDeductionStartDate);

    System.out.println ("cs.setString (3, xxDeductionStartDate is executed);'");

    cs.setString(4,xxDeductionEndDate);

    System.out.println ("cs.setString (4, xxDeductionEndDate is executed);'");

    cs.setDate(3,xxDeductionStartDate);

    cs.setDate(4,xxDeductionEndDate);

    cs.setInt(5,iLoanValue);

    cs.registerOutParameter(1,Types.VARCHAR); / / cs.registerOutParameter(1,Types.NUMERIC);

    DSI Execute();

    outputval = cs.getString (1); / / txn.commit ();

    System.out.println (outputval);

    TXN.Commit ();

    If (outputval. Equals ("S"))

    {

    am.invokeMethod ("apply");

    }

    on the other

    {

    throw new OAException ("is:" + outputval, OAException.INFORMATION name of the Organization);

    }

    TXN.Commit ();

    }

    {} catch (Exception sqle)

    try {}

    DSI Close();

    }

    catch (System.Exception e)

    {

    throw OAException.wrapperException (e);

    }

    throw OAException.wrapperException (sqle);

    }

    }

    Please help where is the error.

    Help, please

    Let me know for any clarification.

    Thank you

    Aravinda.

    Ford Hi,

    See below the code.

    In the controller

    java.sql.Date DeductionSDate; declare the variable

    In LICS

    String xxDeductionStartDate = vo2.getCurrentRow () .getAttribute ("DeductionStartDate");

    TXN OADBTransaction = am.getOADBTransaction ();

    if(xxDeductionStartDate!=null)

    {

    java.sql.Date startDate = txn.getOANLSServices () .stringToDate (xxDeductionStartDate);

    DeductionSDate = startDate;

    }

    Assign to this cs.setDate(3,DeductionSDate);


    Thank you

    Dilip

  • error by calling the pl/sql function in column target

    Hi guys,.

    I get this error when my function in ODI:

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "mySchema". "" GET_ODI_DEFAULT_VALUE (1) ": ongeldige ID-> 1 is a parameter

    While in sql developer, I get a good result with the following query:

    Select mySchema.get_odi_default_value (1) double;


    In my target for the primary key table, I call a sequence of mySchema, and it works fine.

    I tried the synxtax following in my target column mapping:

    -< % = odiRef.getObjectName ("" "," GET_ODI_DEFAULT_VALUE (1) "", "D") % >
    -< % = odiRef.getObjectName ("L", "GET_ODI_DEFAULT_VALUE", "D") 1% >

    Thanks for you advice

    You use in the interface? If that's when you come to write the name of the function and make its contribution. It should return the value. As
    GET_ODI_DEFAULT_VALUE (1)

  • Call the PL/SQL procedure with different parameters?

    I use PL/SQL for web development. I have a page of PL/SQL which collects information and returns the user off site with one return url (another PL/SQL procedure).

    I have the return procedure with every documented return variable (default null) in order to always take the return. However, there are (reported... cannot reproduce because of the nature of the business) cases where a 404 error is returned because of the incompatibility of parameter.

    Is it possible to proceed regardless of the parameters? Someone at - it suggestions?

    Thank you!

    user2960509 wrote:

    My problem is that they sometimes send back of settings that do not match what I expect.

    Use the interface "+ flexible +" mod_plsql - see the Oracle® HTTP Server mod_plsql user's Guide for the documented details.

    The signature of the procedure parameter is as follows (it is called by mod_plsql using tables of name value pairs):

    create or replace procedure Scott.MyWebProc( name_array owa.vc_arr, value_array owa.vc_arr) is
    ...
    

    In your code, you just browse the berries to get the name values passed query string. You can even filled an associative array in your code (a table indexed by string and no number, where the index string represents the name of param)-this approach can make it pretty easy for the code make reference to a parameter, with little effort on your part to provide an interface to query by name for code to get the value of a parameter name.

    To enable the flexible (aka parameter 2) call interface, precede the call to web with an exclamation character. For example

    http://my-webserbver.my-domain.com/pls/dad/!scott.mywebproc?name-1=val-1&name-2=val-2..,name-n=val=n
    
  • Calling shell script program SQL and passing parameters

    Hi guys,.
    Greetings from Toronto. Is it possible to move one or more strings as parameters to a sql from shell script program?

    Shell script
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
     
    sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    SQL program (rd_test.sql)
    -- Accept system input parameters
    define p_user_id = &1
    define p_job_id = &2
    
    -- Wondering if its possible to pass these 3 parameters from a shell script program.
    -- (1) rd_test-$p_job_id-3-1.lis
    -- (2) RD_PRINTER(rd_test,3)
    -- (3) t_data
    
    select
    t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    t_data_dir=''.''
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'
    exit_status=$?
    check_command'
    from rd_job_parameter b, rd_job_parameter a
    where a.job_id = &2
    and a.jp_module_id = 'RDTEST'
    and b.job_id = a.job_id
    and b.module_id = a.module_id
    /
    As always, this is not something I have to solve that minute. Any help would be appreciated
    and I will think of the problem.

    Thank you
    REDA

    Published by: Raj404261 on June 25, 2009 11:40

    Published by: Raj404261 on June 25, 2009 17:29

    OK, just a few pointers possible if you need to go the way of shell script.

    I suggest that you have a separate SQL script for each of your options, which retains the fairly well-defined lines and keeps the maintenance as simple as possible. Therefore, in your shell script, you can have something like:

    #!/bin/ksh
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    
    # Deduce which script you'll call here
    # using if statements, or even a case:
    
    if [[ p_job_id -eq 1 ]]
    then
      SQL_SCRIPT=sql_script1.sql
    else
      SQL_SCRIPT=sql_script2.sql
    fi
    
    # Or using case
    
    case $2
      in
        1)     SQL_SCRIPT=sql_script1.sql;
    
        2)     SQL_SCRIPT=sql_script2.sql;
    
        3)     SQL_SCRIPT=sql_script3.sql;
    
        *)     SQL_SCRIPT=sql_script4.sql;
    esac
    
    export ${SQL_SCRIPT}
    
    #If you need to query the database at all to deduce which script to cal
    #Then something like this:
    
    SCRIPT_VAR=`sqlplus -s username/password << EOF
    set heading off
    set feedback off
    set verify off
    SELECT * FROM DUAL;
    EOF`
    
    export {SCRIPT_VAR}
    
    SQL_SCRIPT=sql_script${SCRIPT_VAR}.sql
    
    # Then just call your script:
    sqlplus. -s $p_user_id/password @${SQL_SCRIPT}
    
  • sqlplus from a shell script with the variable in unix

    I'm having some trouble calling sqlplus from a shell script... I am basically asking for a path/name of file which I attribute to one to a variable called $code. Then use cp to move the file ($code) to a new directory. I think that there is something wrong with my sqlplus below. echo $code does not work yet. I thought that $code was variable, which I could see, but rather it seems that the script is trying to rerun the SQL command each time.

    Any help would be greatly appreciated... condensed version of the code is below. Thank you!

    file in $FILES
    do
    Code =""
    code ='sqlplus-s $USER_PWD < < EOF
    Set the off position;
    set pagesize 0;
    Select r.outfile_name OUTFILE
    some paintings
    where file_name = $file;
    EXPRESSIONS OF FOLKLORE"
    echo $code
    CP $code $newdir

    Hello

    I hope code below will help but set feedback off so that he won't be any info if no line selected

    echo ${CODE}
    if [ -z "${CODE}" ]
    then
    echo "No rows returned"
    else
    echo "Returned"
    fi
    

    Concerning
    CA
    uninstall security tool
    essential elements of the Security window
    Windows startup configuration
    the Award bios update

  • 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.

Maybe you are looking for