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 184.108.40.206.0 to 220.127.116.11.0 [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 :
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 pa.id 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
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 :
- 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)
- 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:
- Create Page group.
- Create attribute <ATTRIBUTE_NAME> based text.
- Create item type : <ITEM_TYPE_NAME>.
- Edit the new Item and Click on attributes tab.
- Select <ATTRIBUTE_NAME> to be on the right on the selected attributes.
- Below in the attributes properties, for the new item added: <ATTRIBUTE_NAME>
- Default value <USERNAME>.<PROCEDURE>
- Check boxes: "Required", "Add Wizard", "Edit Wizard"
- Click on procedure tab. Under "Procedure Call Properties":
Procedure Call: <USERNAME>.<PROCEDURE>
Link Text: <USERNAME>.<PROCEDURE>
- Click Apply, OK.
- Go to the root page
- Add an item.
- Select "<ITEM_TYPE_NAME>" type
- 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.
- 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