Apex 4 and more then a SQL query on a page update
We know if 4 Apex has eliminated the restriction more then an update SQL query on a page?If you mean tabular forms, you can have one per page.
-Sharon
Tags: Database
Similar Questions
-
More than 1 SQL query with checkbox and error invalid number report
Hi all
I have two SQL query reports that each has an apex_item.checkbox and two processes for each report. A report/process works very well. It gives me an error of invalid number.
In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.
ORA-06502: PL/SQL: digital or value error: character number conversion
error ORA-06502: PL/SQL: digital or value error: character number conversion
errorOk When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked. It stopped working when I added another SQL query report (with box and a process).
A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""
The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""
Any help will be greatly appreciated,
Sylvia
Hi Reema,
I've recreated the region and now it works!
Thank you for this, looking at
Sylvia
-
Use the DECODE and RIGHTEOUS in the sql query
Friends...
Could someone help with DECODE and sql RIGHT or similar function?
I'm doing below in the SQL query
- DECODE any process with s.process = 1234 to replace with JAVA
- RIGHT: Removes all characters after ' @' sign
SQL query:
SELECT s.osuser, s.machine, DECODE(s.process, '1234', 'JAVA', right(s.process,charindex('@',s.process)-1)) s.process FROM v$session;
for example
EXAMPLES of data
User, machine, process
John, mac1, 1234
Mike, mac2, 567@mac2
Julie, mac3, 890
The result of the SAMPLE:
User, machine, process
John, mac1, JAVA
Mike, mac2, 567
Julie, mac3, 890
Thanks in advance
Thanks guys... I am overwhelmed with all these answers and support on this forum, I received...
I have combined Solomon and Frank response to achieve accurate result...
with the answers of Solomon he displayed empty process when there is ' @' sign
Frank's response showed it process with sign @ the end... so I added '-1' in the end.»
SELECT s.osuser,
s.machine,
DECODE)
s.Process,
"1234", "JAVA",
substr)
s.Process,
1,
InStr)
s.Process | '@',
) - 1
)
) process
V $ session s
/
-
SQL query generated by insertion/update of data vi?
Hello!
I'm new to LabView, now rated as my company's management plans to buy licenses for several developers. I'm now playing with the database connectivity toolkit and try to insert/updated updated data sets. Everything is good with simple tables, but when I try to execute relatively complex queries are often mistakes LabView diagnosed everything as "syntax error in Update statement" or something like that with no specific details.
Is it possible to read the actual SQL queries generated by these vi or is there a (preferably free) tool to monitor all SQL queries called by my LabView program?
Here is the link I promised last night. It includes a review of the issues with the CSD and why it is not necessary. There is also a link with some drivers that allow you to do what you need to do and are free - and a brief tutorial on the access to databases.
Mike...
-
Clarification of the SQL query in 2 day + Guide APEX
I worked through the Oracle Database Express Edition 2 day + Application Express Developer's Guide, and try to decipher the SQL query in Chapter 4 (building your app).
The code is:
SELECT d.DEPARTMENT_ID,
d.DEPARTMENT_NAME,
(select count (*) from oehr_employees where department_id = d.department_id)
"Number of employees", he said.
substr (e.first_name, 1, 1) |'. ' || Select 'Name Manager',
c.COUNTRY_NAME 'place '.
OEHR_DEPARTMENTS d,
E OEHR_EMPLOYEES
OEHR_LOCATIONS l,
C OEHR_COUNTRIES
WHERE d.LOCATION_ID = l.LOCATION_ID
AND l.COUNTRY_ID = c.COUNTRY_ID
AND e.department_id = d.DEPARTMENT_ID
AND d.manager_id = e.employee_id
AND instr (superior (d.department_name), superior (nvl (:P2_REPORT_SEARCH,d.department_name))) > 0)
I don't know exactly what is happening in the last line. I think I understand what the different functions but I'm not clear on the use of the: P2_REPORT_SEARCH string.
What does this string? This code simply checking that d.department_name isn't NA?
I have SQL experience but am not very familiar with the Oracle PL/SQL implementation. Can someone please give me a brief breakdown that check is doing in the context of the overall query? The application seems to work even if the conditional statement is not included.
Thank you.
2899145 wrote:
Thanks for the reply. I apologize if the information I added was incomplete. The code came from the day 2 + Application Express (version 4.2) Developer Guide.
In the section 'your own Application of 4 Buuilding' https://docs.oracle.com/cd/E37097_01/doc.42/e35122/build_app.htm#TDPAX04000 , they describe the creation of a report
page that includes the "manager_id" and 'location_id '. The SQL query, I pasted above extracted from the data in other tables to substitute the real 'name of the Manager' and 'rent '.
for the corresponding ID values. It makes sense, and the part of the SQL query that explicitly doing this makes sense.
However, given that the document is a guide for the development of the APEX, I guess the command:
AND instr (upper (d.department_name), upper (nvl (:P2_REPORT_SEARCH,d.department_name))) > 0
done something valuable, and I do not recognize what is exactly the value.
From a practical point of view why would I need to include this conditional statement? Which only added to the application?
Looking at the guide in question, it is clear that the
AND instr(upper(d.department_name),upper(nvl(:P2_REPORT_SEARCH,d.department_name)))>0
the line is completely unnecessary in the context of this tutorial, and it can be removed. The search in the tutorial app page is implemented by using a report filter interactive rather than a P2_REPORT_SEARCH element, which does not seem to exist at all. (It's a quirk of the APEX that bind variable references to non-existent items are replaced with NULL silently rather than exceptions). I thought that perhaps it would be legacy code a version of the tutorial prior to the introduction of interactive reports at the APEX 3.1, but I can't find explicit instructions to create such an element of filter in the 3.0 tutorial. I guess it must have been automatically generated by the application wizard when you create a standard report page.
If you do not want to see the effect he would have (as described in the post above), leave it in the source report, add a text element of P2_REPORT_SEARCH, and a button "submit" on page 2 and experimenting to find different values of the element and clicking on the submit button...
-
How do I get recommendations sql query manually, its possible or not?
I'm new dba oracle and my company gives me sql optimize, if research on google and knowledge, addm can give recommendations of sql query
but I sql query and in addm can not give recommendations,
I then how sql query performance increase... ?
and the sql script to get the recommendations?
Thanks in advance
1. upgrade to oracle 11
2. (take the topgun)
Select / * + RESULT_CACHE * / a.empid, empname from
(select empid, empname from india_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from us_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from uk_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from uae_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from brazl_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from chine_emp
where deptno <> 10 and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
Union of all the
Select empid, empname from jpn_emp
where deptno in (54,256,362,9879,24,46) and empid NOT IN (105,202,11,45,695,646,726,8465,965,56,646,689,446)
) a
order by 2;
3. run the query 3 times.
The query will be lightning fast from the 3rd time
4. read the full performance tuning guide
http://docs.Oracle.com/CD/E11882_01/server.112/e41573/TOC.htm
-
Help with APP_USER in SQL query
Hello
I would like to extract a detail of the user in a form of language element DML based on the logged in user and the standard authentication scheme.
I make this request in the element:
The user in the session is equal to the value of the EMAIL. In fact, the value in the session is a capital letter, and the other in the database is tiny. I think that's irrelevant anyway.select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d, ANALYST_ID r from QTMT_ANALYST where EMAIL = :APP_USER
The query do not of any value. Could you please let me know what I did wrong?
APEX: 4.2
Item Source type: query SQL (single return value)
Thank you and best regards,
VladimirTo be on the safe side you should uppercase both sides of the equation. It could be that the user name is entered in lowercase.
But if you think that your request is correct, test it by using a literal rather than the user name.
select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d from QTMT_ANALYST where upper(EMAIL) = upper(:APP_USER);
for testing purposes, use something like this:
select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d from QTMT_ANALYST where upper(EMAIL) = upper('[email protected]');
Published by: Sven w. October 23, 2012 13:30
APEX: 4.2
Item Source type: SQL Query ( return a single value )I just noticed that you use an element that has this as the SQL source. This only works if the sql returns a row and a column only. That's why I removed the second column in your query.
Published by: Sven w. October 23, 2012 13:33
-
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for Linux: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Hello! I try to outdo a PL/SQL complex (many IFs and some columns depends on other "calculated" columns) using SQL 'Great', and I am failure. My question is to what extent I should stop writing SQL and then mix it with PL/SQL? TX in advance.
Published by: indra budiantho on January 26, 2013 14:28Indra budiantho wrote:
I try to outdo a PL/SQL complex (many IFs and some columns depends on other "calculated" columns) using SQL 'Great', and I am failure.
With the help of SQL does not mean a faster CASE statement, or a faster TO_CHAR(), PL/SQL.
So if you have 10 instructions BOX , which must be run once 1000, SQL and PL/SQL are just as fast.
So, why then do you prefer SQL?
Because for the statement SQL CASE , to assess data comes directly from the line being processed by that SQL.
Instead, one must use a SQL statement to retrieve the data for PL/SQL. The data travels all the way from this line, via the SQL, in memory of the PGA of PL/SQL. And only then PL/SQL can apply the CASE statement.
If performance differ not because the CASE statement is faster in one language than another, but because of the way that data gets the code in this CASE .
My question is to what extent I should stop writing SQL and then mix it with PL/SQL? TX in advance.
There is no rule set to be applied to answer this question. Also, keep in mind that SQL and PL/SQL can be mixed differently.
Create PL/SQL functions (for example business rule/translation) and call this function of SQL.
Pull the lines as is the SQL cursor in the memory of the PGA of PL/SQL and then Pat PL/SQL functions on these data from PGA (aka bulk collection).
Create a PL/SQL function, where the SQL engine provides (via a slider interface) lines of the pipeline in the pipeline, PL/SQL does little, then driven back a line of response to the SQL engine.
So it comes down to it depends..
-
How to build a SQL query to print ranges of week of a month
Hi gurus!
I have a requirement to create a query to display the times of week of a month.
The entries will be Year and month.
The result should be something like this:
If the year = 2009 and month = June
The SQL query should return the following:
June 1, 2009-June 6, 2009
June 7, 2009 to June 13, 2009
June 14, 2009-June 20, 2009
June 21, 2009-June 27, 2009
June 27, 2009 to June 30, 2009
I'm confused how to proceed. Please help me. Any help would be appreciated grately.
Thank you
AhmedHello
This might help (the exit is not exactly the same):
Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0 Connected as hr SQL> SQL> SELECT TRUNC(to_date('01-Jun-2009'), 2 'D') + 7 * (LEVEL - 1) AS START_DATE, 3 TRUNC(to_date('01-Jun-2009'), 4 'D') + 7 * (LEVEL - 1) + 6 AS END_DATE 5 FROM dual 6 CONNECT BY LEVEL <= 4; START_DATE END_DATE ----------- ----------- 31/05/2009 06/06/2009 07/06/2009 13/06/2009 14/06/2009 20/06/2009 21/06/2009 27/06/2009 SQL>
Kind regards
-
How to measure the performance of the sql query?
Hi Experts,
How to measure the cost of performance, efficiency and CPU of an sql query?
What are all the measures available to a sql query?
How to identify the optimal query writing?
I use Oracle 9i...
It'll be useful for me to write the effective query...
Thanks and greetingsPSRAM wrote:
Could you tell me how to activate the PLUSTRACE role?First put on when you do a search on PLUSTRACE: http://forums.oracle.com/forums/search.jspa?threadID=&q=plustrace&objID=f75&dateRange=all&numResults=15&rankBy=10001
Kind regards
Rob. -
eHref and a Case statement in Sql query
Hi all
I have a select statement that looks like this:
Select
case when dbms_desc = 'ORACLE' and then ' < a href = "f? p = & APP_ID.:115: & SESSION. : & DEBUG. : & PAGE. : 53 "> #DATABASE_NAME # < /a > '
When dbms_desc = "SQL SERVER" and then "< a href =" f? p = & APP_ID.:115: & SESSION. : & DEBUG. : & PAGE. : 59 "> #DATABASE_NAME # < /a > '"
Another null
end as database_name,
Decode(databases.inactive_flag,'Y','Yes','N','No',null) inactive_flag, servername,.
application name, decode(application.critical_flag,'Y','Yes','N','No',null) critical_flag,
Decode(application.inactive_flag,'Y','Yes','N','No',null) app_inactive_flag, databases.database_id
application, database, server, application_database_int
where databases.database_id = application_database_int.database_id (+) and
application_database_int.application_id = application.application_id (+) and
databases.server_id = server.server_id and: P54_DBMS_DESC = dbms_desc and
(upper (database_name) like '%' | upper(:P54_DATABASE_NAME) |) '%')
order by database_name
This query creates a report of classis. The result is the following:
I wanted to see was the name of the database in the first column in the form of links. What is the problem with the query?
INKA says:
I use Apex v5 and I don't see where I can put the attributes column for the column database_name "display under" for "Standard report column.
In the designer of the Page, select the report column in the browser on the left pane and change the properties in the property editor on the right, the column definition Type plain text and special escape characters No. See the Release Notes for the naming of the differences column property in the APEX 5.0.
-
SQL query to display the sum of the values of each June and December
Hello having problems of construction of a query to the list SQL query to display the sum of the values of each June and December each year.
My Table;
TABLE name: MONTH_TERM
Fields with values:
TERM_KEY MONTH_ACTUAL MONTH_DATE 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 What I would like to see in a query result:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 950 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 2525 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 2658 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 ---
Here's my query:
Select
"TERM_KEY,"
"MONTH_ACTUAL,"
to_char(MONTH_DATE,'MM/YYYY') MONTH_DATE,
DEAL to_char (MONTH_DATE, 'MM')
WHEN '06' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 1 and 6
AND term_key = 82)
WHEN '12' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 7 and 12
AND term_key = 82)
ELSE null
END as SIX_MO_CUMM,
of MONTH_TERM
where term_key = 82
It's my results:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/15 0:00 82 450 01/12/15 0:00 3608 82 405 01/01/16 0:00 82 400 01/02/16 0:00 82 450 01/03/16 0:00 82 425 01/04/16 0:00 82 435 01/05/16 0:00 82 410 01/06/16 0:00 3717 82 409 01/07/16 0:00 82 415 01/08/16 0:00 82 420 01/09/16 0:00 82 422 10/01/16 0:00 82 436 01/11/16 0:00 82 556 01/12/16 0:00 3608 82 568 01/01/17 0:00 82 624 01/02/17 0:00 Any ideas on how to fix would be great
Select term_key,
month_actual,
month_date,
case mod (to_char (month_date, 'mm'), 6)
When 0 then sum (month_actual)
During)
term_key partition
order of month_date
between the previous month '5' interval and the current line
)
end '6 MONTHS in TOTAL'
from tbl
order of term_key,
month_date
/
TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 500 NOVEMBER 1ST, 15TH
82 450 1 DECEMBER 15 950
82 405 1 JANUARY 16
82 400 1 FEBRUARY 16
82 450 1ST MARCH 16
82 425 1ST APRIL 16
82 435 1 MAY 16
82 410 2525 1 JUNE 16
82 409 1 JULY 16
82 415 1ST AUGUST 16
82 420 16 - SEP - 01TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 422 1 OCTOBER 16
82-436 NOVEMBER 1, 16
82 556 2658 1 DECEMBER 16
82 568 1 JANUARY 17
82 624 1 FEBRUARY 1716 selected lines.
SQL >
SY.
-
Hello
SQL query to find the total number of source based nonsource passangersbetween source and destination station and passenger station on the same chekindate.
Please help on this script and let me know if you need more details.
---
You use a SELECT statement. Let me know if you need more details.
-
For the MONEY and to break on a column SQL query
Hello
I have a situation where the data in the table are as below
AA
BB
1
FG
1
FG
1
FG
2
SS
1
FG
I need to write a sql query that would give output like below. Basically, it must break BB of the column and the value of the sum up to what it breaks.
AA
BB
3
FG
2
SS
1
FG
Please suggest.
Thank you
Shankar
Hello
770914 wrote:
Hello
I have a situation where the data in the table are as below
AA
BB
1
FG
1
FG
1
FG
2
SS
1
FG
I need to write a sql query that would give output like below. Basically, it must break BB of the column and the value of the sum up to what it breaks.
AA
BB
3
FG
2
SS
1
FG
Please suggest.
Thank you
Shankar
Remember, there is no order integrated to the rows in a table. The table you have posted is exactly the same as:
AA bb
-- --
1 FG
1 FG
2 SS
1 FG
1 FG
and both are exactly the same as:
AA bb
-- --
2 SS
1 FG
1 FG
1 FG
1 FG
If you use words like 'first', 'previous' or 'row' when it comes to lines, then we must define what these words mean. This is usually done by making reference to a column in the table. For example, if you had a column called r_num, like this:
AA bb r_num
-- -- -----
1 FG 1
1 FG 2
1 FG 9
2 SS 10
1 FG 10.5
Then, it would be wise to say things like 'the table starts with 3 lines consecutive "FG", followed by "SS". After that there is another "FG", which is the last line in the table, WHEN TRIE BY R_NUM. If the part about "WHEN SORTED BY R_NUM" is not known, the words 'begins '. "consecutive", 'followed', 'after' and 'last' have no meaning.
If (and only if) you have somehting like r_num in your table. Then you can get the resutls you want like this:
WITH got_group_num AS
(
SELECT aa, bb, r_num
ROW_NUMBER () OVER (ORDER BY r_num)
-ROW_NUMBER () OVER (PARTITION BY bb
ORDER BY r_num
) AS group_num
FROM table_x
)
SELECT SUM (aa) AS total_aa
, bb
OF got_group_num
GROUP BY bb
group_num
ORDER OF MIN (r_num)
;
-
Hi team,
For example if I have a demo table with 4 columns (A, B, C, D) DEMO.
I want a report on this table, such that the report contains the headers and the Details section.
For each unique combination of (A, B) I must first of all show header based on the header information I want to display the detailed section.
In my header section I want to display 2 columns (A, B) that are common to the detailed section. Remaining 2 columns in the detailed section.
Here is an example: -.
A B C D
1 5 9 3
1 5P8
1 5 P O
1-5-9
1 8 9
1 D * /
2 8 33 P
2 P O O
2 P L L
YOU WILL SEE
A AND B
1 5
C D
9 3
P 8
P O
A AND B
1 D
C D
5 9
8 9
* /
A AND B
2 P
C D
8 33
O O
L L
Please suggest the solution (sql query) for above the problem and how to nest gernerated headers dynamically in the report area.
I use APEX 4.0
Any position in this regard is very significant.
Thanks and greetings
RajendraTry this:
SQL> select * from tab; 1 5 9 3 1 5 P 8 1 5 P O 1 D 5 9 1 D 8 9 1 P 8 3 1 P O O 7 rows selected. SQL> select a,b from (select r,a,b from ( select to_char(rownum)||'a' r, 'A' a,'B' b from (select distinct a, b from tab order by a,b)) union ( select to_char(rownum)||'c' r, 'C' c,'D' d from (select distinct a, b from tab order by a,b)) union ( select to_char(rownum)||'b' r, a,b from (select distinct a, b from tab order by a,b)) union select parent.r, tab.c, tab.d from ( select to_char(rownum)||'d' r, a,b from (select distinct a, b from tab order by a,b)) parent , tab where parent.a=tab.a and parent.b=tab.b ) order by r ; A B 1 5 C D 9 3 P 8 P O A B 1 D C D 5 9 8 9 A B 1 P C D 8 3 O O
Maybe you are looking for
-
Hello I have the 6.6.1 version of Keynote and I use a Macbook Pro in El Capitan. When I do a presentation with Keynote, I need to send in a .pdf format. My problem: when I print the document with pdf converter provided by Apple, I lose all hyperlinks
-
If you see Firefox full screen can you get a toolbar preferred to appear with the address bar?
When you put Firefox in full screen all toolbars disappear. When you hover over the top of the screen in the address bar and appear bar "open tabs. Is it possible to get the toolbar Favorites to appear as well? If not, is there another way to access
-
Portege Z10t-A140 - battery and BIOS update question
I have PT131V Z10T-A140 I have problem 3: 1 after almost 3 months, now toshiba shows healthcare program my battery is just.2 - toshiba program show lunch new bios (2.00) for z10t, but can not find the BIOS on toshiba website (download page) [link: ht
-
problems with wifi after update? anyone?
I use A953, just updated to build mils2_u6_4.1 - 22, the system version is: 64.1.22.S953. Retail.en.DE So far, I like the update, looks cool, like the animation of the screen-go-to-sleep But, my WiFi is not working properly, there are just a couple o
-
Restore lost documents when Adobe app is deleted
How to restore the documents in Adobe reader when the application has been removed from the IPAD by mistake (there is no backup ITunes /)