Callin Procedure from Calendar Portlet

Hai,
I have a problem when using a procedure Procedure11 as the_name link in Calendar oportlet
I have a procedure by name Procedure11 with single Parameter edate date in scott schema
i wrote like
'scott.Procedure11.show?&p_arg_names=edate&p_arg_values='||event_date the_name_link
pls tell me the solution

What error message do you get?
Did you grant execute privilege on the procedure to public?
GRANT EXECUTE on scott.showemp TO PUBLIC;Peter

Similar Messages

  • How do i include a calendar portlet from groupspace in my portal

    hi all
    i have created a portal web project and create a portal,
    the domain created for the portal is normal portal domain without the groupspace/collaboratio facets,
    now i want to include a calendar portlet into my application where users of my portal can use that calendar to schedule their activities,
    What do i need to do integrate calendar portlets into my portal?

    Biren,
    If you want to use calendar portlet,your domain should support the groupspace Framework configuration.
    Here is steps(WLP9.2):
    (1)Create a domain which support portal and groupspace(Check the groupspace checkbox).
    (2)In workshop:
    Create a portal EAR project(Select Collaboration API and Collaboration portlets App from weblogic portal Collaboration facet)
    Create a portal web project(Select Collaboration portlets Checkbox from weblogic portal Collaboration facet)
    Create a data project(if required)
    (3)Now open the merged projects view in the workshop.
    (4)From the portal webb project copy the portlets folder.
    (5)Now create a .portal file and keep the calendar portlet on the portal file.
    You can use all the Collaboration portlets(Email,Tasklist,calendar,Address Book,Discussion).It needs same configuration for every one.
    In weblogic portal 8.1.4 you need to manually run the SQL scripts and update web.xml/weblogic.xml but in 9.2 while creating the domain configuarion it does all the necessary task.
    Thanks
    Bishnu
    Regards
    Bishnu

  • How to call a PL/SQL procedure from a Java class?

    Hi,
    I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
    Can anyone let me know how to solve that problem?
    Thanks in advance,
    Chang Si Chou

    Have a look at this example:
    final ApplicationModule am = panelBinding.getApplicationModule();
    try
         final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
                                                                                         createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
         stmt.registerOutParameter(1, OracleTypes.VARCHAR);
         stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
         stmt.setString(3, "Test");
         stmt.execute();
         stmt.close();
         return stmt.getString(1);
    catch (Exception ex)
         panelBinding.reportException(ex);
         return null;
    }Hope This Helps

  • Error while link from calendar to report

    Dear,
    Now I try to link from calendar to report. In the SQL Query
    step of the calendar build wizard I've input as follows:
    select
    c.cal_date the_date,
    c.cal_title the_name,
    'PROJECT.CAL_RPT.show_parms?
    p_arg_names=_tab_calendar_cal_id_cond&p_arg_values=%
    3D&p_arg_names=tab_calendar.cal_id&p_arg_values=' || C.CAL_ID
    || ' ' the_name_link,
    null the_date_link,
    null the_target
    from project.tab_calendar c
    order by 1
    But when I click link in calendar, the browser was shown
    that "The page cannot be found HTTP 404 - File not found
    Internet Explorer".
    Why this link is incorrect? Please help me.
    Thank You
    sirin kittichotpanich

    hai eide...
    this is javascript ok..
    i am also having the same problem
    in plsql procedure anyway...
    write this script into javascript event handler 'OnClick' ok
    function open()
    window.open('url','mywindow','width=100,height=100,scrollbars=yes,resizeable=yes');
    open();
    it should work...
    regrds
    hai

  • Oracle Collaboration Suite Calendar Portlet

    Hi,
    I have only oracle calendar installed from OCS 10G.
    I have seen from documentation that there is a Calendar Portlet available as part of the install.
    Does anyone know where the calendar portlet is installed, or is there a war or ear file that I can use to manually install the calendar portlet itself ?
    Thanks,

    Check the download page for the software.
    /Per

  • Testing Calendar Portlet

    When I execute the CalendarPortlet from the iAS listener, I get an HTTP-404 file not found. Has anyone encountered this?

    I'm working on the Calendar Portlet too. I tried all things in the startdate. But i can't get it working. I found on other forums that the solution would be: #TO_CHAR(SYSDATE,'MON-YYYY')
    But i tried also this in all kind of combinations. Resulting in this error
    Invalid Date Format: Enter Start or End Month in MON-YYYY Format. (WWV-13035)
    What can i do more????
    Koen

  • Calendar Portlet Will Fail Restarting After July 28, 2005

    Hi,
    We have an Oracle 8i database sitting on a UNIX server. On July 28th 2005, our entire database crashed with no UNIX processes able to run. We found that the cause was due to the Java Cryptography Extension (JCE) 1.2.1 that ships with OCS 9.0.4.x makes use of a certificate that expires on July 28, 2005. On or after July 28, 2005
    the Calendar Portlet will no longer be able to use JCE 1.2.1. and will error with 500 error.
    The workaround we did was to replace the following JCE1.2.1 files with the corresponding files from the JCE 1.2.2 package and then re-boot the UNIX server:-
    US_export_policy.jar
    jce1_2_1.jar
    local_policy.jar
    sunjce_provider.jar
    We have been told by out DBAs that although it occurred within the Oracle Collaboration Suite, it is actually a Sun Java problem.
    Therefore, despite putting this workaround in place, is anyone able to advise if this problem will occur again in the future? Is the workaround sufficient?
    Many Thanks.
    Full description of problem and workaround is below...
    CALENDAR PORTLET WILL FAIL RESTARTING AFTER JULY 28, 2005
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Versions Affected
    ~~~~~~~~~~~~~~~~~
    Oracle Collaboration Suite - Version: 9.0.4.x
    Platforms Affected
    ~~~~~~~~~~~~~~~~~~
    GENERIC
    Description
    ~~~~~~~~~~~
    The Java Cryptography Extension (JCE) 1.2.1 that ships with OCS 9.0.4.x makes
    use of a certificate that expires on July 28, 2005. On or after July 28, 2005
    the Calendar Portlet will no longer be able to use JCE 1.2.1. and will error
    with 500 error.
    Likelihood of Occurrence
    ~~~~~~~~~~~~~~~~~~~~~~~~
    Every OCS installation will run into issues with the Calendar Portlet after
    July 28, 2005. This will only occur the next time they bounce OC4J components
    after July 28, 2005.
    Possible Symptoms
    ~~~~~~~~~~~~~~~~~
    The Calendar Portlet fails with 500 error after July 28, 2005.
    The following stack trace will be seen in the application log:
    $ORACLE_HOME/j2ee/OC4J_Portal/application-deployments/webclient-calendar/OC4J_Portal_default_island_1/application.log
    ====STACK TRACE =====
    05/07/28 9:01 webclient-calendar-web: Servlet error java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
    at javax.crypto.SecretKeyFactory.getInstance([DashoPro-V1.2-120198])
    at oracle.calendar.authentication.OTMT.initEncryption(OTMT.java:240)
    at oracle.calendar.authentication.OTMT.<init>(OTMT.java:150)
    at portlets.Calendar.getOTMT(_Calendar.java:110)
    at portlets.Calendar.doSearch(_Calendar.java:313)
    at portlets.Calendar._jspService(_Calendar.java:528)
    at com.orionserver[Oracle9iAS (9.0.2.3) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    ... remaining of stack trace truncated ...
    And NoClassDefFoundError with the following stack is raised
    if reloading the web browser after the error occured.
    05/07/28 9:02 webclient-calendar-web: Servlet error
    java.lang.NoClassDefFoundError
    at javax.crypto.SecretKeyFactory.getInstance([DashoPro-V1.2-120198])
    at oracle.calendar.authentication.OTMT.initEncryption(OTMT.java:240)
    at oracle.calendar.authentication.OTMT.<init>(OTMT.java:150)
    at portlets.Calendar.getOTMT(_Calendar.java:110)
    at portlets.Calendar.doSearch(_Calendar.java:313)
    at portlets.Calendar._jspService(_Calendar.java:528)
    at com.orionserver[Oracle9iAS (9.0.2.3) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    ... remaining of stack trace truncated ...
    Workaround
    ~~~~~~~~~~
    The workaround is as follows:
    1- Download the JCE 1.2.2 package from the following web page:
    http://java.sun.com/products/jce/index-122.html
    2- Remove the following files from the midtier:
    $ORACLE_HOME/jdk/jre/lib/ext/US_export_policy.jar
    $ORACLE_HOME/jdk/jre/lib/ext/jce1_2_1.jar
    $ORACLE_HOME/jdk/jre/lib/ext/local_policy.jar
    $ORACLE_HOME/jdk/jre/lib/ext/sunjce_provider.jar
    3- Copy the following files from the JCE 1.2.2 package to the
    directory $ORACLE_HOME/jdk/jre/lib/ext/ :
    jce1.2.2/lib/US_export_policy.jar
    jce1.2.2/lib/jce1_2_2.jar
    jce1.2.2/lib/local_policy.jar
    jce1.2.2/lib/sunjce_provider.jar
    4- Complete by issuing opmnctl stopall , opmnctl startall on the middle tier and
    test the Calendar Portlet again. Calendar Portlet should now work with the
    system date set to past July 28, 2005.
    Patches
    ~~~~~~~
    List the known patche(s).
    References
    ~~~~~~~~~~
    Bug 4452391 Calendar Portlet Authentication Certification (Jce) Expiring July 28th 2005

    I was unable to access the laptop last night to create a new user; however my client would perfer not to try a second account since that would make it unusable for him while we test the second profile.
    Also John Sophos was installed after this started to verify that it was not a virus/malware (I know pointless step but it has happened to me before) so I don't think that is the problem

  • Email and Calendar Portlets

    I am looking for some prebuilt portlets and associated JSPs that will allow
    access to a mail server using Java Mail. I could not find anything on the
    developer center and was hoping that someone might have a catalog of off the
    shelf portlets somewhere. A calendaring portlet would be pretty useful as
    well.

    My install was on Redhat 7.3 from the iso disk images available on redhat.com. I considered downgrading my kernel, but I'm not that strong with Linux so worked with what I had. The only linux change I made was to install a ksh rpm which is mandatory. I had changed kernel parameters but don't think that it really matters for installation purposes.
    The install that I have running at the moment was the simplest I could think of and only has an infrastructure tier and a middle tier, and I installed in the midtier install, portal, wireless and calendar. For both installs I change genclntsh as has been referenced in other notes in this forum. After my infrastructure install I made modifications to the listener, http, https and ldap components of the install. I also rebooted between midtier and infrastructure installs, and then started infrastructure components manually. I also deleted /etc/emtab file so that Enterprise Manager will be installed for the midtier. None of this seems to be documented very well in any of the Install guides/release notes etc, and I only got there with some help from other people who have access to MetaLink. Further there is nothing documented about how to stop/start/verify an OCS installation. Anyway, once the required infrastructure components are started, the midtier install seems to run fine, although for some reason I sometimes have to copy extproc from the infrastructure bin directory to the midtier bin directory.
    Anyway, I got it running eventually and the calendar server seems to be doing what I want but it was a lot of effort for not much value above the plain infrastructure if you ask me. I'm confused why there needs to be three tiers anyway, as the infra and midtiers especially seem to install the same things. Couldn't they two tiers have been consolidated in some way?
    I would be interested in what other people percieve as the value of collaboration suite and how they are planning on using it.
    regards,
    Anthony.

  • Error while executing a stored procedure from forms6i

    When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
    But when I execute the same from the FORMs 6i I get the following error:
    PDE-PLU022 Don't have access to the stored program unit
    XMLPARSERCOVER in schema CARE.
    where XMLPARSERCOVER is the class and
    CARE is the schema.
    Regards,
    Jignesh S

    I have tried this with both the owner of the schema and the intended user, -from both forms and directly.
    All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
    -however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
    I have no public synonym for the procedure, -is that necessary?
    The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
    Any ideas?

  • Error while calling a procedure from ESB

    Hi,
    I am calling a procedure from ESB using DB adapter. and in the routing rules i am mapping the i/p values for schema to procedure input variables using mappings(transformation) but the values are going as null to the procedure call.
    Please help me out.
    The exception follows...
    An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: esb:///ESB_Projects/ESB-Issues_issue3/db3.wsdl [ db3_ptt::db3(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'db3' failed due to: Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the SYSTEM.INSERT_ISSUE_PROC API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
    ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16
    ORA-06512: at line 1
    [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
    ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is likely being caused by a problem that we've seen a number of times. You'll have namespace issues and problems with NULLs if your JDev is 10.1.3.1 and SOA is 10.1.3.3 (or vice-versa). You MUST synchronize JDev 10.1.3.3 (or higher) with SOA 10.1.3.3 (or higher). It doesn't matter if you mix 10.1.3.3 and 10.1.3.4. You just need to get away from 10.1.3.1.

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Get date from Calendar Promt

    Hi Experts,
    Is it possible to get date from Calendar Prompt when operator is "greater then or equal to". In this setting I can not set presentation variable for prompt, why? There is other way to get selected date?
    Thanks in advance for any suggestion
    Regards,
    Esk

    Eskarina wrote:
    Hi Experts,
    Is it possible to get date from Calendar Prompt when operator is "greater then or equal to". In this setting I can not set presentation variable for prompt, why? There is other way to get selected date?
    Thanks in advance for any suggestion
    Regards,
    EskThe reason the Set Variable piece disappears is because a presentation variable cannot contain multiple values. If you want to perform a calculation on a date to filter your report, do this:
    1) Keep the Operator as "is equal to/is in."
    2) Now set your PV to what you want.
    3) In your report, build a CASE statement or use the TIMESTAMPADD function to make whatever calculation you want.
    Example: Let's suppose you wanted to filter your report for all Sales Dates "greater than or equal to" the prompt selection. You would set the date prompt to "equal" a date a user selects and then save it to your Presentation Variable, say pv_SalesDate.
    Now in your report on your Sales Date column, put a filter like this:
    tablename."Sales Date" >= '@{pv_SalesDate}'
    This will achieve what you are looking for.

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • Unable to call a procedure from inside a another procedure

    Dear members
    I am trying to call a procedure from inside an another procedure.Both the procedures are present within the same package.I am trying to call the second procedure just before the end of the first procedure.Both the procedures are compiling fine but the tables are not getting populated inside the second procedure.Also the DBMS_OUTPUT statements present in second procedures are not getting displayed.(I feel the second procedured is not getting called).
    The package specification is as follows:
    CREATE OR REPLACE package ANVESH.conv_api_pkg
    is
        PROCEDURE PROC_CONVERSION_API(FILE_PATH IN VARCHAR2,FILE_NAME IN VARCHAR2) ;
        TYPE cts_order_details IS TABLE OF XXCTS_ORDER_DETAILS_STG%ROWTYPE;
        PROCEDURE proc_conversion_api2(p_orderdetails IN cts_order_details) ;
    end conv_api_pkg;The package body is as follows:
    CREATE OR REPLACE package body ANVESH.conv_api_pkg
    is
    PROCEDURE PROC_CONVERSION_API(FILE_PATH IN VARCHAR2,FILE_NAME IN VARCHAR2)
    IS
        v_file_type utl_file.file_type;
        v_buffer VARCHAR2(1000);
        V_CUSTOMER_NAME VARCHAR2(100);
        V_MANUFACTURER VARCHAR2(100);
        V_PRODUCT_NAME VARCHAR2(100);
        V_QUANTITY NUMBER;
        V_REQ_SHIP_DATE DATE;
        V_REQ_PRICE NUMBER;
        V_LOG_FILE utl_file.file_type;
        V_COUNT_CUST NUMBER;
        V_COUNT_PROD NUMBER;
       L_ORDER_LINES CONV_API_PKG.cts_order_details:=CONV_API_PKG.cts_order_details();
    BEGIN
        DBMS_OUTPUT.PUT_LINE('Inside begin 1');
        v_file_type := UTL_FILE.fopen(FILE_PATH, FILE_NAME, 'r',null);
            DBMS_OUTPUT.PUT_LINE('Inside begin 1.1');
        LOOP
            BEGIN
                        DBMS_OUTPUT.PUT_LINE('Inside begin 2');
                         UTL_FILE.GET_LINE (v_file_type,v_buffer);
                        DBMS_OUTPUT.PUT_LINE('Inside begin 2.1');
                        DBMS_OUTPUT.PUT_LINE('the  buffer is '||v_buffer);
                        DBMS_OUTPUT.PUT_LINE('the length of buffer is '||length(v_buffer));
                         V_CUSTOMER_NAME := trim(substr(v_buffer, 1, 30));
                         DBMS_OUTPUT.PUT_LINE('Customer Name is '||V_CUSTOMER_NAME);
                         V_MANUFACTURER  := trim(substr(v_buffer, 31, 40));
                         DBMS_OUTPUT.PUT_LINE('Manufacturer is '||V_MANUFACTURER);
                         V_PRODUCT_NAME  := trim(substr(v_buffer,  71, 20));
                         DBMS_OUTPUT.PUT_LINE('Product Name is '||V_PRODUCT_NAME);
                         V_QUANTITY      := to_number(trim(substr(v_buffer, 91, 5)));
                         DBMS_OUTPUT.PUT_LINE('Quantity is '||V_QUANTITY);
                         V_REQ_SHIP_DATE     := to_date(trim(substr(v_buffer, 96, 20)), 'DD-MON-YYYY');
                         DBMS_OUTPUT.PUT_LINE('Requested Ship Date is '|| V_REQ_SHIP_DATE);
                        V_REQ_PRICE        :=nvl(substr( trim(v_buffer), 116, length(v_buffer)-116),0);
                        --DBMS_OUTPUT.PUT_LINE('Requested Price is1 '||substr(v_buffer, 116, 5));
                        DBMS_OUTPUT.PUT_LINE('The requested price is  '||V_REQ_PRICE);
                V_LOG_FILE := UTL_FILE.FOPEN(FILE_PATH, 'LOG_FILE.dat', 'A');
                    IF (V_QUANTITY > 0)
                     THEN
                     DBMS_OUTPUT.PUT_LINE('The quantity is '||V_QUANTITY);
                       SELECT COUNT (*)
                       INTO V_COUNT_CUST
                       FROM CONVERSION_CUSTOMERS
                       WHERE CUSTOMER_NAME = V_CUSTOMER_NAME;
                       DBMS_OUTPUT.PUT_LINE('The Customer count is '||V_COUNT_CUST);
                       IF(V_COUNT_CUST > 0)
                       THEN
                           SELECT COUNT(*)
                           INTO V_COUNT_PROD
                           FROM conversion_products
                           WHERE PRODUCT_NAME = V_PRODUCT_NAME;
                           DBMS_OUTPUT.PUT_LINE('The Product count is '||V_COUNT_PROD);
                          IF(V_COUNT_PROD >0)
                           THEN
                                INSERT INTO XXCTS_ORDER_DETAILS_STG VALUES (V_CUSTOMER_NAME, V_PRODUCT_NAME, V_MANUFACTURER, V_QUANTITY, V_REQ_SHIP_DATE, V_REQ_PRICE, 'ACTIVE', 'ORDER TAKEN');  
                           ELSE
                                DBMS_OUTPUT.PUT_LINE('PRODUCT SHOULD BE VALID');
                                UTL_FILE.PUT_LINE(V_LOG_FILE, 'PRODUCT SHOULD BE VALID');                   
                           END IF;
                       ELSE
                          DBMS_OUTPUT.PUT_LINE('CUSTOMER SHOULD BE VALID');
                          UTL_FILE.PUT_LINE(V_LOG_FILE, 'CUSTOMER SHOULD BE VALID');
                       END IF;      
                    ELSE
                        DBMS_OUTPUT.PUT_LINE('QUANTITY SHOULD BE VALID');
                        UTL_FILE.PUT_LINE(V_LOG_FILE, 'QUANTITY SHOULD BE VALID');
                    END IF;
                    EXCEPTION
                    WHEN NO_DATA_FOUND THEN
                        EXIT;
                    END;
        END LOOP;
    SELECT CUSTOMER_NAME, PRODUCT_NAME, MANUFACTURER, QUANTITY, REQUESTED_SHIP_DATE, REQUESTED_PRICE, STATUS,MESSAGE
    BULK COLLECT
    INTO L_ORDER_LINES
    FROM XXCTS_ORDER_DETAILS_STG;
    DBMS_OUTPUT.PUT_LINE('values inserted');
    proc_conversion_api2(p_orderdetails=>L_ORDER_LINES);
    END;
    PROCEDURE proc_conversion_api2(p_orderdetails IN cts_order_details)
      IS
      V_AVL_QUANTITY CONVERSION_PRODUCTS.AVL_QUANTITY%TYPE;
      V_REQ_SHIP_DATE DATE;
      V_LIST_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
      V_NET_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
      V_NET CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
      V_EXTN_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
      V_CUST_DISC CONVERSION_CUSTOMERS.DISCOUNT%TYPE;
      V_CERT_DISC CONVERSION_CERTIFICATION.DISCOUNT%TYPE;
      V_CUST_ID XXCTS_ORDER_DETAILS.CUSTOMER_ID%TYPE;
      V_PROD_ID XXCTS_ORDER_DETAILS.PRODUCT_ID%TYPE;
      V_DISC_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
      V_DISC_NAME CONVERSION_CERTIFICATION.CERTIFICATION%TYPE;
      V_TOTAL_DISC_AMT NUMBER;
      V_TOTAL_DISC NUMBER;
      V_LIMIT NUMBER;
    BEGIN
        DBMS_OUTPUT.PUT_LINE('INSIDE API_2 BEGIN 1');
            FOR i IN p_orderdetails.FIRST..p_orderdetails.LAST
            LOOP
                 BEGIN
                DBMS_OUTPUT.PUT_LINE('INSIDE API_2 BEGIN 2');
                SELECT PRODUCT_ID,AVL_QUANTITY,LIST_PRICE
                INTO V_PROD_ID,V_AVL_QUANTITY,V_LIST_PRICE
                FROM CONVERSION_PRODUCTS
                WHERE PRODUCT_NAME=p_orderdetails(i).PRODUCT_NAME;
                DBMS_OUTPUT.PUT_LINE('PRODUCT QUANTITY is '||V_PROD_ID);
                DBMS_OUTPUT.PUT_LINE('AVAILABLE QUANTITY is '||V_AVL_QUANTITY);
                DBMS_OUTPUT.PUT_LINE('LIST PRICE is '||V_LIST_PRICE);
                SELECT CUSTOMER_ID,NVL(DISCOUNT,0)
                INTO V_CUST_ID,V_CUST_DISC
                FROM CONVERSION_CUSTOMERS
                WHERE CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
                DBMS_OUTPUT.PUT_LINE('CUSTOMER ID is '||V_CUST_ID);
                DBMS_OUTPUT.PUT_LINE('CUSTOMER DISCOUNT IS '||V_CUST_DISC);
                SELECT A.DISCOUNT,A.CERTIFICATION
                INTO  V_CERT_DISC,V_DISC_NAME
                FROM CONVERSION_CERTIFICATION A,CONVERSION_CUSTOMERS B
                WHERE A.CERTIFICATION=B.CERTIFICATION(+)
                AND B.CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
                DBMS_OUTPUT.PUT_LINE('CERTIFICATION DISCOUNT IS '||V_CERT_DISC);
                V_NET:=((V_LIST_PRICE)-(V_LIST_PRICE)*(V_CERT_DISC)/100);
                DBMS_OUTPUT.PUT_LINE('NET PRICE AFTER CERTIFICATION DISCOUNT IS '||V_NET);
                V_NET_PRICE:=((V_NET)-(V_NET)*(V_CUST_DISC)/100);
                DBMS_OUTPUT.PUT_LINE('NET PRICE AFTER COMPLETE DISCOUNT IS '||V_NET_PRICE);
                V_EXTN_PRICE:=(V_NET_PRICE)*(p_orderdetails(i).QUANTITY);
                DBMS_OUTPUT.PUT_LINE('EXTENDED PRICE IS '||V_EXTN_PRICE);
                V_TOTAL_DISC:=((V_CERT_DISC)/100+(V_CUST_DISC)/100);
                DBMS_OUTPUT.PUT_LINE('TOTAL DISCOUNT IS '|| V_TOTAL_DISC);
                V_TOTAL_DISC_AMT:=(V_LIST_PRICE)-(V_NET_PRICE);
                DBMS_OUTPUT.PUT_LINE('TOTAL DISCOUNT PRICE IS '|| V_TOTAL_DISC_AMT);
                SELECT MAX(A.LIMIT)
                INTO V_LIMIT
                FROM CONVERSION_CERTIFICATION A,CONVERSION_CUSTOMERS B
                WHERE A.CERTIFICATION=B.CERTIFICATION(+)
                AND B.CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
                IF p_orderdetails(i).QUANTITY<V_AVL_QUANTITY THEN
                INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'QTY HOLD','REQ QNTY LESS THAN AVL QTY',SYSDATE);
                INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
                END IF;
                IF p_orderdetails(i).REQUESTED_SHIP_DATE<SYSDATE THEN
                INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'DATE HOLD','SHIPDATE CANNOT BE LESS THAN CURR DATE',SYSDATE);
                INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
                END IF;
                IF V_NET_PRICE>p_orderdetails(i).REQUESTED_PRICE THEN
                INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'PRICE HOLD','NET PRICE CANNOT BE MORE THAN REQ PRICE',SYSDATE);
                INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
                END IF;
               /* IF V_LIMIT<p_orderdetails(i).REQUESTED_PRICE THEN
                INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'ORDER LIMIT HOLD','PRICE CANNOT EXCEED ORDER LIMIT',SYSDATE);
                INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
                END IF;*/
                EXCEPTION
                WHEN NO_DATA_FOUND THEN
                DBMS_OUTPUT.PUT_LINE(' INSIDE EXCEPTION BLOCK');
                END;
            END LOOP;
    END;
    end conv_api_pkg;
    /the pl/sql block to invoke the the procedure :
    declare
    begin
    PROC_CONVERSION_API('/usr/tmp' ,'Walmart_Orders_062908.dat');
    end;please let me know what is wrong in the program.
    Thanks
    Anvesh

    Hi Walter
    Yes 'Inside begin 1' and 'Inside begin 2' were printed.Please find the the DBMS_OUTPUT statements that were printed.
    Inside begin 1
    Inside begin 1.1
    Inside begin 2
    Inside begin 2.1
    the  buffer is BESTBUY                       SONY ERICSSON                           W580i               25   1-AUG-2008          50
    the length of buffer is 118
    Customer Name is BESTBUY
    Manufacturer is SONY ERICSSON
    Product Name is W580i
    Quantity is 25
    Requested Ship Date is 01-AUG-08
    The requested price is  50
    The quantity is 25
    The Customer count is 1
    The Product count is 0
    PRODUCT SHOULD BE VALID
    Inside begin 2
    Inside begin 2.1
    the  buffer is BESTBUY                       SAMSUNG                                 BLACKJACK           50   15-JUL-2008         150
    the length of buffer is 119
    Customer Name is BESTBUY
    Manufacturer is SAMSUNG
    Product Name is BLACKJACK
    Quantity is 50
    Requested Ship Date is 15-JUL-08
    The requested price is  150
    The quantity is 50
    The Customer count is 1
    The Product count is 1
    Inside begin 2
    Inside begin 2.1
    the  buffer is BESTBUY                       APPLE                                   IPHONE 4GB          50   15-JUL-2008        
    the length of buffer is 116
    Customer Name is BESTBUY
    Manufacturer is APPLE
    Product Name is IPHONE 4GB
    Quantity is 50
    Requested Ship Date is 15-JUL-08
    The requested price is  0
    The quantity is 50
    The Customer count is 1
    The Product count is 1
    Inside begin 2
    Inside begin 2.1
    the  buffer is BESTBUY                       ATT                                     TILT                100  15-JUN-2008        
    the length of buffer is 116
    Customer Name is BESTBUY
    Manufacturer is ATT
    Product Name is TILT
    Quantity is 100
    Requested Ship Date is 15-JUN-08
    The requested price is  0
    The quantity is 100
    The Customer count is 1
    The Product count is 1
    Inside begin 2
    Inside begin 2.1
    the  buffer is BESTBUY                       NOKIA                                   N73                 50   15-JUL-2008         200
    the length of buffer is 118
    Customer Name is BESTBUY
    Manufacturer is NOKIA
    Product Name is N73
    Quantity is 50
    Requested Ship Date is 15-JUL-08
    The requested price is  20
    The quantity is 50
    The Customer count is 1
    The Product count is 0
    PRODUCT SHOULD BE VALID
    Inside begin 2In the first procedure I am trying to read the data from a flat file and store it in a table.Here is the sample data from the flat file.
    BESTBUY                       SONY ERICSSON                           W580i               25   1-AUG-2008          50
    BESTBUY                       SAMSUNG                                 BLACKJACK           50   15-JUL-2008         150
    BESTBUY                       APPLE                                   IPHONE 4GB          50   15-JUL-2008        
    BESTBUY                       ATT                                     TILT                100  15-JUN-2008        
    BESTBUY                       NOKIA                                   N73                 50   15-JUL-2008         200When tried to execute the second procedure independently using the PL/SQL block,the tables in second procedure were populated and the DBMS_Output statements were also displayed.I have made use of the same query in that case
    Thanks
    Anvesh
    Edited by: Anvesh Reddy on Dec 23, 2008 12:40 PM

Maybe you are looking for

  • Groupwise 7 Gateway for Exchange

    I am testing the Novell Groupwise Gateway for Exchange SP2. I have already tested the API Gateway but wanted to try the newer version because it will be supported for awhile. I downloaded the install and went through all the instructions. I am using

  • Hard disk failure but now I have no boot cd

    Hi, I had a hard disk failure, I have swapped out the hard disk but now have no boot DVD and of course I have lost the recovery partition. I have tried to make a boot memory stick from my mac mini but when trying to re install it just says there is a

  • Report on user wise application wise page views

    How to get the application and user wise page view report in apex? Sanjay

  • How can I enable GUI in WAAS Stand By Central Manager

    Hi guys, I'm testing the stand by central manager, the situation is as follows: When the active central manager goes down I try to access the GUI in stand by central manager but it always sends me the following error Graphical user interface is not e

  • Theme Editor no showing content.

    Short description of the problem: When I select "Theme Editor", no content is displayed. Long Desc: I imported a theme developed on portal version sp15. When I select the Theme Editor link, not even the list of themes are displayed. I get the followi