How to execute the query for a block based on the parameter
Hi All,
Good evening.
i have requirement where i need to display the data in one block based on the selected items.
the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
i am not getting how to achieve this..i am very new to oracle forms..
Please Help..
Thanks
Bharat
please help..it is urgent..
thanks
bharat
Edited by: Bharat on Jan 31, 2012 5:19 AM
Bharat wrote:
Hi All,
Good evening.
i have requirement where i need to display the data in one block based on the selected items.
the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
i am not getting how to achieve this..i am very new to oracle forms..Another way you can do this. Create a lov and don't assign it to any column just one return item (should be id).
Now create a button may be your "apply button" write two trigger when-button-press and when-mouse-click.
at When -Button-Press trigger, change the block state to 'ENTER-QUERY' and at when-mouse-click show the LOV and then write execute_query.
Hope this will help you.
If someone's response is helpful or correct, please mark it accordingly.
Similar Messages
-
How to tune the query for duplicate records while joining the two tables
hi,i am executing the query which has retrieving multiple tables,in which one of them has duplicate record,how to get single record
Not enough info...subject says "tune" the query, message says "write" the query...and where is actual query that you had tried ?
-
When I'm looking through and trying to manage my Podcast library within iTunes, I see the exclamation point symbol next to several. My first issue is the fact that there are many that have this symbol that I only wanted a few episodes and not a subscription. How can I fix this problem?
My second issue is that for many of the podcasts with the exclamation point symbol, they don't fit the criteria based on what's in the Symbol FAQ, which states that there are too many unplayed episodes so new episodes won't download. For the podcasts in question, this is not the case, as all episodes have been listened to. What can be done to fix this problem?
My third issue is the fact that when I DO play a podcast on my iPod Touch (4th Gen), I don't use the app (can't stand it), then go to sync it with the computer, these episodes are shown as having already been played PRIOR to the actual syncing happening. So, when I go to do the ACTUAL sync, the play count is off. Right now, I have to manually reset the play count so that the episodes that I listened to on my iPod Touch only show one play in the library count, not two or in some cases, three. How can I fix this problem?
I have the most current version of iTunes and use Windows 7 64-bit.
Thanks for ANY help!Try this Support Article > http://support.apple.com/kb/HT1808
-
Revoking the access for a user based on the date specified by the certifier.
Hi,
Is it possible for the certifier to specify a date before he clicks on "Revoke" so that the user access is revoked on specified date in R2 PS2.
Regards,
ShivaHi User,
In the logical column write case when statement
case when valueof_nqsession(ROLE)= 'Manager' and Restricted_USER='Y' then null else table_name.column_name end
Use conditions(11g) for the same column and define if the report retrives results show the report wihotu having column if it has results show report with column
Guided Navigation/Conditions you should use !
http://total-bi.com/2011/01/obiee-hide-show-sections/
Thanks,
Saichand -
How to see the data records for a dso based upon the request id?
Hi all,
How to see the data records based upon the request id on the dso.
I need to see the data for a dso based upon the request id 444493 loaded from another dso through repair full update.
thanksHi,
Step 1: select your request from DSO request tb
Step 2: Select your DSO just above your contents/requests/reconstruction tabs
Step 3: Click contents(Spectacles symbol) in the top area of your screen
Step 4: Slect the required fields
Regards,
Suman -
Job and salary for that job based on the department!!!
Please, can somebody help me with this. I'm facing some challenges getting the required result with my queries.
Here's what am trying to do:
A query to display the job, the salary for that job based on the department number, and the total salary for that job, for departments 20, 50, 80, 90, assuming the schema in use is the hr schema. The job should be distinct, no duplicates.
Thank you for your anticipated answers.
I really appreciate your replies in advance.
T.O846641 wrote:
Please, can somebody help me with this. I'm facing some challenges getting the required result with my queries.
Here's what am trying to do:
A query to display the job, the salary for that job based on the department number, and the total salary for that job,What do you mean by "the salary for that job"? It sounds like you want something besides the total salary (which is what the SUM function provides). What is that other something? The avgerage salary (that would be the AVG function)? The smallest salaary (MIN)? The biggest salary (MAX)? The number of rows that have a salary (COUNT)? If you can explain what you want, someone will help you get it.
for departments 20, 50, 80, 90, assuming the schema in use is the hr schema. The job should be distinct, no duplicates.GROUP BY automatically gets distinct results for each of the GROUP BY expresssions, so there's no need to say SELECT DISTINCT . The previous solution could be better written as:
SELECT job_id
, SUM (salary) AS total_salry
, department_id
FROM hr.employees
WHERE department_id IN (20, 50, 80, 90)
GROUP BY department_id
, job_id
ORDER BY department_id
, job_id
;The output that this produces from the Oracle-supplied hr.employees table is:
JOB_ID TOTAL_SALRY DEPARTMENT_ID
MK_MAN 13000 20
MK_REP 6000 20
SH_CLERK 64300 50
ST_CLERK 55700 50
ST_MAN 36400 50
SA_MAN 61000 80
SA_REP 243500 80
AD_PRES 24000 90
AD_VP 34000 90I hope that's what you wanted.
If not, post the results you do want from this same table. Explain how you get those results.
Always say which version of Oracle you're using. It might not matter in this case, but why take a chance? -
Issue While executing the Query for Pagination using ROWNUM with like
Issue While executing the Query for Pagination using ROWNUM with like.
Database is Oracle11G.
Oracle Database Table contains 8-9 lakh records
1) SQL equal (=)
SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
WHERE A.REFERENCE = 'KMF22600920'
Execution Time:- 0.00869245 seconds
Returns 2 resultsets
2) SQL like (one %)
SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
WHERE A.REFERENCE = 'KMF22600920%'
Execution Time:- 0.01094301 seconds
Returns 2 resultsets
3) SQL like (two%)
SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
WHERE A.REFERENCE like '%KMF22600920%'
Execution Time:- 6.43989658 seconds
Returns 2 resultsets
In Pagination, we are using Modified version of SQL Query 3) with ROWNUM as mentioned below :-
4) SELECT * FROM (
SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
WHERE REFERENCE like '%KMF22600920%' AND ROWNUM <= 20 ) WHERE RNUM > 0
Execution Time:- Infinite
ResultSets:- No as execution time is infinite
a) Instead of like if we use = in the above query it is returning the 2 resultsets (execution time 0.02699282 seconds)
b) Instead of two % in the above query, if use one example REFERENCE like 'KMF22600920%' it is returning the 2 resultsets (execution time 0.03313019 seconds)
Issue:- When using two % in like in the above query i.e. REFERENCE like '%KMF22600920%' AND ROWNUM <= 20 ) , it is going to infinite.
Could you please let us know what is the issue with two % used in like and rownum
5) Modified version of Option1 query (move out the RNUM condition AND RNUM <= 20)
SELECT * FROM (
SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
WHERE REFERENCE like '%KMF22600920%' ) WHERE RNUM > 0 AND RNUM <= 20
Execution Time:- 7.41368914 seconds
Returns 2 resultsets
Is the above query is best optimized query which should be used for the Pagination or still can improve on this ?This would be easier to diagnose if there was an explain plan posted for the 'good' and 'bad' queries. Generally speaking using '%' on both sides precludes the use of any indexes.
-
How to tune this query for the improve performance ?
Hi All,
How to tune this query for the improve performance ?
select a.claim_number,a.pay_cd,a.claim_occurrence_number,
case
when sum(case
when a.payment_status_cd ='0'
then a.payment_est_amt
else 0
end
)=0
then 0
else (sum(case
when a.payment_status_cd='0'and a.payment_est_amt > 0
then a.payment_est_amt
else 0
end)
- sum(case
when a.payment_status_cd<>'0'
then a.payment_amt
else 0
end))
end as estimate
from ins_claim_payment a
where a.as_of_date between '31-jan-03' and '30-aug-06'
and ( a.data_source = '25' or (a.data_source between '27' and '29'))
and substr(a.pay_cd,1,1) IN ('2','3','4','8','9')
group by a.claim_number, a.pay_cd, a.claim_occurrence_number
Thank you,
MckaMcka
As well as EXPLAIN PLAN, let us know what proportion of rows are visited by this query. It may be that it is not using a full table scan when it should (or vice versa).
And of course we'd need to know what indexes are available, and how selective they are for the predicated you have in this query ...
Regards Nigel -
How to execute a query when pressing a button
hi,
i created a frame (ADF Swing).
in this frame i have a textfield, a button and a jtable.
i want when i press on the button i execute a query which has a condition in the textfield and i want that the result will be shown in the jtable.
thanks for help.Hello,
I would test the record status of the first record in the block. If this status is 'NEW', then there is no record retrieved, so that you can exit the query mode with exit_form()
Francois -
Not allowing to query for all blocks.
hi,
i have a new question.
I'm not able to query in all the fields of all blocks.
I'm able to query only in all fields of master-block. But not able to query in fields of other blocks.
I have set 'query all records' in the property palette to 'Yes'.
What should i do do allow it query & execute in all fields of all blocks?
Thank you.Pl do not post duplicates - Not allowing to query for all blocks.
-
How to build sql query for view object at run time
Hi,
I have a LOV on my form that is created from a view object.
View object is read-only and is created from a SQL query.
SQL query consists of few input parameters and table joins.
My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
Thanks
Srikanth AddankiAs I understand you want to change the query at run time.
If this is what you want, you can use setQuery Method then use executeQuery.
http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_ -
How can I have a standard text block appear on the last page of my documents?
How can I have a standard text block appear on the last page of my documents without having to type it in all the time? I have a terms statement with a line for a customer’s signature which I want on the last page of my invoices and right now I have to type it in each time or cut and paste it from a previous invoice. I already have a Master Page that includes the customer information and my company information at the top of each page and I am using data merge to fill each page with the items ordered and their pictures etc. I would just like to have this standard terms block automatically show up on the last page after the last item in the data merge.
Thank you all in advance for your help.Thank you Peter. This works. I have the text block now at the bottom of a second master page which I apply to the last page. For aesthetics I can modify the position of the text block in the new master page to bring it up from the bottom under the last item ordered when there is less than 4 items on the page. (my data merge fits up to 4 items with their images on a page). If the last page is full I’ll insert a final page using the second master and also bring it up to the top of the page.
-
How to execute SQL Query in Code behind Using infopath 2010?
Hi,
I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
Thanks In Advance
Shoeb AhmadHello,
You first need to add new SQL DB connection then you need execute connection from code behind.
See below link to create new connection
http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
Then use below code to execute this connection:
AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
string origCommand = Select * from tablename;
conn.Command = origCommand;
conn.Execute();
Finally bind your table:
http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to write select query for this
Hi,
I had a html form and in the for i had drop down box and it needs to select multiple values from the drop down box. When i select multiple values then i have to write the SQL select statement query .
When i try to write the select statement and trying to run i am getting error.
select * from Table
where emo_no = '1,2,3'
this is how i write query please suggest me how to write query for selecting multiple values from the drop down box.
Thanksselect * from Table
where emo_no in ( 1,2,3)
for integer values
select * from Table
where emo_no in ('1','2','3')
for characters
If we talk about large scale applications that may have millions of records, I would suggest this.
declare @t table (v int)
insert into t (v) values (1)
insert into t (v) valves (2)
insert into t (v) values (3)
select *
from table
inner join @t t on table.emo_no = t.v
Using "in" for a where clause is not so bad for filtering on a few values, but if you are filtering a lot of rows and a lot of values (emo_no) the performance degrades quickly for some reasons beyond the scope of this.
This is just one solution, I'll through this out as well, instead of an in memory (@t) table, doing a disk based temp table (#t) and creating an index on the column "v".
create table #t (v int)
insert into #t (v) values (1)
insert into #t (v) valves (2)
insert into #t (v) values (3)
create index ix_t on #t (v)
select *
from table
inner join #t t on table.emo_no = t.v
drop table #t
Pardon any syntax errors and careful using a drop statement.
Sometimes in memory tables work better than disk temp tables, it takes some testing and trial and error depending on your datasets to determine the best solution.
Probably too much info ;-)
Byron Mann
[email protected]
[email protected]
Software Architect
hosting.com | hostmysite.com
http://www.hostmysite.com/?utm_source=bb -
How to execute a loop for every 15 minutes
how to execute a loop for every 15 minutes or 30 minutes constantly...
I need to insert a number into an array for every 15mins continuously..and the array need to hold all datas for example in 0th position i insert a value 10 by 10.00am, after that at 1st position i need to insert 11 by 10.15am, next at 2nd position i need to insert 12 by 10.30am and so on...how this can be done
Maybe you are looking for
-
Hi everyone, I'm working on a template in wad and I have to check whether the user has choosen values in different dropdown boxes or not. How do I do this? I tried different things with the command wizzard and javascript but don't know how to impleme
-
Restrict SaTy for 1 Customer in a Sales Org
Hello, I have a scenario where a specific sales document type is to be restricted for 1 customer. All other customers for the particular Sales Org / Dist Channel / Division are to use this sales document type except for this customer, and my user wo
-
Best Practice for stopping unsolicited e-mails that are not detected as SPAM or Marketing?
I have roughly 40,000 mailboxes behind some IronPort appliances. My question for all of you veteran SMTP admins is how do you handle situations where you have an individual sending multiple e-mails to one of your mailboxes? It's not really a big e
-
Is it possible to set text and rotatation in stored table formats?
I have a table that is a good candidate to be a table format because it will be resued many times. The heading text will not change and some of the text is rotated, so I'd like to store that too. Is there a way to do this in FM9? Here's a sample o
-
How to create subproject & Object for LSMW
How to create subproject & Object for LSMW