Error assigning value to page item
I create a "SQL Query (Pl/Sql Function Body Returning
Sql Query)" region, and also an item on the page called
:P1_TEST.
In the Region Source for the region, I have the following
codes:
declare l_sql varchar2(32676);
BEGIN
:P1_TEST := 0;
l_sql := 'select emp_id from emp';
return l_sql;
END;
When I click on "Apply Change" button, I got the
following error:
ERR-1002 Unable to find item ID for item "P1_TEST" in application "4000".
Any reason why I got the error?
Re: how to get the parsed last query (report)
Similar Messages
-
Before Header pl/sql process to assign values to page items
How can i assign values to items on a page based on the data structure returned from a pl/sql procedure within the before header process? I am thinking of executing a pl/sql procedure based on a URL parameter value and then assign values to page items. Is this really possible using Apex 4.0.2? If yes, how can it be done?
thanks
SeetharamanThe question isn't really clear. What kind of "data structure returned from a pl/sql procedure"? Please be much more specific.
For a PL/SQL data structure such as record containing 2 elements (<tt>x</tt> and <tt>y</tt>) returned as an out parameter from a procedure to be assigned to 2 page items <tt>p1_x</tt> and <tt>p1_y</tt>, all that's required in the Before Header process is something like
declare
l_rec rec_type;
begin
the_proc(..., p_out => l_rec, ...);
:p1_x := l_rec.x;
:p1_y := l_rec.y;
end; -
Assign value to page item on log-in
For some reason I cannot seem to solve this simple issue. I have a SQL report on a page with several text boxes that are used for selection criteria.
So, for instance -- I have a text box (P1_TEXT) and my SQL for the report is:
select * FROM table
where table.field LIKE :P1_TEXT
I want to set the default value (hidden) of that text box to '%', so they see all records when they log-in.
I have tried PL/SQL processes (On New Instance) with
:P1_TEXT = '%';
but that doesn't seem to work. I have also set the default value on the text box itself, but that doesn't seem to work as well.
Please help.What if you changed your query to something like:
select * FROM table
where table.field LIKE :P1_TEXT || '%'Or you could use NVL(:P1_TEXT, '%'), though you're probably going to want to append '%' in any case, so the first example is probably best for all-around use.
Good luck,
Stew
My Oracle Community blog:
http://www.oraclecommunity.net/profiles/blog/list?user=stewstryker -
Is there a way to assign value to variable
of data type ITEM? In other words, I need to
assign value to an item, where I just know the
it_id.
In the following procedure p_item is unknown until runtime;
and if it_id is not null then assign some value to the item.
procedure update_item(p_item)
is
it_id item := find_item('block1.'||p_item);
if not id_null(it_id) then
it_id := 'some_value'; --doesn't work.
end if;
end;Do you mean you know the name of the item and you want to then assign a value?
If so then use the COPY command which allows you to assign a value to a named variable
e.g.
COPY (12345, 'blocka.number_item1');
To read the value in the same way use the NAME_IN function.
There is plenty in the forms helps about this.
Mark -
When I replace the code given in Apex 4.2 2+Day developer guide, it shows the following error.
Error is :
Error during rendering of page item P3_DEPARTMENT_ID. ORA-06550: line 5, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
is_internal_error: true
apex_error_code: WWV_FLOW_FORM.UNHANDLED_ERROR
ora_sqlcode: -6550
ora_sqlerrm: ORA-06550: line 5, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
component.type: APEX_APPLICATION_PAGE_ITEMS
component.id: 3996015574888943
component.name: P3_DEPARTMENT_ID
error_backtrace: ORA-06512: at "SYS.DBMS_SYS_SQL", line 1249 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1021 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1090 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 697 ORA-06512: at "APEX_040200.WWV_FLOW_META_UTIL", line 245 ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 989 ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 1428
the code of the book 2+Day developer which I used in my edit report region source :
SELECT e.EMPLOYEE_ID,
e.FIRST_NAME,
e.LAST_NAME,
e.HIRE_DATE,
e.SALARY,
e.COMMISSION_PCT,
calc_remuneration(salary, commission_pct) REMUNERATION,
e.DEPARTMENT_ID,
d.DEPARTMENT_NAME
FROM OEHR_EMPLOYEES e,
OEHR_DEPARTMENTS d
WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID(+) AND
(e.DEPARTMENT_ID = :P3_DEPARTMENT_ID or
(e.DEPARTMENT_ID is null and nvl(:P3_DEPARTMENT_ID,'-1') = '-1'))0e342a31-11d2-4cd7-ac7c-802ef455d578 wrote:
Please update your forum profile with a recognisable username instead of "0e342a31-11d2-4cd7-ac7c-802ef455d578": Video tutorial how to change nickname available
Always include the information detailed in these guidelines when posting a question: how to get answers from forum
When I replace the code given in Apex 4.2 2+Day developer guide, it shows the following error.
When you replace what code? Where? How? Provide the exact steps necessary to reproduce the problem.
Error is :
Error during rendering of page item P3_DEPARTMENT_ID.
ORA-06550: line 5, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
is_internal_error: true
apex_error_code: WWV_FLOW_FORM.UNHANDLED_ERROR
ora_sqlcode: -6550
ora_sqlerrm: ORA-06550: line 5, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
component.type: APEX_APPLICATION_PAGE_ITEMS
component.id: 3996015574888943
component.name: P3_DEPARTMENT_ID
error_backtrace: ORA-06512: at "SYS.DBMS_SYS_SQL", line 1249 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1021 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1090 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 697 ORA-06512: at "APEX_040200.WWV_FLOW_META_UTIL", line 245 ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 989 ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 1428
The error page indicates that the error occurred in rendering the P3_DEPARTMENT_ID page item. What are the Source and Default settings for this item? -
Error during rendering of page item P1_LOGIN.
Dear Oracle Apex Experts,
Thank you for this brilliant environment.
There is a small problem. When I entered http://apex.oracle.com/pls/apex
It gives me the following Error
Error Error during rendering of page item P1_LOGIN.
ORA-00376: file 30002 cannot be read at this time ORA-01110: data file 30002: '/u03/oradata/marvlprd/temporary02.dbf'
Please, resolve it ASAP
Best RegardsIt has been resolved :)
Thank you so much
Edited by: mahmoudrabie on Feb 4, 2012 10:33 PM -
How to fetch the tabular form column value into page items
Hi,
I have created tabular form. I have set LOV for one column. Here my requirement is when i select the value from lov then it will fetch that value into page item.
can any help?
I am using apex 4.1
Thanks
vijayIt's not so easy to make a dynamic action on a tabular form.
The best thing you can do is to use the javascript API from APEX: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/javascript_api.htm
So if you have a tabular form then open your item and make it a column link.
In the link location select URL.
Your URL would be something like this
javascript:$s('P1_PAGE_ITEM', #COLUMN_ID#);doSubmit('COLUMN_ID');The doSubmit is not required but if you don't submit your page then the server would never know about your page item.
Off course it is possible to submit at a later point. For example you can just use the $s to set the value off an item and afterwards create a button that would submit your page.
Be aware that if you just set the value off your page item and just link to an other page without submitting or without branching that other page would never know about your page item.
If you want the server to know the value off a page item you need to submit it's value to the server. The easiest way is just to do the doSubmit() call after you have set your value.
Hope this helps,
Regards
Nico -
Assign values for Application items
Hi,
I have some application items to which I want to assign values querying from a database table based on the user logged in. I have created an application process which does that. What process point I need to select so that the values in application items are available through out the session?
Thanks,
AshaAsha:
I have been able to reproduce this issue. The application process appears to fire for every 'new' session-id. This explains the 'no data found' when you navigate to the application's login page. What is weirder is that APEX re-uses the session-id created when presenting the login page and therefore the application process no longer fires ! This needs more research. Clearly, my understanding of the the 'On New Session - After Authentication' is inadequate.
In the meanwhile you can move the code you have for the application process and and use it as a 'Post-Authentication Process' for the application's authentication scheme.
Varad -
How to Set Value of page item?
String dimLayoutNew[][] = new String[3][];
dimLayoutNew[0] = new String[1];
dimLayoutNew[1] = new String[1];
dimLayoutNew[2] = new String[2];
dimLayoutNew[0][0] = measureString;
dimLayoutNew[1][0] = strDimension1;
dimLayoutNew[2][0] = strDimension2;
dimLayoutNew[2][1] = strDimension3;
Boolean applyNewLayoutFlag = tableQuery.layout(dimLayoutNew);
In this Layout,How to set the value of strDimension2 page item to one member of strDimension2?
thanks!what about this - look up the javadoc to get more >info ....You would have to admit, while BI Beans are great, the documentation is a little light.
int targetHPos[] = targetDataAccess.getEdgeCurrentHPos (2);
now apply the order to the targethpos as you like...now, once you make your changes to the targetHPos, how does one actually make the change to the Query object (i.e. what method does one need to call to pass the new targetHPos in??) I looked through the JavaDoc and didn't see a SetCurrentHPos or equivalent function in the DataAccess Class. Is there one?
Also, what role, if any, should the SetCurrentPage method of the query object play if I'm not using it correctly? -
List of Values using page item variable
I know there has to be a simple solution to my problem but I cannot figure it out. Any assistance would be greatly appreciated.
I have a Shared list of values that I want to reuse on several of my pages. I have tried (I thought) all the variable possibilities but cannot figure out how to reference the page item in my list of values.
Original code:
select app_name d, app_sys_id f
from ops_application
where :P32_RADIO2 = 'Application'
union
select db_name d, db_id f
from ops_database
where :P32_RADIO2 = 'Database'
Doesn't work:
select app_name d, app_sys_id f
from ops_application
where 'P'||:APP_PAGE_ID||'_RADIO' = 'Application'
union
select db_name d, db_id f
from ops_database
where 'P'||:APP_PAGE_ID||'_RADIO' = 'Database'
I also have tried 'P'||v('APP_PAGE_ID')||'_RADIO'
'P'||&APP_PAGE_ID.||'_RADIO'
'P&APP_PAGE_ID._RADIO'
'P'||:APP_PAGE_ID||'_RADIO'
Thanks,
Gayle
Edited by: user8116955 on Sep 27, 2010 12:25 PMGayle,
I haven't tried this, but what about
where v('P'||:APP_PAGE_ID||'_RADIO') = 'Application'That should allow you to build up the name of the page item dynamically, and then test the value...
A lower-quality solution would be to use an application item rather than a page item, as then you'd know the name ahead of time.
Let me know if this works,
-David -
How to reference SQL column value for page item text field
greetings,
I created a simple report based on sql query. the query is select employeeid,salary from emp_tbl. under the report column i see employeeid and salary. I created a page item text field with the source type pl/sql function body. inside this source is simple block.
begin
if salary < 10000 then
return (1);
else
return (2);
end if;
end;
from the error i take it that it doesn't understand salary. I have tried bind variable (:salary) , hash marks (#salary#), ampersand (&salary.) but nothing works. Is this even possible?
thank you,
monHi Mon,
I think you will find that anything you do in Forms, you can achieve in Apex, but you may have to think a little differently. Finding direct equivalents in both environments may not be easy or even possible in some circumstances, but with a little knowledge and thought an equivalent overall business flow can be achieved that is just as efficient.
For example, in Forms where you have a multi row block based on a table, if you need to add any derived fields then you will add these at the block level. I can see that this is what you are trying to achieve in Apex.
In Apex this will be more easily achieved by specifying the derived fields as part of the query for the region, and if the derivation of the fields is complex you can use user defined functions. If you require page type items to be displayed such as text boxes, LOV's, radiogroups, datepickers etc then these can be embedded in the query with the use of the Apex API, see the APEX_ITEM supplied package.
I know this is still very high level, but I hope it helps you on your way in your journey with Apex.
Regards
Andre -
How to set the default value for page item in report
Hi Gurus
I currently i have company name as page item in one of my report screen ,but it is displaying the value for company name in its drop down column ,but i want to make it "*ALL* as default after the query result ",this is user requirement ,please share ,how can i make it ,is it possible ??,thanx in advance
thanx
PratapHi,
I don't think this is possible. You can of course use a parameter to select the page item and default the parameter but then the user will have to rerun the report to see other pages items.
Rod West -
Hi,
I use page items quite heavily in my workbooks to allow the user to filter the recordsets as they require.
Some of these page items are based on dates - i.e. Extract Date (my underlying tables are updated on a daily basis, so the Extract Date soon contains several values).
Is there any way I can set the Page Item to show the latest (MAX) Extract Date when the work book is opened?
Many thanks
MarkHi all
Also, when alternate sorts are in use these will generally trigger Discoverer to add the NOREWRITE hint to the SQL, which can cause horribly slow performance.
I used to use alternate sorts a lot but these days I use them very sparingly. When I want a list of values to come up in a certain order I now use a custom folder and add the ORDER BY in there. This allows the list to come up right when my users are picking and stops the NOREWRITE hint, but it also removes the alternate sorting from the display.
There are other causes for the inclusion of NOREWRITE hint but this is the main one.
Best wishes
Michael -
I'm using the following code for my news ticker. I want to display the value of page item :P18_TEKST. But the page shows the text :P18_TEKST. How do i get the value of the page item in my ticker. See the code below
It's about the row: var marqueecontent='<nobr><font face="Arial"><b>:P18_TEKST<b/></font></nobr>'
<script language="JavaScript1.2">
//Specify the marquee's width (in pixels)
var marqueewidth="350px"
//Specify the marquee's height
var marqueeheight="20px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//configure background color:
var marqueebgcolor="#ededd6"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1
//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
//var marqueecontent='<nobr><font face="Arial"><b>This is where my text goes.<b/></font></nobr>'
var marqueecontent='<nobr><font face="Arial"><b>:P18_TEKST<b/></font></nobr>'
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
lefttime=setInterval("scrollmarquee()",20)
window.onload=populate
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
write('</div></div>')
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
document.write('</td></table>')
</script>Edited by: user565199 on 14-mei-2010 3:06
Edited by: user565199 on 14-mei-2010 3:09Hi
Try changing this...
var marqueecontent='<nobr><font face="Arial"><b>:P18_TEKST<b/></font></nobr>'To this...
var marqueecontent='<nobr><font face="Arial"><b>' + document.getElementById('P18_TEKST').value + '<b/></font></nobr>'(not tested but you get the idea.)
Cheers
Ben -
Discoverer Report: Select all values for a Page Item
Hi Guys
I have created a Disco Report which has one Page Item.
It populates all columns based on values I select for Page Item that is perfectly fine.
How do I Display column values for all possible values of Page Item?
Is thera ny way I can have Option to select All possible values for Page Item?
Cheers
VijayHi Vijay
Just to confirm what Rod has said, this capability to manage ALL in Page Items was introduced as part of 10.1.2 and has been maintained into 10.1.2.3 and 11g. It will not be back ported to previous releases.
Best wishes
Michael
Maybe you are looking for
-
Finding out the source user and tablespace in a database export
Hi folks, Lets say a customer gave us a export of their DB using expdp or exp, whats the best way to find out what users and tablespaces are in that export? With exp Ive used imp and created a index file but it seems a datapump export doesnt give up
-
Sales Order Item rejected but still reflects in Prod. Alloc. Display in APO
A line Item in the SO was rejected but it still reflected in the Prod Alloc display character combination per period in the APO.
-
i have to make a field mandatory. i got the field exit can any one guide me how to make that field mandatory?
-
Start up error - mouse , keyboard, external HD decided to not work
Working on setting up my new MacPro13 to replace a PC. Tried to install Retrospect backup software to do backup on external HD that had been attached to PC. Didn't have enough room on HD and couldn't erase files. I couldn't find anything in Help to t
-
Is it necessary to buy a cover for macbook Pro?
In daily use, can dust come into laptop through keyboard? Please some hardware experts can provide an answer, thank you very much.