modify the SQL in "source of the region", according to hidden parameter?
HelloIs there a way to execute sql queries 'source region' 2, depending on the setting hidden past? In other words, if I want to show everyone "select * from emp" when clicking on a link 'total' as opposed to ' select * from emp where dept =: xxx "when clicking on a link dept, how the"source of the region' counts another sql statement?
Thank you.
My understanding is that according to the link you click on in a page (PX), it will go to a page (PY) that has an inside report and an element hidden with som value passed.
If this is correct then do this in PY:
select * from emp
where dept=:xxx
or
:PY_PASSED_VALUE = 'total'
This will show all THE records into emp if the passed value is total, that is, you clicked on the link total and 'total' to the element hidden in PY: PY_PASSED_VALUE
but it will be visible only records specific Dept. otherwise.
Hope this helps,
Sam
Tags: Database
Similar Questions
-
Resize the size of the region when the window is resized
Hello
I have a tree, surrounded by < div >, region whose height is set to the loading of the page by a dynamic action so that it is smaller than 200px window.innerHeight. I set overflow: auto in the style for fully free can still be accessed.
Now I want a dynamic action that fires when the window is resized, which automatically adjusts the size of the region, accordingly, so that the region is always smaller than the HauteurInterne from the window of 200px.
I can get the dynamic action to fire by setting the resize event, however, it does not change the size of the region.
Any ideas?
Jez
Panic at the wire, he sorted.
Dynamic resizing action reads as follows:
$("#tree").css("height",window.innerHeight-200);
where tree is my div id
-
Hide/show the region using the text in the list
Hi all
I created a list in a shared application component. Is it possible in the apex to hide and show the region according to the selected list text.
Thank you.I have not used jQuery, but only if the region
Kind regards
Richard -
decrease the size of the region
Hello
How to decrease the size of the region?
Here is the screenshot. I want to reduce the size of the button area. Because the buttons are occupied half of the region so I cut the other half.
http://ImageShack.us/photo/my-images/20/unleduh.PNG/
How to do this?
SKUD.Hello
go to the definition of your page
Then go to the attributes, under attributes
under the type of region attributes
style = "width: 450px ' / / you can set the width of the region according to your requirement.hope this will help you.
Thank you
Jitu -
Changing the SQL source region according to requirement
I have a region of reports that shows the results of some SQL codes. According to the value of a variable to the page I need to run a little different from SQL to get my results. Right now I use 5 different regions and display one suitable and hide others, according to the value of the variable on the page.
It's a bit messy and I'm looking for a better way to do it. Is it possible to use a single region and change the SQL used as the source of the region after checking my page variable? for example something like this for the source of the region:
.. or something similar?IF :report_type = 1 THEN SELECT col1, col2, col3 from table1; ELSEIF :report_type = 2 THEN SELECT col1, col2, col3 from table2; ELSEIF :report_type = 2 THEN SELECT col1, col2, col3 from table3; END IF;
Or is there an even easier way to do it?Hello
for "normal" (non-interactive reports), you can provide a block plsql returning a sql query
as the source of report...declare
v_sql varchar2 (4000);
Start
IF: report_type = 1 THEN
v_sql: = "SELECT col1, col2, col3 from table1";
ELSE IF: report_type = 2 THEN
v_sql: = "SELECT col1, col2, col3 from table2";
ELSE IF: report_type = 2 THEN
v_sql: = "SELECT col1, col2, col3 from table3";
END IF;
Return v_sql;
end;as said - this does not work with interactive reports...
Best regards
Carsten-
-
Hi all
I have create report sql in version 4.2, and now we have apex version 5.0 upgrade.
I encountered error when I change the State of sql
The error massage:
Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00905: lack of keyword
My SQL
SELECT VW.*
, CASE WHEN (VW.file_code is null
OR VW.cancel_flg = 'Y'
OR (TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = trunc (sysdate))
) THEN
' < font color = "Red" > < b > other < /b > < / police > '
ON THE OTHER
"< a href =" f? p = & APP_ID.:51: & SESSION. : O PR: & DEBUG. : 51:P51_FILE_CODE, P51_COSTING_CODE, P51_TOUR_REG_NO, P51_VERSION_NO, P51_REQUEST, P51_AGENT_NAME, P51_ADULTS, P51_CHILDS, P51_MKT_CODE, P51_QUOT_CURR:'
|| FILE_CODE | «, » || COSTING_CODE | «, » || TOUR_REG_NO | «, » || VERSION_NO | «, » ||' OPR' | «, » || AGENT_CODE | «, » || VW. FROM_PAX | «, » || 0||','|| VW.mkt_code | ',' | VW. QUOT_CURR |': ' > < font color = blue > < b > other < /b > < / police > '. "
END as "other Actions".
, CASE WHEN ((VW.file_code is not null AND TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = TRUNC (SYSDATE))
OR cancel_flg = 'Y '.
OR (VW. REF_COSTING_CODE = VW. ADDL_FIELD2 AND VW. ADDL_FIELD1 LIKE '% COPIED FROM % OF APPROVAL'
AND BOOKING_NAME LIKE "%-Backup")
) THEN
' < font color = "Red" > < b > edit < /b > < / police > '
ON THE OTHER
"< a href =" f? p = & APP_ID.:149: & SESSION. : & DEBUG. : 149:P149_COSTING_CODE:'
|| COSTING_CODE |': ' > < font color = blue > < b > edit < /b > < / police > '. "
END AS 'Edit '.
, CASE WHEN (Nvl (cancel_flg, 'n') = 'Y')
)
THEN
' < font color = "Red" > < b > add < /b > < / police > '
ON THE OTHER
"< a href =" f? p = & APP_ID.:33: & SESSION. : & DEBUG. : 33:P33_COSTING_CODE, P33_FILE_CODE, P33_MKT_CODE, P33_QUOT_CURR, P33_NO_OF_ADULT, P33_NO_OF_CHILD:'
|| COSTING_CODE | «, » || file_code | «, » || VW.mkt_code | ',' | VW. QUOT_CURR | «, » || VW. FROM_PAX | «, » || 0 | ': "> < font color = blue > < b > add < /b > < / police > '
END as 'Services '.
OF TOUR_MAS_VW VW
How to solve it.
Thank you
Dear friends
Thanks for your helping hands.
I found the solution for this. We can solve this problem by using these solutions
- A region of HTML:
click me
- Using PL/SQL:
htf.anchor('f?p=100:5:'||V('APP_SESSION'),'click me');
- Using a SQL query: SELECT htf.anchor('f?p=100:5:'||:APP_SESSION,'clickme') FROM DUAL;
We can write the query in the form
SELECT ' f? p = 100: 1 :'|| : APP_SESSION |': ' | : APP_UNIQUE_PAGE_ID |
': P1_EMPNO :'|| employe_id,
first name,
job_id
Employees
Thank you & best regards
CORINE
- A region of HTML:
-
Can I use an IF statement in a Source in the region
Hello, Im using Apex 3.x. I have a standard report page whose Source region is a simple select statement... SELECT xyz OF... WHERE
I need to add an IF statement to this Source in the region, but when I do I get an error - query cannot be parsed in the generator.
IF: P2_FILTER = 'A' THEN
SELECT FROM ABC... WHERE
ELSIF: P2_FILTER = 'B' THEN
SELECT FROM ABC... WHERE
END IF;
The selected columns are the same in both scenarios. Is it possible to add an IF statement to the source of the region?
Thank you
youYou can either:
(1) create several springs in the area with a query and set a condition to show only based on your health status.
(2) a function returning the pl/sql and return the generic as columns:
if a then return 'select 123 from dual' else return 'select 456 from dual' end if;
-
HHow can I fix this error: 'reading Live is read-only and cannot be changed. Disable the direct code to modify the source code'
Thanks for your time
It is not an error. That's how live code works.
-
What is the diffrence between
Use specific query column names and validate the query
AND
User names generic coloumn (analysis of running queries)
the source of the regionUse specific query column names and validate the query
The name of the column is derived from your query and when you click button Save... It allows to check if the query is correct or not, if this is not correct it will not let you save the query.User names generic coloumn (analysis of running queries)
Here the column name is generic for example. Col01, Col02, Col03 etc.
Query is not validated, so if you enter a wrong query, it allows you to save the query, so it is your responsibility to make sure that the query is validKind regards
Shijesh -
Source of the region with css script
Hi Andy -.
I've implemented the shape with the source of the region of css scripts. After the filling of data by default for an item, I tried to print the form using the print mode, the data appeared at the top of the form, it no longer is displayed in the input field.
I want to be able to print the form with the integrated data (mode friendly printer), is - it possible using scripts css as the source of the region?
Thank you
YivonHello
Paste the HTML into a post is a bit of a pain.
First of all, you must surround your code with {code} tags. Second, all the < and > characters must be replaced by & lt; and & gt; Finally, all Roger has to be replaced by & amp; I tend to type/paste code in a text editor and then make replaces overall.
Thus, for example, to display:
< div > blah blah < / div >
You must enter:
{code}
& lt; div & gt; Blah blah & lt; / div & gt;
{code}Andy
-
Assigning a page element in the region of the "body of function return PLSQL SQL query.
I've not been here in a long time. I like the new forum text editor!
I have a search page in my application that contains a return region of query SQL PLSQL function body. I use PLSQL to build a query based on the user entries in various page numbers (search text, serial number, year, etc.). Using PLSQL is very useful to enforce the page quickly because there are 1/2 million lines with a lot of text fields some of which are CLOB.
Users want to know how many rows were returned, but if I allow using a paging system that includes the total performance dies because ApEx has to sort through all the pages of output. Instead, I use ' line varies X to Y "without the part of" Z", and it's pretty fast. I can't use the #TOTAL_ROWS # because it does not work with this system of pagination.
So, I built a code within the region of function body PLSQL to build a second query that counts only the lines based on the input parameters. I can do this query within the region using EXECUTE IMMEDIATE and the number to an output variable. The disconnect is that I can not then assign it to a page element. If I add a statement assigned to a page element, either by
: P45_COUNT: = p_count;
or
APEX_UTIL. SET_SESSION_STATE ('P45_COUNT', p_count);
then when I submit the changes I get
ERR-1002 unable to find point item ID 'P45_COUNT' in the application '4000 '.
as if the ApEx is not looking for the item in my application, but in the application development environment. I am able to write the results to a table and then recover data in the next region. That's how I got around the problem, but it seems too complicated and unnecessary.
I wrote the following code just to illustrate the problem.
Make sense? Any ideas?
Thank you!
Bill
declare
p_sql varchar2 (32767).
p_sql_count varchar2 (32767).
p_table_count number (2);
p_count number (10);
p_instr number (10);
Start
p_sql: = q'! Select g.id, g.widget, g.year_made, g.serial!';
p_sql: = p_sql | q'! g table_g where g.status = 1!';
If: P45_YEAR_MADE is not null then
p_sql: = p_sql | q'! and $P45_YEAR_MADE = g.year_made!';
end if;
If: P45_SERIAL is not null then
p_sql: = p_sql | q'! and upper (g.serial) like '% "| Upper ($P45_SERIAL) | » %' !';
end if;
If: P45_WIDGET_SEARCH is not null then
p_sql: = p_sql | q'! and upper (g.widget) like '% "| Upper ($P45_WIDGET_SEARCH) | » %' !';
end if;
p_instr: = instr (p_sql, 'of g table_g where g.status = 1');
p_sql_count: = ' select count (g.id) of "| substr (p_sql, p_instr);
p_sql_count: = replace (replace (replace (p_sql_count, ' $P45_YEAR_MADE ',: P45_YEAR_MADE), "$P45_SERIAL", "' |: P45_SERIAL |)) ('), "$P45_WIDGET_SEARCH", "' | : P45_WIDGET_SEARCH | '''');
run immediately p_sql_count in p_count;
/ * the following
: P45_COUNT: = p_count;
gives this error when I submit the region in the development environment
ERR-1002 unable to find point item ID 'P45_COUNT' in the application '4000 '.
*/
Select count (1) in the table_sql p_table_count where app_session =: APP_SESSION.
If p_table_count = 0 then
insert into table_sql (app_session, sql_text, session_date, count) values (: APP_SESSION, p_sql_count, sysdate, p_count);
on the other
Update table_sql set sql_text = p_sql_count, session_date = sysdate, count = p_count where app_session =: APP_SESSION.
end if;
/ * the above written SQL and count of a table * /.
Return replace(p_sql,'$',':');
end;Hello
Try the suggestion of Scott in Re: how to get the query region "PL/SQL function body returns the query string"?
Andy
-
How to get the query of the region "PL/SQL function body returns the query string"?
Hello
is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?
I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like
< pre > v_return_query: = «...» » ;
: P49_QUERY: = v_return_query;
Return v_return_query; < / pre >
to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.
Kind regards
PrzemekIf you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:
if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime :P9_SQL := vSQL;else-- design time null;end if;
But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.
Scott
-
Variable setting wrong with dynamic action for the region of report
Hello
I can't setting a variable. Here are the details of connection:
Connection information:
TCARMY workspace
User Apex_dev
Password dev_apex
Application 88542
Page 11
If you run the page 11 and just click on submit, there will be two rows. If you click on one, the modal region won't say no data found. If you click on the button submit once again, the value is passed if you click on it now, the results arrive. If you click on the second row, it still shows the value of the first row. If you click on submit again after clicking on the second line, then it is displayed correctly. It seems that the value is set to submit it. I want this to work when clicked, and then for the sql to run with the value that is in this variable when clicks on the element. There is a bit of javascript page level and dynamic action. Something is not right to the installation.
The modal window should popup and run the sql at that time with the variable data and view the two columns. And if the user clicks on the second row, it would display the data in the row.
Thank youTim
TC-army wrote:
If you run the page 11 and just click on submit, there will be two rows. If you click on one, the modal region won't say no data found. If you click on the button submit once again, the value is passed if you click on it now, the results arrive. If you click on the second row, it still shows the value of the first row. If you click on submit again after clicking on the second line, then it is displayed correctly. It seems that the value is set to submit it. I want this to work when clicked, and then for the sql to run with the value that is in this variable when clicks on the element. There is a bit of javascript page level and dynamic action. Something is not right to the installation.
What has not been set up right, it's that the element of P11_NAICNUMD parameter was not specified in the source attribute of Page to go to the region, modal Discount. The current value in the browser page, therefore, was not defined in session state when the report has been updated by the dynamic action. When
-
I have trouble setting my local setup correctly with a mixture of regions with different configuration of persistence of disc. Is a configuration problem on my end or a bug in GemFire and/or Spring GemFire data?
The configuration of my work is as follows:
< gfe: replicated-region id = "replicatedRegion" cache-ref = "gemfireCache" disk-store-ref = "overflowOnlyDiskstore" persistent = "false" >
< gfe:eviction type = threshold "HEAP_PERCENTAGE" = "90" action = "OVERFLOW_TO_DISK" / >
< / gfe: replicated-region >
< gfe:local - region id = "localRegion" cache-ref = "gemfireCache" / >
With the above configuration, I can successfully call JSONFormatter.fromJSON (json) and get a reference to a PdxInstance object. However, when I kinda modify configuration to enable the persistence of drive on one of the regions, the call to JSONFormatter.fromJSON (json) fails. The change is as follows:
< gfe:local - region id = "localRegion" cache-ref = "gemfireCache" persistent = "true" disk-store-ref = "persistOverflowDiskstore"/ >
Without any additional modification, the following error starts occurring:
com.gemstone.gemfire.pdx.JSONFormatterException: could not parse JSON document: [Source: java.io.StringReader@5549f0e, line: column 26,: 6]
at com.gemstone.gemfire.pdx.JSONFormatter.fromJSON(JSONFormatter.java:66)
...
Caused by: com.gemstone.gemfire.pdx.PdxInitializationException: The PDX metadata must be persistent in a limb that has persisted data. See CacheFactory.setPdxPersistent.
at com.gemstone.gemfire.pdx.internal.PeerTypeRegistration.checkAllowed(PeerTypeRegistration.java:531)
at com.gemstone.gemfire.pdx.internal.PeerTypeRegistration.verifyConfiguration(PeerTypeRegistration.java:515)
...
Note that it is breaking while I try to get a reference to a PdxInstance, and if the code has not yet arrived at the point where I place a PdxInstance object in a region.
Thanks for any help in advance.
Hello
JSONFormatter PDX uses as is the serialization mechanism from the Gemfire cache. As indicators of error, you must have your persistent PDX meta-data when you use PDX with an area that itself is persistent. Adjust your configuration as follows:
It will use a default for PDX record store, but you can also use a specific store if you wish.
When you use PDX, a "PDXType" is created for each class serialized with PDX and this type id is stored with the data in the region. If this region is persistent, then the PDXType, associated with this object must also be kept.
-Jens
-
Hi, I created a page region 0 in my apex application. I understand that whatever it is in page 0 apply to all pages. Anyway, my problem is that the title of region shows on any page. They is a way to hide the region?
Hi Dave.
You can create a new model of the region with a model code;
Templates-> Create model-> area - from scratch-> him give a name. Custom 1 model (for example) - class create.
Edit this new model and modify the definition of #TITLE #.
#BODY # to the following:Change your region to use this model and you'll be fine.
Edit
I just noticed that your javascript has been in the header. I have my case is in the source of the region as
Kofi
Maybe you are looking for
-
Copy and paste functions work intermittently.
Windows 8; FF 26 - does not: cut and paste - not always. I noticed that copy is grayed out in the Edit menu, so I can't yet do this way. I have to drag the selected text. I don't have zone alarm or other things that other people have installed. Is th
-
Unable to do a Soft ReBoot in Windows XP?
Original title: "XP Soft Reboot. Have Windows XP Home Edition on my Asus EEE and would like Soft ReBoot it in the way that I can do on my PC with Windows 7.Tips on how to do this would be greatly appreciated.
-
On wrt1900AC slow download speeds
Since the update to the latest FW (1.1.10.167514) my downloads were excruciatingly slow. My ISP connection should allow download speeds close to 100 Mbit/s, and I could download approaching the sppeds before the recent FW update. Now I see bearly ov
-
BlackBerry apps of Q10 lose and e-mail account to every reboot
So, basically, every time that I reboot, I set up my camera like new again. I lose my email, contacts and calendar, apps. I did 2 factory resets and 2 wipes of security. Progress only that I did, is that now my login ID Blackberry (bbm, app store) is
-
Hello Please, help me understand one thing here. When you use WLC on router, all AP communicate with her using a tunnel encrypted via the LWAPP Protocol. Now, according to the documents, for each SSID, you configure VLANS separated to keep isolated f