Packages in plsql

Hi !
Please tel, what are the places packages are used in real life.
i have read about them in detail in plsql ref but would like to know ,
that what are the places packages are used in real life, or have been used in real life.
yours sincerely
Edited by: 944768 on Aug 18, 2012 9:29 PM

944768 wrote:
i have read about them in detail in plsql ref but would like to know ,
that what are the places packages are used in real life, or have been used in real life.PL/SQL packages are called units in Pascal. Libraries in C/C++. It is a very common feature in most programming languages.
The purpose of a unit is modularisation and abstraction.
Modularisation - create a unit of code that consists of multiple modules (procedures and functions). E.g. a unit of code (package) that formats an e-mail and delivers the e-mail to a SMTP server.
Abstraction - this code unit presents a public interface and hides the implementation. This abstracts the implementation of the code unit (e.g. how to format an e-mail) from the caller. Instead the caller simply deals with the interface that the code unit provides.
Modularisation and abstraction are basic software engineering concepts. I suggest that you hit your favourite search engine and research these concepts. You cannot develop software successfully and not understand these concepts.

Similar Messages

  • Crystal report hangs when calling oracle package

    hi i have a oracle package that calls a proceadure, if i test this package in PLSQL developer it compiles and i get sensible results
    this package has been designed using a ref type cursor to be called from crystal reports. it primary objective when the report is run, is to use File util to output data to an xml file.
    when i run this from crystal reports it locks crystal reports up, and dosent output a file.
    any ideas why crystal is hanging?
    crystal DB call
    {CALL  Enhanced_Pharos_Report.run_report
    (NVL({?a_channel_id},0),{?b_on_date})}
    package
    create or replace package UKTV_PHAROS_EXPORT_RPT
    -- Author : WARDLJ01
    -- Created : 03/04/2006 12:25:03
    -- Purpose : export xml for pharos voiceovers
    -- Public type declarations
    AS
    TYPE result_set_type IS REF CURSOR;
    PROCEDURE run_report
    (main_cursor IN OUT result_set_type,
    V_CHANNEL_ID NUMBER,
    V_ONDATE      DATE);
    end ;--UKTV_PHAROS_EXPORT_RPT;
    package body
    create or replace package body UKTV_PHAROS_EXPORT_RPT AS
    PROCEDURE run_report
    (main_cursor IN OUT result_set_type,
    V_CHANNEL_ID NUMBER,
    V_ONDATE      DATE)
    is
    BEGIN
    OPEN main_cursor FOR
    -- Passess the parameters back to the cursor - which passes them back to the Crystal Report output
    SELECT V_CHANNEL_ID, V_ONDATE from DUAL;
    -- This is a procedure that calls FILE_UTL to export the data.
    UKTV_PHAROS_Export(V_CHANNEL_ID, V_ONDATE);
    END;
    end;
    Proceadure
    create or replace procedure uktv_own.UKTV_Pharos_Export(V_CHANNEL_ID number, V_ONDATE date) is
    l_output utl_file.file_type;
    p_filename varchar2(30);
    V_DETAIL_id varchar2(100);
    V_MEDIA_ID varchar2(150);
    V_REQUIRED varchar2(50);
    V_SCRIPT varchar2(4000);
    V_DEL_DATE varchar2(100);
    V_FULLMEDIA_ID varchar2(500);
    V_START_TIME varchar2(100);
    V_DURATION varchar2(100);
    V_DATE varchar2(100);
    V_CHANNEL varchar2(40);
    V_LOGO_NAME varchar2(250);
    Cursor VO_CURSOR
    IS
    select event_voiceover.detail_id, vo_media_id, vo_required, vo_script, vo_del_date, full_media_id,
    event.start_time, event.duration, event.on_date, event.channel_id, logo.logo_name
    from event_voiceover,
    onair.event, onair.event_technical_data,
    onair.logo
    where event_voiceover.detail_id = event.detail_id
    and event_technical_data.event_technical_data_id = event.event_technical_data_id
    and event_technical_data.content_id = logo.logo_id and
    event.channel_id = V_CHANNEL_ID and
    vo_required = 500004580 and
    event.on_date = V_ONDATE;
    begin
    p_filename :='voice_overs.xml';
    l_output := utl_file.fopen ('PHAROS_DIR', p_filename, 'w' );
    OPEN VO_CURSOR;
    utl_file.put ( l_output,'<Voice_Overs>');
    Loop
    FETCH VO_CURSOR INTO V_DETAIL_id, V_MEDIA_ID, V_REQUIRED,V_SCRIPT, V_DEL_DATE, V_FULLMEDIA_ID, V_START_TIME, V_DURATION, V_DATE, V_CHANNEL, V_LOGO_NAME;
    EXIT WHEN VO_CURSOR%NOTFOUND
    OR VO_CURSOR%ROWCOUNT = 10000;
    utl_file.put( l_output, '<DETAIL_ID>');
    utl_file.put( l_output, V_DETAIL_ID);
    utl_file.put( l_output, '</DETAIL_ID>');
    utl_file.put( l_output, '<MEDIA_ID>');
    utl_file.put( l_output, V_MEDIA_ID);
    utl_file.put( l_output, '</MEDIA_ID>');
    utl_file.put( l_output, '<REQUIRED>');
    utl_file.put( l_output, V_REQUIRED);
    utl_file.put( l_output, '</REQUIRED>');
    utl_file.put( l_output, '<SCRIPT>');
    utl_file.put( l_output, V_SCRIPT);
    utl_file.put( l_output, '</SCRIPT>');
    utl_file.put( l_output, '<DEL_DATE>');
    utl_file.put( l_output, V_DEL_DATE);
    utl_file.put( l_output, '</DEL_DATE>');
    utl_file.put( l_output, '<FULLMEDIA_ID>');
    utl_file.put( l_output, V_FULLMEDIA_ID);
    utl_file.put( l_output, '</FULLMEDIA_ID>');
    utl_file.put( l_output, '<START_TIME>');
    utl_file.put( l_output, V_START_TIME);
    utl_file.put( l_output, '</START_TIME>');
    utl_file.put( l_output, '<DURATION>');
    utl_file.put( l_output, V_DURATION);
    utl_file.put( l_output, '</DURATION>');
    utl_file.put( l_output, '<ONDATE>');
    utl_file.put( l_output, V_DATE);
    utl_file.put( l_output, '</ONDATE>');
    utl_file.put( l_output, '<CHANNEL_ID>');
    utl_file.put( l_output, V_CHANNEL);
    utl_file.put( l_output, '</CHANNEL_ID>');
    utl_file.put( l_output, '<LOGO_NAME>');
    utl_file.put( l_output, V_LOGO_NAME);
    utl_file.put( l_output, '</LOGO_NAME>');
    utl_file.new_line ( l_output);
    end loop;
    utl_file.put ( l_output,'</Voice_Overs>');
    utl_file.fclose(l_output);
    end UKTV_Pharos_Export;

    Hi yes the package uses fileutil to output a file,
    the report user has permission over the file util output directory.
    I have previously used this method to generate rpt, and other output files in parelell.
    thanks
    james

  • Built in packages

    Hi need to learn about the Buil-in packages in plsql.please provide me any site conatains docs
    Regards

    http://tahiti.oracle.com/
    Oracle® Database PL/SQL Packages and Types Reference
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/toc.htm
    Gints Plivna
    http://www.gplivna.eu

  • Sample package

    Hi every body
    I am learning plsql.I am new to this plsql programing.please kindly help me.I am trying to develop packages in plsql developer.But when i create package spec i am getting error oracle is not connected.in the help topic we need to give the html file path,
    please kindly help me and let me know asap
    Give me sample package cover all the functionalites pls.
    thank Q

    In the Error message doc you can find the error code you are getting and check what it means..
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14219/toc.htm
    if you're stuck, provide more info about your error message, and hopefully someone in this forum knows what to do!
    PL/SQL samples:
    http://www.oracle.com/technology/sample_code/tech/pl_sql/index.html
    cheers
    -per

  • Doubt in erorhandling package

    /* Formatted by PL/Formatter v3.1.2.1 on 2000/12/02 15:32 */
    DROP TABLE errlog;
    CREATE TABLE errlog (
    errcode INTEGER,
    errmsg VARCHAR2(4000),
    created_on DATE,
    created_by VARCHAR2(100)
    CREATE OR REPLACE PACKAGE err
    IS
    c_table CONSTANT PLS_INTEGER := 1; -- Default
    c_file CONSTANT PLS_INTEGER := 2;
    c_screen CONSTANT PLS_INTEGER := 3;
    PROCEDURE handle (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL,
    logerr IN BOOLEAN := TRUE,
    reraise IN BOOLEAN := FALSE
    PROCEDURE raise (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL
    PROCEDURE log (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL
    PROCEDURE logto (
    target IN PLS_INTEGER,
    dir IN VARCHAR2 := NULL,
    file IN VARCHAR2 := NULL
    FUNCTION logging_to
    RETURN PLS_INTEGER;
    END;
    CREATE OR REPLACE PACKAGE BODY err
    IS
    g_target PLS_INTEGER := c_table;
    g_file VARCHAR2 (2000) := 'err.log';
    g_dir VARCHAR2 (2000) := NULL;
    PROCEDURE handle (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL,
    logerr IN BOOLEAN := TRUE,
    reraise IN BOOLEAN := FALSE
    IS
    BEGIN
    IF logerr
    THEN
    log (errcode, errmsg);
    END IF;
    IF reraise
    THEN
    err.raise (errcode, errmsg);
    END IF;
    END;
    PROCEDURE raise (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL
    IS
    l_errcode PLS_INTEGER := NVL (errcode, SQLCODE);
    l_errmsg VARCHAR2(1000) := NVL (errmsg, SQLERRM);
    BEGIN
    IF l_errcode BETWEEN -20999 AND -20000
    THEN
    raise_application_error (l_errcode, l_errmsg);
    /* Use positive error numbers -- lots to choose from! */
    ELSIF l_errcode > 0
    AND l_errcode NOT IN (1, 100)
    THEN
    raise_application_error (-20000, l_errcode || '-' || l_errmsg);
    /* Can't EXCEPTION_INIT -1403 */
    ELSIF l_errcode IN (100, -1403)
    THEN
    RAISE NO_DATA_FOUND;
    /* Re-raise any other exception. */
    ELSIF l_errcode != 0
    THEN
    PLVdyn.plsql ('DECLARE myexc EXCEPTION; ' ||
    ' PRAGMA EXCEPTION_INIT (myexc, ' ||
    TO_CHAR (l_errcode) ||
    ');' ||
    'BEGIN RAISE myexc; END;'
    END IF;
    END;
    PROCEDURE log (
    errcode IN PLS_INTEGER := NULL,
    errmsg IN VARCHAR2 := NULL
    IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    l_sqlcode pls_integer := NVL (errcode, SQLCODE);
    l_sqlerrm VARCHAR2(1000) := NVL (errmsg, SQLERRM);
    BEGIN
    IF g_target = c_table
    THEN
    INSERT INTO errlog
    (errcode, errmsg, created_on, created_by)
    VALUES (
    l_sqlcode,
    l_sqlerrm,
    SYSDATE,
    USER
    ELSIF g_target = c_file
    THEN
    DECLARE
    fid UTL_FILE.file_type;
    BEGIN
    fid := UTL_FILE.fopen (g_dir, g_file, 'A');
    UTL_FILE.put_line (fid,
    'Error log by ' || USER || ' at ' ||
    TO_CHAR (SYSDATE, 'mm/dd/yyyy')
    UTL_FILE.put_line (fid, NVL (errmsg, SQLERRM));
    UTL_FILE.fclose (fid);
    EXCEPTION
    WHEN OTHERS
    THEN
    UTL_FILE.fclose (fid);
    END;
    ELSIF g_target = c_screen
    THEN
    DBMS_OUTPUT.put_line ('Error log by ' || USER || ' at ' ||
    TO_CHAR (SYSDATE, 'mm/dd/yyyy')
    DBMS_OUTPUT.put_line (NVL (errmsg, SQLERRM));
    END IF;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    END;
    PROCEDURE logto (
    target IN PLS_INTEGER,
    dir IN VARCHAR2 := NULL,
    file IN VARCHAR2 := NULL
    IS
    BEGIN
    g_target := target;
    g_file := file;
    g_dir := dir;
    END;
    FUNCTION logging_to
    RETURN PLS_INTEGER
    IS
    BEGIN
    RETURN g_target;
    END;
    END;
    in this package
    PLVdyn.plsql ('DECLARE myexc EXCEPTION; ' ||
    ' PRAGMA EXCEPTION_INIT (myexc, ' ||
    TO_CHAR (l_errcode) ||
    ');' ||
    'BEGIN RAISE myexc; END;'
    is used.actuallyi got this code for oracle best practices.but i am not getting the code for PLVdyn code.is it built package or private package.i want the code for PLYdyn.plsql code

    user10447332 wrote:
    in this package
    PLVdyn.plsql ('DECLARE myexc EXCEPTION; ' ||
    ' PRAGMA EXCEPTION_INIT (myexc, ' ||
    TO_CHAR (l_errcode) ||
    ');' ||
    'BEGIN RAISE myexc; END;'
    is used.actuallyi got this code for oracle best practices.but i am not getting the code for PLVdyn code.is it built package or private package.i want the code for PLYdyn.plsql codeOk, so yesterday you took some 3rd party code for error handling but didn't know what to do with it.
    Now it looks like you've taken some more code from somewhere else but you haven't got the full thing.
    PLVdyn is not a built in Oracle package, so wherever you obtained the rest of the code would be a good place to start looking for the source for it.
    Of course, producing dyanamic PL/SQL is not really a good thing to do and makes applications a nightmare to debug and maintain. If you don't understand the basics then you really shouldn't be trying something so complex. Is this for homework like we thought yesterday or is it (scary thought) coding for a business contract you have obtained without the necessary skills?

  • PO Interface migrate 11i to R12

    Hi All,
    We are migrating PO Standard (open) from 11i to R12.
    The questions are.
    1. How could we map PO_HEADERS_ALL in 11i to PO_HEADERS_INTERFACE in R12?
    same with, PO_LINES_ALL and PO_DISTRIBUTIONS_ALL in 11i to PO_LINES_INTERFACE, PO_DISTRIBUTIONS_INTERFACE.
    2. We run used the Import Standard Purchase Orders for the interfacing, we encountered error,
    here:
    ORA-20001: APP-PO-14142: PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow-010: ORA-20001: START_WORKFLOW_EXCEPTION-0: PO_SHARED_PROC_PVT.get_ou_and_coa_from_inv_org
    Cause:        A SQL error has occurred in PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow.  in Package po.plsql.PO_PDOI_DIST_PROCESS_PVT. Procedure default_dists.60
    ORA-20001: APP-PO-14142: PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow-010: ORA-20001: START_WORKFLOW_EXCEPTION-0: PO_SHARED_PROC_PVT.get_ou_and_coa_from_inv_org
    Cause:        A SQL error has occurred in PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow.  in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_distributions.50
    ORA-20001: APP-PO-14142: PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow-010: ORA-20001: START_WORKFLOW_EXCEPTION-0: PO_SHARED_PROC_PVT.get_ou_and_coa_from_inv_org
    Cause:        A SQL error has occurred in PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow.  in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process.40
    ORA-20001: APP-PO-14142: PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow-010: ORA-20001: START_WORKFLOW_EXCEPTION-0: PO_SHARED_PROC_PVT.get_ou_and_coa_from_inv_org
    Cause:        A SQL error has occurred in PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow.  in Package po.plsql.PO_PDOI_PVT. Procedure start_process.110
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
       Need your help.
    Thanks,
    alex cross

    Any help pls.

  • Re: Error in submitting Import Standard Purchase orders from Pl/Sql

    Hi All,
    Iam using the following code to submit a concurret program
    "Import Standard Purchase orders" from pl/sql
    Program is sucessfully submittted but it is Completing in error status i am stuck there please help me in resolving this
    My instance R12
    My Code
    ======
    DECLARE
    v_request_id VARCHAR2 (100);
    BEGIN
    mo_global.set_policy_context ('S', 204); --org_id for the operating unit which the purchase order records belong too
    mo_global.init ('PO'); -- sets the application
    FND_GLOBAL.APPS_INITIALIZE (1013436, 50578, 201); --Consists of the user_id, responsibility_id, responsibility_application_id which is 201 for purchasing
    v_request_id :=
    fnd_request.submit_request (application => 'PO',
    program => 'POXPOPDOI',
    description => NULL,
    start_time => NULL, -- To start immediately
    sub_request => FALSE,
    argument1 => '31348', -- Buyer_ID
    argument2 => 'STANDARD', -- Doc Type
    argument3 => '', -- doc subtype
    argument4 => 'N', -- update items
    argument5 => '', -- create sourcing rules not used
    argument6 => 'INCOMPLETE', -- Approval status
    argument7 => '', -- release generation method
    argument8 => '1021387', -- batch_id
    argument9 => '', -- operating unit null
    argument10 => '', -- global agreement null
    argument11 => '', -- enable sourcing null
    argument12 => '', -- sourcing level null
    argument13 => '', -- inv org enabled null
    argument14 => '' -- inv org null
    DBMS_OUTPUT.put_line ('Request submitted. ID = ' || v_request_id);
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line (
    'Request set submission failed - unknown error: ' || SQLERRM
    END;
    output
    =====
    when i check output i am getting the follwing error
    DECLARE
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at line 133
    Log message
    ==========
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    31348
    STANDARD
    N
    INCOMPLETE
    1021387
    Start of log messages from FND_FILE
    To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
    AUDSID = 945297
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure init_sys_parameters.0
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure init_startup_values.10
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure start_process.50
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    End of log messages from FND_FILE
    Thanks
    Manoj kumar

    Pass NULL instead of ''
    Check the flag
    SELECT multi_org_category
      FROM fnd_concurrent_programs
    WHERE concurrent_program_name = 'POXPOPDOI'Update it as per the below MOS Doc
    R12 / POXPOPDOI - 'ORA-01422' Error While Running 'Import Standard Purchase Orders' [ID 457628.1]
    Otherwise,
    Follow the below doc and insert values to the interface tables (headers, lines and distribution) and run the Import Standard Purchase Orders from the front end.
    How To Diagnose Problems With Importing Standard Purchase Orders [ID 781351.1]
    HTH
    Cheers,
    ND
    Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered.

  • No data found error while creating po using interface

    Hi all,
    I am a beginner in Oracle applications. I am trying to create a PO and line using interface tables.
    I am getting the below error when I run my concurrent program:
    I do see my records in my staging tables and in PO HEADERS INTERFACE and
    PO LINES INTERFACE table and there are no errors in the my sql loader programs.
    However there is an error in Import Standard Purchase Orders program:
    The below is the error from log:
    ora nodata found in package PO.PLSQL.PO_PDOI_PVT
    user defined exception in package PO.PLSQL.PO_PDOI_CONCURRENT
    There is no record in fng log messages table with the AUDSID provided in the log file!
    I am not sure what to do.
    Any suggestions?
    Thanks.

    Hi.
    Can you please advise the value for column "PROCESS_CODE" in the PO_HEADERS_INTERFACE table? Did you check the Purchasing Interface Errors report also for any errors?
    Additionally, it will help if you can copy/paste the insert code for the interface tables ....
    A good detailed explanation of the Purchase Order interface is in the following document:
    http://docs.oracle.com/cd/A85683_01/acrobat/115mfgoim.pdf
    See if that helps.
    Cheers
    JD

  • Error While submitting Import Standard Purchase Order Concurrent Program

    Hello All,
    When I am trying to submit Import Standard Purchase Order Concurrent Program from front end, it gets submitted properly.
    and from backend,I am getting Following error.
    To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
    AUDSID = 27810853
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure init_sys_parameters.0
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure init_startup_values.10
    ORA-01403: no data found in Package po.plsql.PO_PDOI_PVT. Procedure start_process.50
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    When I looked in Parameters in both program(manually submitted and called from backend) I found a difference.
    difference is Parameter Operating Unit. It not get submitted while program calling from backend.
    Please anybody tell me solution for this. for setting this parameter.
    (Also I have applied for patch 13001705 as per Metalink suggested).
    Thanks in advance.
    Regards
    Ravi Raj.
    Edited by: Ravi Raj on Jan 23, 2013 10:50 PM

    Please paste the code here.. there may be some parameter issue while submission.

  • Getting error after submitting import standard purchase order from localization responsibility

    Hi All,
    I have manully inserted data in header,line,distribution interface table like below
    INSERT INTO po_headers_interface
    (interface_header_id,process_code,action,org_id,document_type_code,document_num,currency_code,vendor_name,vendor_id,vendor_site_code,vendor_site_id,comments,
    vendor_doc_num,amount_agreed,effective_date,expiration_date,vendor_contact,approval_status,terms_id,agent_id,creation_date,created_by,last_update_date,last_updated_by)
    VALUES  
    (po_headers_interface_s.NEXTVAL,'PENDING','ORIGINAL','7046','STANDARD','454545','INR','Madhura Enterprises','40179',NULL,'13922','XYZ',null,null,sysdate,sysdate+10,null,
    'Approved',13922,25,SYSDATE,fnd_global.user_id,SYSDATE,fnd_global.user_id);
    INSERT INTO po_lines_interface
    (interface_line_id,interface_header_id,process_code,line_num,item_id,item_description,uom_code,unit_of_measure,quantity,unit_price,ship_to_organization_id,ship_to_location_id,
    need_by_date,promised_date,last_update_date,last_updated_by,creation_date,created_by,line_type_id,vendor_product_num,note_to_vendor,shipment_num,closed_code,closed_reason,CATEGORY_id,tax_code_id)
    VALUES
    (po_lines_interface_s.NEXTVAL,po_headers_interface_s.CURRVAL,'PENDING',1,'208956','ESSEL CAPITAL ITEM','Ea','Each',2,100,'7087',
    '22885',SYSDATE+1,SYSDATE+1,SYSDATE,fnd_global.user_id,SYSDATE,fnd_global.user_id,'1',NULL,'aaaaaa','1',NULL,NULL,'1','1000');
    INSERT INTO po_distributions_interface
    (interface_header_id,interface_line_id,interface_distribution_id,distribution_num,quantity_ordered,quantity_delivered,quantity_billed,quantity_cancelled,destination_type_code,deliver_to_location_id,
    deliver_to_person_id,charge_account,charge_account_id,creation_date,created_by,project_id,expenditure_item_date)
    VALUES
    (po_headers_interface_s.CURRVAL,po_lines_interface_s.CURRVAL,po_distributions_interface_s.NEXTVAL,'1','2',NULL,NULL,NULL,
    'INVENTORY','22885','24',NULL,'134793',SYSDATE,fnd_global.user_id,NULL,NULL);
    When i am submitting the standard program then i am getting following error---
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ERR_UTL. Procedure add_fatal_error.0
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ITEM_PROCESS_PVT. Procedure update_master_item.60
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ITEM_PROCESS_PVT. Procedure create_items.60
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_lines_add.70
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_lines.10
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process.10
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_PVT. Procedure start_process.110
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    Please help me in this issue.. when i am running this on vision without tax code it is working fine.
    But in localization its not working. Basically i need to do scripting for india localization for Open PO.
    The application Details -
    RDBMS : 11.1.0.7.0
    Oracle Applications : 12.1.3

    please everyone do needful help on this..

  • Defaulting Rules using PL/SQL Api - ORA error

    Hi All,
    Iam using the PLSQL api for OM defaulting rules. Based on the item in the Sales order line, Line type has to be defaulted.
    I have put debug messages and iam able to see successful execution and the required Line type value is returned. No exception is raised.
    Error ORA-06502 PL/SQL numberic to value error. Character to number conversion error is thrown outside the custom package.
    PLSQL api is coded as below.
    CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
    G_PKG_NAME      CONSTANT VARCHAR2(30) := 'XX_DEFAULT_ORDERTYPE';
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2 IS
    l_trans_type VARCHAR2(30);
    -- l_item_id NUMBER := ONT_LINE_DEF_HDLR.g_record.ORDERED_ITEM_ID;
    BEGIN
    SELECT b.name
    INTO l_trans_type
    FROM OE_TRANSACTION_TYPES_tL b,
    oe_transaction_types_all a
    WHERE a.transaction_type_id=b.transaction_type_id
    AND attribute1=ONT_LINE_DEF_HDLR.g_record.INVENTORY_ITEM_ID;
    RETURN l_trans_type;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN l_trans_type;
    WHEN OTHERS THEN
    insert_sstab(7,'in exception');
    IF OE_MSG_PUB.Check_Msg_Level (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
    OE_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'xx_default_ordertype');
    END IF;
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END get_trans_type;
    END xx_default_ordertype;
    Not able to figure out where the ORA error is getting raised from.
    Kindly help
    Edited by: user11969666 on Mar 19, 2011 7:47 AM

    btw, I did try your test and it didn't error for me:
    CREATE OR REPLACE PACKAGE xx_default_ordertype IS
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2;
    end xx_default_ordertype;
    CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
    FUNCTION get_trans_type
    p_database_object_name IN VARCHAR2,
    p_attribute_code IN VARCHAR2
    RETURN varchar2 IS
    l_trans_type OE_TRANSACTION_TYPES_tL.name%TYPE :='a';
    BEGIN
    RETURN l_trans_type;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN l_trans_type;
    END get_trans_type;
    END xx_default_ordertype;
    begin
    dbms_output.put_line(xx_default_ordertype.get_trans_type('X','Y'));
    end;
    /

  • Irrelevant Error

    Hi,
    I am importing data from Request : Import Standard Purchase Order and when its starts then it give this error:
    I am new in oracle apps r12 please guide me as soon as possoble.
    Start of log messages from FND_FILE
    To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
    AUDSID = 3561018
    EGO_PROGRAM_NOT_IMPLEMENTED
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ERR_UTL. Procedure add_fatal_error.0
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ITEM_PROCESS_PVT. Procedure update_master_item.60
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_ITEM_PROCESS_PVT. Procedure create_items.60
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_lines_add.70
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_lines.10
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process.10
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package po.plsql.PO_PDOI_PVT. Procedure start_process.110
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    End of log messages from FND_FILE
    Regards,
    Waqas Hassan

    Pls check following note:
    R12 : Purchase Order Import Errors with ORA-06502: PL/SQL: numeric or value error: character string buffer too small [ID 1218063.1]

  • Purchase Order Interface Error

    Can any body help me out to resolve the issue.
    After inserting in the PO interface tables (PO_HEADERS_INTERFACE , PO_LINES_INTERFACE, PO_DISTRIBUTIONS_INTERFACE ) when I run request ( Import Standard Purchase Orders) following error occured. And no error is inserted in PO_INTERFACE_ERRORS also.
    ORA-01422: exact fetch returns more than requested number of rows in Package po.plsql.PO_PDOI_PVT. Procedure init_sys_parameters.0
    ORA-01422: exact fetch returns more than requested number of rows in Package po.plsql.PO_PDOI_PVT. Procedure init_startup_values.10
    ORA-01422: exact fetch returns more than requested number of rows in Package po.plsql.PO_PDOI_PVT. Procedure start_process.50
    User-Defined Exception in Packaged po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    Regards,
    Siraj Gul

    Dear Sandeep,
    Thanks alot for the help. After your instruction when I run concurrent request following message show.
    --> To get the log message for PDOI, please use the following id to query against FND_LOG_Messages Table: AUDSID = 8621728
    --> Concurrent request completed successfully.
    But No data found in the table "fnd_log_messages"
    And Neither data deleted from PO_Header_interface table nor inserted in PO_Headers_All and other detail tables.
    Can you please provide me the script for PO_Headers_Interface, Lines and Distribution.
    Regards,
    Siraj Gul

  • Dynamic SQL without using SQL

    I have a variable that contains a formula, eg.
    V_FORMULA varchar2(200) := '5 * 50 + 200';
    I want to assign the result of the formula into another variable, without using a DB call with SQL.
    eg.
    V_RESULT number;
    V_RESULT := DBMS_surprise_package(V_FORMULA);
    I want V_RESULT to be 450 after the statement is executed.
    Is that possible?? Is there such a package in PLSQL?
    I think the Forms NAME_IN package did something similar.

    970779 wrote:
    I guess I'll just have to rewrite it using execute immediate with bind variables to stop the shared pool getting filled up with thousands of these statements, since none of you have a non-db solution.Write your own if the expressions are simple enough...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    l_formula varchar2(200) := '5 * 50 + 200';
      3    l_result  number := 0;
      4    tok       varchar2(100);
      5    op        varchar2(100);
      6    function get_token(str in out varchar2) return varchar2 is
      7    begin
      8      tok := trim(regexp_substr(str,'^[0-9]+|[^0-9]+'));
      9      str := trim(regexp_replace(str,'^([0-9]+|[^0-9]+)'));
    10      return tok;
    11    end;
    12  begin
    13    loop
    14      tok := get_token(l_formula);
    15      exit when tok is null;
    16      if tok in ('*','+','-','/') then
    17        op := tok;
    18      else
    19        case op when '*' then l_result := l_result * to_number(tok);
    20                when '+' then l_result := l_result + to_number(tok);
    21                when '-' then l_result := l_result - to_number(tok);
    22                when '/' then l_result := l_result / to_number(tok);
    23        else l_result := to_number(tok);
    24        end case;
    25      end if;
    26    end loop;
    27    dbms_output.put_line(l_result);
    28* end;
    SQL> /
    450
    PL/SQL procedure successfully completed.:D

  • Import Standard Purchase Orders -For Standard Purchase Orders

    Hi,
    I'm trying to load STANDARD purchase orders using Import Standard Purchase Orders(POXPOPDOI). I'm getting following error in log file
    To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
    AUDSID = 3084626
    User-Defined Exception in Package po.plsql.PO_PDOI_LINE_LOC_PROCESS_PVT. Procedure validate_line_locs.20
    User-Defined Exception in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process_line_locations.60
    User-Defined Exception in Package po.plsql.PO_PDOI_MAINPROC_PVT. Procedure process.30
    User-Defined Exception in Package po.plsql.PO_PDOI_PVT. Procedure start_process.110
    User-Defined Exception in Package po.plsql.PO_PDOI_Concurrent. Procedure POXPDOI.30
    Output File:
    DECLARE
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at line 133
    Your help greatly appreciated.

    Hi,
    What is the application release? OS?
    Please see if (Note: 735909.1 - PDOI Errors With Exec Fnd_conc_stat.Collect Ora-06510) is applicable.
    Regards,
    Hussein

Maybe you are looking for