Apex Item popupkey_from_query
Hi,
I am using this wwv_flow_item.popupkey_from_query for populating the data in the popup window, If i use a where clause inside the item to populate the conditional data i am getting a following error please suggest me how to fix this issues.
wwv_flow_item.popupkey_from_query(35,NULL,'SELECT object_type d, object_type r FROM object_types where business_unit like 'SIEBEL_ENTERPRISETWO' ')
when i report the where clause it works fine but i need that condition to display the data
how to validate this please suggest.
Error 1 error has occurred
Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00907: missing right parenthesis
Thanks
Sudhir.
Try this:
wwv_flow_item.popupkey_from_query(35,NULL,'SELECT object_type d, object_type r FROM object_types where business_unit like ''SIEBEL_ENTERPRISETWO'' ')
(that is double ' when already among ')
Thanks
Stefano Corradi
Similar Messages
-
APEX.ITEM.popupkey_from_query does not populate the correct row
I have a manual tabular form that contains a popup field. When I click on the popup icon, it displays the popup window. I select the row that I want to populate the field with but it doesn't populate the field correctly. It usually populates the 2nd row but not always.
I included the form in the Sample Application as page 22 on apex.oracle.com:
Workspace: RGWORK
User Name: TESTER
Password: test123
Application: Sample Application - 25152 (not Sample Application 20726)
Page: 22: Advanced Tabular Forms RG
Pagee 22 has to be run directly.
I appreciate your assistance.
Robert
http://apexjscss.blogspot.comJari,
While I removed the sort and it worked, I still needed the report sorted by last name. So I created a view of the table sorted by last name and used the view instead of the table in the report (i.e., load collection) and it worked.
Robert
http://apexjscss.blogspot.com -
Populating apex item checkbox in report row based on database value
Hi All
I am looking for help setting an apex item checkbox to 'checked' depending on a record exisiting in a database and I would appreciate a little guidance.
At the moment I have a report which looks a bit like this
SELECT licence_user_identifier,
description,
licence_name,
apex_item.checkbox(22,licence_id)
FROM TABLE(SOL_LICENCE.F_RETRIEVE_ORG_LICENCES ( 121 ));
4 columns and the last column is a checkbox called 'assign' and is used to assign the selected licence to a user(who is already displayed on the page in another table). There is save button which when clicked saves a record to the database if the checkbox is selected.
However when the page is displayed the checkbox should be prepopulated/checked if there is a record in the database saying that the licence is assigned to the current user. I have created a page process to try and collect this information and populate the checkboxes on load - before header. However I am having difficulty referencing the apex_application item the corresponds to each row because when I use the FOR i IN 1 .. apex_application.g_f22.COUNT LOOP it only selects the item if it is checked. Can anyone point me in the right direction?
here is the process I have to populate the checkboxes, it is not getting to my flow.debug as there are no selected checkboxes:-(
DECLARE
v_count NUMBER;
CURSOR getlicences (p_co_id so05.co_id%TYPE)
IS
SELECT licence_id
FROM so05_cust_org_licences
WHERE co_id = p_co_id;
BEGIN
IF :p9_co_id IS NOT NULL
THEN
FOR each_rec IN getlicences (:p9_co_id)
LOOP
--check if a record exists
SELECT COUNT ( * )
INTO v_count
FROM so05_cust_org_licences
WHERE co_id = :p9_co_id AND licence_id = each_rec.licence_id;
--if the record exists populate the checkbox
IF v_count > 0
THEN
FOR i IN 1 .. apex_application.g_f22.COUNT
LOOP
wwv_flow.debug ('bbbbbbbbbbccccccccccandwearein' || v_count);
IF apex_application.g_f22 (i) = each_rec.licence_id
THEN
apex_application.g_f22 (i) := 1;
END IF;
END LOOP;
END IF;
END LOOP;
END IF;
END;
Thanks in advance
LynnHi,
Sorry my mistake. You can use the above link only to solve this problem, for this you have to use a hidden column to which you will assign 'Y' or 'N' as mentioned in that post.
using that hidden column value you can fire your query accordingly.
let's say your hidden column is f01 and checkbox column is f02 and the id column is f03, you can do like this
create a process before your update process like this
BEGIN
-- Reset the hidden ADMIN_USER flag for all visible records to N
-- Note: g_f01 maps to the hidden ADMIN_USER column
FOR ii IN 1 .. APEX_Application.g_f01.COUNT
LOOP
APEX_Application.g_f01(ii) := 'N';
END LOOP;
-- Set the hidden ADMIN_USER flag for those records where the
-- checkbox has been set by the user to Y
-- Note: g_f02 is the checkbox column ADMIN_USER_CHECKBOX
FOR ii IN 1 .. APEX_Application.g_f02.COUNT
LOOP
APEX_Application.g_f01(APEX_Application.g_f02(ii)) := 'Y';
END LOOP;
END;then write a new process positioning after above process
if apex_application.g_f01 = 'Y' then
your update query using id column (f03)
else
your delete query using that id column (f03)
end if;hope this helps you.
Thanks
Tauceef -
SQL Report query with condition (multiple parameters) in apex item?
Hello all,
I have a little problem and can't find a solution.
I need to create reports based on a SQL query or I.R. Nothing hard there.
Then I need to add the WHERE clause dynamically with javascript from an Apex item.
Again not very hard. I defined an Apex item, set my query like this "SELECT * FROM MYTAB WHERE COL1 = :P1_SEARCH" and then I call the page setting the P1_SEARCH value. For instance COL1 is rowid. It works fine.
But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
(no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.
How could I do that, please?
Thanks for your help.
Maxmnoscars wrote:
But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
(no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.For a standard report, see +{message:id=9609120}+
For an IR—and improved security avoiding the risk of SQL Injection—use a <a href="http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#CACFAICJ">collection</a> containing the values in a column instead of a CSV list:
{code}
SELECT * FROM MYTAB WHERE ROWID IN (SELECT c001 FROM apex_collections WHERE collection_name = 'P1_SEARCH')
{code}
(Please close duplicate threads spawned by your original question.) -
How to create read only Apex items
Hi,
I'm creating a report using Apex items to display the result values inside editable text boxes. They are then referred by using APEX_APPLICATION.G_F02 etc.
My requirement is to make the last row of this report (the values for "Total") as non editable or read only. Can anybody help me with the code that i would need to add in the query? The query goes something like this:
apex_item.text(7, TO_CHAR(nvl(year_4,0),'999,999,999'), 12, 12, 'style="text-align:right;font-weight:bold"',ROWNUM) "YEAR_4", ..Surprising. I would have expected there to be a CSS style to disable a form item.
Depending on your reasons for wanting to use APEX_ITEM, you could:
Select your required value as part of the query (without using apex_item.)
Visit your report attributes, then the attributes for your specific column.
Change the column type to text field.
Add readonly=true into the item attributes.
Rgds
Ben -
How to populate values in Apex item
Hi,
I am using apex collection item to capture data my requirement is to calculate data using the apex item
This requirement is like this. I am using a SQL query like this
select
wwv_flow_item.TEXT(1,NULL,20,10) "A",
wwv_flow_item.TEXT(2,NULL,20,10) "B",
wwv_flow_item.TEXT(4,NULL,20,10) "C"
from dual
There 3 text boxes are generated in the window when i enter 3 in A and 2 in B it must give me a sum value in C as 5
this has to be done dynamicall as end user key in values this can be done using java script or any other method please suggest
Thanks
Sudhir.Hello Sudhir,
>> If there are multiple text box …
If there are multiple text boxes, you need to allocate each a unique ID. The easiest is to use the substitution string #ROWNUM#. The code should look similar to the following:
select empno,
apex_item.TEXT(1,null,20,10,'onchange="addItems(this);"','A'||'#ROWNUM#') "A",
apex_item.TEXT(2,null,20,10,'onchange="addItems(this);"','B'||'#ROWNUM#') "B",
apex_item.TEXT(3,null,20,10,'onchange="addItems(this);"','C'||'#ROWNUM#') "C"
from empBecause we are in a multi-row environment, we need to pass the line number we are on, into the JavaScript function, hence the use of ‘this’.
In the JavaScript function, we first need to determine the line number we are on, and then use it to perform the calculation. The code can look similar to the following:
<script type="text/javascript">
function addItems(pThis) {
/* extract rownum */
var line_no = pThis.id.substr(1);
$x('C'+line_no).value = parseInt($v('A'+line_no)) + parseInt($v('B'+line_no));
</script>Regards,
Arie.
Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all. -
How to pass apex item value into custom xml for chart or guage?
Re-opening the old thread : Re: How to pass apex item value into custom xml for chart or guage?
Which was not answered.
Roel - Thanks. Its working - but in a semi quotes in the custom XML
<pointers>
<pointer value= '&P5_RUNNING_TOTAL.'
<label enabled="true">
<position placement_mode="ByPoint" x="50" y="15" />
<format>{%Value}{numDecimals:1}</format>
<background enabled="false" />
</label>
</pointer>
</pointers>This question was helpful for us to resolving one recent thread : AnyChart - set Dial axis intervals dynamically?
(Re: AnyChart - set Dial axis intervals dynamically?
Edited by: P.Ranish on Dec 13, 2012 6:23 AMP.Ranish wrote:
Is there any update for this question ???
Edited by: P.Ranish on Dec 13, 2012 3:36 AMNo, And there won't be in the future.
Please stop posting followup's to old threads, if you have a real problem please search the forum first and post a new question with all information
Roel wrote:
Try using &P5_RUNNING_TOTAL. or #P5_RUNNING_TOTAL#Just to make it clear - this will only work if page is reloaded after setting the item values dynamically via AJAX -
Passing values to APEX items from external site
All,
Is it possible to pass values to APEX page items from an external web site?
For example, I have an external web site where users type in a username and password into fields. When they click the 'log-in' button in the external site, I would like to have those values passed to the APEX log-in page. If possible, I would like to have the APEX log-in occur 'invisibly' and the user taken directly to the home page of the app. If that's not possible, it would be nice to simply have the 'user name' and 'password' fields filled in on the APEX side.
I'm using APEX 3.0.
Thanks in advance for any help!
AlexHello Alex,
>> Is it possible to pass values to APEX page items from an external web site?
The general answer is yes. You can use the f?p syntax to set the value of any APEX item - http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#sthref185 .
In your specific example, the main question should be is it wise? The mere fact that you are using a login process suggests you have something to protect in your application. The f?p syntax uses a plain text for the items’ value, which means that the user name and password will be completely exposed.
Regards,
Arie. -
Putting HTML around APEX items
Gday,
I am trying to convert the following HTML to APEX. I am trying to put the html around the APEX items but I cannot get them to sit properly in the tables.
Can I put html around the APEX items? Or can I put in the HTML and access the objects via APEX?
<TABLE WIDTH="100%" HEIGHT="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR ALIGN="CENTER">
<TD HEIGHT="100%" VALIGN="MIDDLE" ALIGN="CENTER" WIDTH="100%" >
<TABLE WIDTH="250" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<TR>
<TD COLSPAN="3" HEIGHT="2" BGCOLOR="#336699"><IMG SRC="/i/spacer.gif" HEIGHT="2" BORDER="0"></TD>
</TR>
<TR>
<TD WIDTH="2" BGCOLOR="#336699"><IMG SRC="/i/spacer.gif" WIDTH="2" BORDER="0"></TD>
<TD>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" BORDERCOLOR="#336600">
<TR>
<TD VALIGN="MIDDLE" ALIGN="CENTER" ROWSPAN="3" bgcolor="#000000">
<img src="/i/logo.gif" border="0" alt="logo" title="logo"><br>
<h3><font color="#FFFFFF">Login Page</font></h3>
</TD>
<TD WIDTH="2" BGCOLOR="#336699" ROWSPAN="3"><IMG SRC="/i/spacer.gif" WIDTH="2" BORDER="0"></TD>
<TD VALIGN="MIDDLE">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD HEIGHT="5"><IMG SRC="/i/spacer.gif" HEIGHT="5" BORDER="0"></TD>
</TR>
<TR>
<TD VALIGN="MIDDLE"> Username: </TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="p3_username"></TD>
</TR>
<TR>
<TD VALIGN="MIDDLE"> Password: </TD>
<TD VALIGN="TOP">
<INPUT TYPE="PASSWORD" NAME="p3_password" maxlength=15>
</TD>
</TR>
<TR>
<TD HEIGHT="5"><IMG SRC="/i/spacer.gif" HEIGHT="5" BORDER="0"></TD>
</TR>
<TR>
<TD> </TD>
<TD HEIGHT="25" VALIGN="BOTTOM">
<INPUT NAME="p3_submit" TYPE="submit" value=" Login ">
</TD>
</TR>
<TR>
<TD HEIGHT="5"><IMG SRC="/i/spacer.gif" HEIGHT="5" BORDER="0"></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD HEIGHT="2" BGCOLOR="#336699" COLSPAN="4"><IMG SRC="/i/spacer.gif" HEIGHT="2" BORDER="0"></TD>
</TR>
<TR>
<TD HEIGHT="34" COLSPAN="3" ALIGN="LEFT" NOWRAP>
Enter Username and Password
<br>
<center>
<A href="security.changepass" title="Change Password">Change Password</a></center>
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH="2" BGCOLOR="#336699"><IMG SRC="/i/spacer.gif" WIDTH="2" BORDER="0"></TD>
</TR>
<TR>
<TD COLSPAN="3" HEIGHT="2" BGCOLOR="#336699"><IMG SRC="/i/spacer.gif" HEIGHT="2" BORDER="0"></TD>
</TR>
</TABLE>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>CheersAnd like I said I basically want to put APEX text items inside Oracle HTMLAPEX can only handle items [created declaratively through the App Builder|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/app_comp.htm#CHDGFCGB] or programmatically using the [APEX_ITEM API|http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_item.htm#CACEEEJE].
It looks like you want to create a Login Page. This is a standard APEX page type that can be created from the application home page: click Create Page >, select Login Page, and complete the wizard. The look and feel of this page is controlled by standard APEX [page layout techniques|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/ui.htm#BABJIECG], and the [themes, templates and CSS|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/themes.htm#CJABAEIE] applied. To achieve the required appearance in APEX, page and region templates and CSS can be modified to contain the necessary HTML and properties.
Try experimenting a bit with the above. If you hit problems, raise new threads dealing with specific, discrete issues... -
How to avoid leading space -char(160) in Apex items
Hi
I'm getting a leading space in one of my apex item (text area).
Further check reveals that it is char(160).
Could any one help me in this to avoid leading space in the item.
Many Thanks
--VijayHi Vijay,
Try:
TRIM(:<Item_Name>)In the Post Calculation Computation section of the item.
Hope this helps.
Regards
Kamo -
Decrease the field width for apex item..
I cant decrease the field width for apex item. i used apex_item.text in the select query report region.
i want to change the field width. i tried to change the element width..but no use. pls help how to change it.
thanks and regard,
skud.The third parameter to apex_item.text is p_size. You can set the field width with this parameter.
Jure -
Is it possible to add the Apex text item / Apex select list items in form. Can i add Apex items in evry form type ?
Please explain how to add the Apex Text / Date / Select list items like
apex_item.text (4,
TO_CHAR (sal),
12,
12,
'style="text-align:right" ',
'f04_' || ROWNUM,
NULL
) sal_editable
I did'nt understood the meaning of the above statement also. Kindly explain ?
YogeshHello,
The APEX_ITEM package is there so you can programatically create your items on your page.
You can use that in a PL/SQL Region or directly in your report (in your select statement).
- In a PLSQL Region you would do:
htp.p(APEX_ITEM.TEXT(...));
- In SQL you would do
SELECT APEX_ITEM.TEXT(...) as t1 ...
Regards,
Dimitri
http://dgielis.blogspot.com/
http://www.apex-evangelists.com/ -
Step by step procedure to create apex item dynamically
Can anyone please guide me how to create apex item like textbox and do operations on that textbox?
Pankaj Kumar wrote:
I think you didn't understand my question, i want to create fields(checkboxes, textboxes) dynamically. For ex:If there are 3 records in table, i want three checkboxes in the page with different name each.You could use APEX_ITEM API in plsql dyanmic region within a case statement -
Trying to get values from a table in apex item.. form.. not sucessfulll
I have a form and have 3 fields.. .i need the value to be fetched from some other table... at the start...
Note if the values are present in the fields it donot need to be fetched...
Now how can i accomplish this..
I tried using ...onload event.. but data is not visible in the required field..
I tried dynaic item.. for even on page load ..it does fire..But i will like it to fire only one time..
Does any one have any idea how can this be accomplished
In oracle forms we will have done ..soemting like when new form instance trigger - select name into :mname from table where empno = :xyz;
How do we accomplish this in apex..any info will be usefull..
Thanks
Paul jYes i did try the same ..
BEGIN
select PROD_tYPE into :P185_OFF_CITY from
magcrm_setup where atype = 'CITY' ;
:p185_OFF_CITY := 'XXX';
insert into mtest values ('inside foolter');
END;
When i checked the mtest table it shos me the row inserted...
inside foolter .. Now this means everything did get execute properly
But still the vallue of off_city is null or emtpy...
i check the filed and still its empty..
while mtest had those records..seems like some process is cleaining the values...but cant see such process...
a bit confused..here..I tried on Load after footer...
tried chaning the squence number of process ..but still it doesnt help
some how the session variables gets changed...and it is changed to empty
Edited by: pauljohny on Jan 3, 2012 2:01 AM
Edited by: pauljohny on Jan 3, 2012 2:03 AM -
Using apex item for list of number for 'IN' clause
Greetings,
I have a computation that looks like this:
select count(mr.mr_id)
from ds_moriver mr
where mr.approved = 0 OR mr.approved IS NULL
and mr.mr_id NOT IN (:P62_MRID)
I am looking to enter numbers in the NOT IN clause like '123,234,...'
I have a text field item (P62_MRID) where the user can enter IDs for the NOT IN clause. So for example, 13578,182. If the user enters one number it works fine. If the user enters 2 numbers with a comma (13578,182) then I get this error when the computation is run:
ORA-01722: invalid number
So substituting 13578,182 for P62_MRID the SQL statement should compute as:
select count(mr.mr_id)
from ds_moriver mr
where mr.approved = 0 OR mr.approved IS NULL
and mr.mr_id NOT IN (13578,182)
Why am I getting the error, 'ORA-01722: invalid number'?
Thanks in advance!
JohnGlad to help. Don't know how long you've been using APEX, but thought I'd caution you against "going wild" with the item substitution syntax. In general, if you can do it with bind variable syntax, that's better. The use of item substitution syntax can contribute to SQL injection attacks. But, if you have suitable control over the contents of the items being substituted, the risk is mitigated. Just don't create an APEX process like this:
begin
&P10_TEXT_DIRECTLY_FROM_USER.
end;
That'll get you into trouble.
Maybe you are looking for
-
Problem with Java 5 and Oracle 10g JDBC driver
Hi All, Currently we upgrade our web application to Java 5 and Oracle 10.2 JDBC driver. And we encountered a bug, when the user entered the information through UI and data didn't store into database (Oracle 9i). The problem is that this bug is not ha
-
Dummy PI serviceinterfaces can be used in BPM scenarios and how?
Hi Experts, We have a requirement where SAP ECC(Async system) is sending the file to HSM tool(sync system) through PI and sends the response from HSM tool to bank system(Async system) through PI. Entire flow is the passthrough interface. Firstly we t
-
How do I import PowerPoint slides into iPhoto? I want to burn a dvd on it to play on other computers so I don't have to transport my MAC on vacation. Thanks. Any help is appreciated.
-
Free trial of Photoshop Lightroom 5
A photographer friend recommended I use Adobe Photoshop Lightroom 5 for procesing my RAW photos. I found the "free trial link" but cannot find how long it lasts. Can someone at Adobe please respond? Thank you kindly. Nomadic Texan
-
User damaged MS-7407 motherboard
I recently allowed a potential customer to use a Hetis G31 (MS-7407 Version 1.0) at a trade show to drive a digital sign. Someone apparently dropped it and there is a dent in the cover and chassis on the left side near the small cooling fan. There wa