My Oracle Support Banner

WWC-00006 and ORA-01840 or ORA-01861 or ORA-01858 Errors When Using Item Types With Default Value In Portal (Doc ID 1456402.1)

Last updated on FEBRUARY 19, 2019

Applies to:

Portal - Version to [Release FMW11g]
Information in this document applies to any platform.


Item types can be associated with attributes. The default value for such an attribute can be set through PL/SQL code as illustrated in the Portal User's Guide :

" Adding Attributes to an Item Type
7. When you have added the attributes, you can change their display properties if necessary:

To set the default value of a custom Project ID attribute to the current project to which the current user is assigned, you would first need a function that returns the ID of the project. The function might be something like the following (assuming that a user is assigned to only one project on any specified date):

create function GET_CURRENT_PROJECT return VARCHAR2 as
   project_id VARCHAR2 (30);
   select into project_id from project_asignments pa
   where SYSDATE between pa.start and pa.end -- selects current assignment
   and pa.assignee = WWCTX_API.GET_USER; -- gets name of current user
   return project_id;
 end;  "


For an item type where the attribute's default value is generated from PL/SQL, an error occurs when adding an item based on this item type to an item region on a Portal page :

  1. ORA-01840 when the return value of the PL/SQL code is only 1 character in length and has a numerical value, e.g. 1

    internal error (WWC-00006)
    Unexpected error - ORA-01840: input value not long enough for date format (WWC-35000)

  2. ORA-01861 when the return value of the PL/SQL code is more than one character in length.

    internal error (WWC-00006)
    Unexpected error - ORA-01861: literal does not match format string (WWC-35000)

Steps To Reproduce:

  1. Create Page group.
  2. Create attribute <ATTRIBUTE_NAME> based text.
  3. Create item type : <ITEM_TYPE_NAME>.
  4. Edit the new Item and Click on attributes tab.
  5. Select <ATTRIBUTE_NAME> to be on the right on the selected attributes.
  6. Below in the attributes properties, for the new item added: <ATTRIBUTE_NAME> 
    - Default value <USERNAME>.<PROCEDURE>
    - Check boxes: "Required", "Add Wizard", "Edit Wizard"
  7. Click on procedure tab.  Under "Procedure Call Properties":
    Type: PLSQL
    Procedure Call: <USERNAME>.<PROCEDURE>
  8. Click Apply, OK.
  9. Go to the root page
  10. Add an item.
  11. Select "<ITEM_TYPE_NAME>" type
  12. Click next and the item wizard is opened and at the bottom of the page:
    Display Name: <DISPLAY_NAME>
    <USERNAME>.<PROCEDURE>: with the default value passed.
  13. Click next button the error is shown!


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.