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

Similar Messages

  • Why such error information when I used sqlite3 SQL API?

    Hi
    When I programming with sqlite3 SQL API, some error information about lock occurred:
    DB_LOCK->lock_put: Lock is no longer valid
    Following error log also occurred sometimes:
    “Locker still has locks”
    I have called the function sqlite3_threadsafe to make sure the library is threadsafe.
    Is there any way to avoid the above error logs?
    The information of my test bed is as follows:
    CentOS6
    $ uname -a
    Linux localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
    Berkeley DB version: db-5.2.28
    When I build BDB, I using the following options:
    ../dist/configure enable-sql_compat enable-test --with-tcl=/usr/lib64
    Can you help me with that please?
    Thanks!

    This error was already reported in another Re: Berkeley DB lost data sometimes when I ran the example ex_sql_multi_thread. Please do not post the same issue multiple times and follow the issue in the original thread, which is currently handled by one of our engineers.
    Thanks,
    Andrei

  • PL/SQL Capture ORA error numbers

    Could you please let me know, how to capture the ORA error numbers and store it in a variable?

    if you are using PL/SQL
    you have to use in EXECPTIONS
    DECLARE
    slq_error  number;
    sql_msg varcher2(20);
    BEGIN
       process
    EXCEPTION
      WHEN OTHERS THEN
          sql_error:=SQLCODE;
         sql_msg:=SQLERRM;
    --- you can INSERT in to TABLE also  
    END;Also look at the link below
    http://www.stanford.edu/dept/itss/docs/oracle/10g/olap.101/b10339/x_sql003.htm

  • [Solved]Portal 10.1.4 - Request Help to Modify Item Name using PL/SQL API

    I have a region on a page that contains content items. These are PDF files that were uploaded. I want to know how I can programmatically change the description.
    I have been looking at both set_attributes() and modify_item_post_upload() functions in the API. Is this my best option, or is there an alternative.
    I have been leaning towards calling modify_item_post_upload(), but have a question on the parameters.
    I can get p_master_item_id, but what is p_item_id?
    I would like to call the method like this:
    declare
    l_masterid number;
    l_display_name varchar2(100);
    begin
    l_masterid := <some number);
    l_display_name := 'New Name for item';
    modify_item_post_upload(
    p_master_item_id => l_masterid,
    p_display_name => l_display_name
    end;
    So questions are:
    1. What modifications do I need for a simple call to change an items name?
    2. What additional functions/procedures do I need to call so the display gets updated with the new information? Do I have to clear the cache suing wxutils, or can I just call wwpro_api_invalidation.execute_cache_invalidation; ?
    If you want the "rest of the story" - I created a web front end in JDeveloper that allows specific end users to login, upload files, and delete items for a specific portal page containing content items. One of the common mistakes is a misspelling of the display name by the end user. So instead of deleting an item, then re-adding an item, the end user would like to edit the display name for just the item that has the misspelling. I have set this up in JDeveloper with an edit screen that contains just the display name. Now I need a function/procedure that I can call from the application module that will update just the display name for this particular item. I have already coded an ADF model that uses the search_item and converts the results into a result_set, and use that to create a View Object in the ADF for JDeveloper to use. Now to finish this user request, I just need to figure out the PL/SQL API part for modifying a display name. The item still needs to keep it's reference to the uploaded PDF file.
    Thanks, Ken

    Very nice! I like the code example. In looking at needing to change only the title of the item, I created a procedure that calls set_attribute. Here is the code:
    create or replace
    procedure update_newslinearchive_item (p_masterid in number, p_displayname in varchar2) as
    cursor items_cur(p_id IN NUMBER) is
    select * from wwsbr_all_items
    where masterid = p_id
    and caid = <pagegroup>
    and active = 1
    and is_current_version = 1
    and language = wwctx_api.get_nls_language;
    items_rec wwsbr_all_items%rowtype;
    begin
    dbms_output.put_line('masterid = ' || to_char(p_masterid));
    dbms_output.put_line('display_name = ' || p_displayname);
    -- Login to the portal for access to function calls
    wwctx_api.set_context('<username>','<password>');
    -- Verify that the item to be deleted is in the items table
    open items_cur(p_masterid);
    fetch items_cur into items_rec;
    if items_cur%found then
    dbms_output.put_line('record found');
    wwsbr_api.set_attribute(
    p_site_id => items_rec.caid,
    p_thing_id => items_rec.id,
    p_attribute_site_id => wwsbr_api.SHARED_OBJECTS,
    p_attribute_id => wwsbr_api.ATTRIBUTE_TITLE,
    p_attribute_value => p_displayname
    wwpro_api_invalidation.execute_cache_invalidation;
    dbms_output.put_line('Clearing Cache');
    -- Now clear the web-cache
    wxvutil.invalidate_reset;
    wxvutil.invalidate_uri('<server:port/path/to/page>,0,null);
    wxvutil.invalidate_exec('<server>',4001,'<webcache password>');
    else
    dbms_output.put_line('record NOT found');
    end if;
    close items_cur;
    exception
    when others then
    dbms_output.put_line('SQLCODE = ' || SQLCODE);
    dbms_output.put_line('SQLERRM = ' || SUBSTR(SQLERRM,1,200));
    if items_cur%isopen then
    close items_cur;
    end if;
    end update_newslinearchive_item;
    Thank you for the example for modify_item_post_upload!
    Ken

  • Inserting multiple rows using a subquery getting ora error 0097 :Misssing )

    Iam getting ora :0097 missing right parenthesis
    insert into id_bfs_user_access_proj_racopy
    (user_name, project_id)
    ((Select user_name from id_bfs_user_access_cc Where cost_center_id in (select cost_center_id from ID_COST_CENTER_GROUPS_V where cost_center_group = 'Engineering')), 3)
    If i run below sql it is working fine can anyone help me in this
    insert into id_bfs_user_access_proj_racopy
    (user_name)
    (Select user_name from id_bfs_user_access_cc Where cost_center_id in (select cost_center_id from ID_COST_CENTER_GROUPS_V where cost_center_group = 'Engineering'))

    "how can it be valid since 3 is another column value and for user name we have to use entire sql"
    Did you try it? It is perfectly valid to select a constant as part of a SELECT statement, which is what 516945's solution does.
    SQL> CREATE TABLE t (id NUMBER, descr VARCHAR2(10));
    Table created.
    SQL> INSERT INTO t VALUES (1, 'One');
    1 row created.
    SQL> INSERT INTO t VALUES (2, 'Two');
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT id, descr, 'This is a constant string' const_str, 42 const_num
      2  FROM t;
            ID DESCR      CONST_STR                  CONST_NUM
             1 One        This is a constant string         42
             2 Two        This is a constant string         42John

  • Change workarea rule using the Repository API

    Hi,
    I have a simple question: Can I use the Repository API (either
    Java or PLSQL packages) to change the rule of workarea: in order
    to add to or remove configurations from the rule? I do not want
    the use the RON and preferably not the CLT either.
    I could not find anything about this functionality in the API
    doc.
    Regards,
    Rinse Veltman
    Solution Partners
    Custom Solutions

    Rinse,
    Have a look at the API jr_workarea
    FUNCTION jr_workarea.add_head_entry (workarea_id IN NUMBER
    , entry_ivid IN NUMBER
    , rule_id IN NUMBER:=NULL
    , v_param1 IN VARCHAR2:=NULL
    , v_param2 IN VARCHAR2:=NULL
    , v_param3 IN VARCHAR2:=NULL
    , c_exclude IN CHAR:=NULL)
    RETURN NUMBER;
    Where:
    workarea_id specifies the workarea.
    entry_ivid is the IVID of the configuration, if the entry is
    associated with a configuration, NULL otherwise.
    rule_id is the IRID of the rule to be used, if the entry is
    associated with a rule, NULL if the entry is configuration based.
    param1 through v_param3 are parameter values (if any) for the
    rule.
    c_exclude specifies whether to exclude or include objects
    produced by the rule or contained in the configuration.
    Use entry_ivid to specify a configuration. This is in the Model
    and API documentation.
    regards,
    David

  • Setting default value using pl/sql

    I am having trouble writing the correct syntax for either a pl/sql expression or function on the default value section for a checkbox item. I share the same form for showing data in edit mode and creating new records. When the instance is a new record, I want an item called P12_ACTIVE to be set to Y (yes).
    I have tried several variations like:
    begin
    select distinct 'Y'
    into :P12_ACTIVE
    from VMS_PROSPECTING_ITEMS
    where order_id != :P12_ORDER_ID;
    end;
    -OR-
    declare defaultvalue varchar2(10);
    begin
    if not exists (select *
    from VMS_PROSPECTING_ITEMS
    where order_id = :P12_ORDER_ID) then
    defaultvalue := 'Y' ;
    end if;
    return defaultvalue ;
    end;
    -OR-
    as a pl/sql expression....
    select distinct 'Y'
    from VMS_PROSPECTING_ITEMS
    where order_id != :P12_ORDER_ID;
    end;
    Dawn

    This is my LOV definition for the item:
    STATIC: ;Y
    If I put Y as the default value, then the check box is always marked, even when the record is one that was edited; therefore potentially changing the active status incorrectly. I would like one of my examples to work right. My second example throws this error:
    Error ERR-9131 Error in PLSQL function body for item default code, item=P12_ACTIVE
    ORA-06550: line 3, column 8: PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL statement only ORA-06550: line 3, column 1: PL/SQL: Statement ignored.

  • Page item default value using PL/SQL

    Hello,
    I'm trying to set a default value for a text field page item in a form.
    I'm using this PL/SQL Function Body in the Default section:
    begin
    select ("DEPT_CODE"|| ' ' || DEPT_NAME) from MyView where UserID = :G_USER_ID;
    end;
    I get the following error:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Any help is appreciated!
    thanks,
    Matt

    Matt
    I'm using this PL/SQL Function Body in the Default section:
    begin
    select ("DEPT_CODE"|| ' ' || DEPT_NAME) from MyView where UserID = :G_USER_ID;
    end;Well, that's not a PL/SQL function body. This is:
    declare
      x varchar2(4000);
    begin
      select ("DEPT_CODE"|| ' ' || DEPT_NAME) into x from MyView where UserID = :G_USER_ID;
      return x;
    exception others then
      return null;
    end;Scott

  • How to Rewind the workflow activity using PL/SQL API?

    Hi,
    Is there any API to Rewind the workflow activity instance? We have some timedout activities and wanted to Rewind them to the start. I can Rewind them manually from the Admin responsibility, but we have to do this in a program for some cases.
    The Background process runs with the parameter timedout = No.
    Thanks in advance.
    Regards,
    Ram

    Hi,
    Yes - you need to use WF_ENGINE.HandleError to restart from the correct point.
    There is a white paper on my blog here which explains how to do it.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Create custom rule: Looking for ORA errors in the alert log

    I would like to create a rule to notify me when ORA errors are generated to the alert log. When I try to create a rule, I seem to only be able to choose from predefined lists. Has anyone configured a rule for this?

    Grrr. This is for 10.2 Grid:
    Go to databases --> select your database
    Under Diagnostic summary, you'll see:
    Alert Log 28-Dec-2006 09:19:48
    The date part is a clickable link, click on it. Scroll to the bootom of the next page and click on:
    "Generic Alert Log Error Monitoring Configuration"
    Now read the page very carefully, its all self explanatory. The reason who haven't had some errors reported is because of that filter. Now set it up the way you want it.
    Good luck
    Bazzza

  • How can I use the latest Berkeley DB with SQL API in PHP app?

    Hi,
    I'm a PHP developer and I already use Berkeley DB in my applications using the [DBA Functions|http://www.php.net/manual/en/ref.dba.php] . I'm very interested in the latest Berkeley DB release. How can I write a PHP program that uses the SQL API of the latest Berkeley DB release?

    Hi Kurt,
    I'm not a PHP expert (far from it), but the simplest way to get started with the Berkeley DB SQL interface is to run Berkeley DB's <tt>configure</tt> script with the <tt>--enable-sql_compat</tt> flag.  This will create a library called <tt>libsqlite3.so</tt> that you can use as a drop-in replacement for SQLite at the API level.  Database files still need to be converted with a SQLite <tt>.dump</tt> followed by a <tt>.read</tt> with the <tt>dbsql</tt> tool.
    This should then allow the existing PHP driver and application code to switch over to Berkeley DB without any code changes by setting <tt>LD_LIBRARY_PATH</tt> to find the Berkeley DB version of <tt>libsqlite3.so</tt> ahead of SQLite. Note that any other code that relies on SQLite will also run against Berkeley DB with this configuration, which can cause problems if the system libraries use SQLite (for example, on Mac OS X). For that reason, a better long term solution would be for the PHP SQLite driver to have a mode where it loads <tt>libdbsql.so</tt> rather than <tt>sqlite3.so</tt>.
    I hope this helps, please let us know how you go because I'm sure lots of other PHP developers will be interested in the answer.
    Regards,
    Michael Cahill, Oracle Berkeley DB.

  • Order defaulting rule

    hi
    how to modify a defaulting rule using sql or pl/sql ?

    Hi,
    You have like this:
    1. Price list
    2.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    You have to make
    1. XXOE_DEFAULT_PVT.custom_code
    2. Price list
    3.OE_DEFAULT_PVT.Get_SOB_Currency_Code
    Did you made own custom code to pick currency?
    Regards,
    Luko

  • PL/SQL API for Creating Sales Order

    Hi,
    I am new to Oracle SOA 11g.
    I have done the Deleting Sales Order using PL/SQL API ( Oracle Apps Adapter ) [ API Name: OE_ORDER_PUB.DELETE_ORDER ] in SOA BPEL. While executing the BPEL, it is correctly deleting Sales Order in E Business Suite which is created in EBS User Interface. I don't face any problem while deleting the sales order.
    Now, in same way, I have to create a new Sales Order using PL/SQL API in SOA-BPEL. I don't find any API's related to creating Sales Order in Order Management Suite (OM_PF) -->Order Management (ONT) --> Sales Order (ONT_SALES_ORDER) --> PL/SQL --> Process Order API (OE_ORDER_PUB) in Module Browser.
    Please tell me which PL/SQL API to use to create new Sales Order in BPEL.
    Thanks,
    -- Gowtham
    Edited by: user8223943 on Feb 16, 2012 7:38 AM

    You may be on a different patch level. Can you ensure that you have applied all latest patches for your version?
    See sample code at http://jyotioraapps.blogspot.com/2009/08/use-of-oeorderpubprocessorder-to-create.html
    Hope this helps,
    Sandeep Gandhi

  • PL/SQL API for Creating Sales Order in E Business Suite from BPEL

    Hi,
    I am new to Oracle SOA 11g.
    I have done the Deleting Sales Order using PL/SQL API ( Oracle Apps Adapter ) [ API Name: OE_ORDER_PUB.DELETE_ORDER ]. While executing the BPEL, it is correctly deleting Sales Order in E Business Suite which is created EBS User Interface. I don't face any problem while deleting the sales order.
    Now, in same way, I have to create a new Sales Order using PL/SQL API. I don't find any API's related to creating Sales Order in Order Management Suite (OM_PF) -->Order Management (ONT) --> Sales Order (ONT_SALES_ORDER) --> PL/SQL --> Process Order API (OE_ORDER_PUB) in Module Browser.
    Please tell me which PL/SQL API to use to create new Sales Order in BPEL.
    Thanks,
    -- Gowtham

    You may be on a different patch level. Can you ensure that you have applied all latest patches for your version?
    See sample code at http://jyotioraapps.blogspot.com/2009/08/use-of-oeorderpubprocessorder-to-create.html
    Hope this helps,
    Sandeep Gandhi

  • Mining Models used in SQL Developer 3.0 and models created PL/SQL scripts

    Hi,
    Pardon my ignorance if some of my questions are very basic. I am just gaining understanding about building/using mining models.
    I installed sql developer and went thru some OBE exercises to build models ( classification models)
    While building workflows the exercise required to supply data for the pre built models ( the four models pre-created). The question is - is this exercise is about building models or using models ?
    How those pre-built models were created? Are these models are restricted in their usage. or are they generic models that they can be applied for solving similar problems?
    What type of models can be used in workflows?
    I am also seeing some smaples of pl/sql scripts used in creating some models. Is it correect to assume they are created using PL/SQL APIs ( DBMS_DATA_MINING, DBMS_DATA_MINING_TRANSFORM etc).
    What is the differrence between these two model building process ?
    Thanks

    Hi,
    The OBE exercises show you both how to build models and then to apply (Score) new data using the built models.
    A model is always built using some form of input data, so it is built specifically with that form of data in mind.
    It is not a generic model at all.
    When you apply a model you provide data in the same format as the original data.
    In the case of a Classification or Regression model, you are applying the model to generate a prediction on new data that conforms with the build data provided to the model.
    The online help provides details on all the models that are available.
    Data Miner uses the data mining pl/sql packages (package name DBMS_DATA_MINING) to create and test models.
    There are also sql data mining prediction functions as well.
    Thanks, Mark

Maybe you are looking for

  • I want to share some of my information from my iPhone to iPad, but not all...??

    I have recently purchased an iPad for our family.  I want to sync certain things from my iPhone to be available on the iPad, such as email, calendar, photos, apps etc BUT I don't want my text messages appearing on the iPad.  Is this possible?

  • BT Inifinty 2 - started disconnecting continuously...

    BT Home Hub2 Software version 4.7.5.1.83.2.11.2.6 (Type B), Location : North Cardiff I have had Infinty 2 unlimited (maybe had for 6 months?), no problems until last 7 days. I was getting 54/14 (I think), now getting 30/8, that is when the connection

  • Any Tool or Method to Find out the Diff in Code betn two forms

    Hi all, Pls can anyone guide how to see all the differences between 2 same forms in terms of code. I would like to know if there is any method or an tool availaible for this. Thanks Vinod

  • SQLplus for Oracle 10g Express

    I installed Oracle 10g Express Edition. Is there a free version of SQLplus to use with 10gEE? Instead of using SQLDeveloper, I want to use the old SQLplus.

  • Filechooser - how to force selection

    Hi, I have an application that needs to load data from two files. I could simply programmatically put the whole file path in the code and the problem is solved. However, it can happen that the user moves those files to a different directory and the s