View object editor for complex sql query in expert mode
I find not convenient that the editor is modal so we cannot browse tables or procedure functions definition and that it is not possible to close it even the statement is not correct (to search for exact naming etc ...).
May a way will be to show a list of corresponding database objects during typing like the java edit with the classes
I filed enhancement request # 6062896 to track this suggestion. thanks.
At a minimum, by production, we plan to re-enable the query-builder that was offered in 10.1.3, which should help with formulating queries in terms of table/column names.
Similar Messages
-
Hi,
When I did exactly as the JHeadstart Tutorial says, I noticed that
in JHeadstart 10.1.2 with JDeveloper 10.1.2
JHeadstart does not save any changes I make in the View Object Editor
of the Application Structure File Editor !!!
For instance when I change the Width property of an Attribute from 60 to 5
it changes to 5, but when close the View Object Editor
and reopen it again, the Width is back to 60...
Even when I click the button "Validate the Application Structure File" before
closing the VO Editor....
What do I do ??? Is the only solution to edit the XML file
or something like that without using the VO Editor ?
Or is there a better solution ?
Does it maybe work in an older version of JHeadstart ?
If so, where is the older version available for download ?
Thanks,
Eric JoosseEric,
How did you leave the JHeadstart VO editor?
The changes should be saved when you click the OK button in the VO editor itself, but they are not saved if you click Cancel, or the little cross in the upper right corner, or leave it open while going back to the Application Structure File editor. That's because it's a standalone editor (you can also find it when right-mouse-clicking the VO in the Model project). The icon in the Application Structure File editor is just a quick way to get to it.
Hope this helps,
Sandra Muller
JHeadstart Team
Oracle Consulting -
Hello,
My question is: I would like to do more complex sql query ( i need to use GROUP BY, HAVING, ORDER BY). Is possible do it with CMP entity bean, or i have to use BMP entity bean or Session bean? Query return about 20-30 items. Can you recommend some design pattern for this situation?
Thanks in advance
Daniel HHello,
My question is: I would like to do more complex sql query ( i need to use GROUP BY, HAVING, ORDER BY). Is possible do it with CMP entity bean, or i have to use BMP entity bean or Session bean? Query return about 20-30 items. Can you recommend some design pattern for this situation?
Thanks in advance
Daniel H -
JDev 10.1.3 EA Studio Edition - View Object Editor java glitch
Just thought I'd mention what appears to be a glitch - under the "java" section of the View Object editor, the checkbox for generate "Custom Java DataSource Methods" does not appear to function. Selecting it does not add the custom datasource methods in the View Object class.
Just thought I'd mention what appears to be a glitch - under the "java" section of the View Object editor, the checkbox for generate "Custom Java DataSource Methods" does not appear to function. Selecting it does not add the custom datasource methods in the View Object class.
-
Hi All,
I am looking for an SQL query to request the HDS database to find out which Directory Number / instrument was associated with a specific CTI OS agent login ID.
Has anyone done such a query before ?
Thanks and Regards
NickHi,
this should work in 8.0 and 8.5:
SELECT
ag.PeripheralNumber AS [LoginID],
al.Extension,
al.LogoutDateTime
FROM [instance]_hds.dbo.Agent_Logout al
JOIN [instance]_awdb.dbo.Agent ag ON al.SkillTargetID = ag.SkillTargetID
Of course, replace [instance] with the ICM instance.
The query returns a table with three columns, first is the login ID aka PeripheralNumber, Extension is... well, the agent's extension, and LogoutDateTime is the timestamp when the agent logged out.
G. -
Hi Team,
I am looking for an SQL query to check the data (ECC + CallVariable) received following a RUN SCRIPT RESULT when requesting an external VRU with a Translation Route to VRU with a "Run External Script".
I believe the data are parsed between the Termination Call Detail + Termination Call Variable .
If you already have such an SQL query I would very much appreciate to have it.
Thank you and Regards
NickOmar,
with all due respect, shortening a one day's interval might not be an option for a historical report ;-)
I would recommend to take a look the following SQL query:
DECLARE @dateFrom DATETIME, @dateTo DATETIME
SET @dateFrom = '2014-01-24 00:00:00'
SET @dateTo = '2014-01-25 00:00:00'
SELECT
tcv.DateTime,
tcd.RecoveryKey,
tcd.RouterCallKeyDay,
tcd.RouterCallKey,
ecv.EnterpriseName AS [ECVEnterpriseName],
tcv.ArrayIndex,
tcv.ECCValue
FROM Termination_Call_Variable tcv
JOIN
(SELECT RouterCallKeyDay,RouterCallKey,RecoveryKey FROM Termination_Call_Detail WHERE DateTime > @dateFrom AND DateTime < @dateTo) tcd
ON tcv.TCDRecoveryKey = tcd.RecoveryKey
LEFT OUTER JOIN Expanded_Call_Variable ecv ON tcv.ExpandedCallVariableID = ecv.ExpandedCallVariableID
WHERE tcv.DateTime > @dateFrom AND tcv.DateTime < @dateTo
With variables, you can parametrize your code (for instance, you could write SET @dateFrom = ? and let the calling application fill in the datetime value in for you).
Plus joining two large tables with all rows like you did (TCD-TCV) is never a good option.
Another aspect to consider: all ECC's are actually arrays (always), so it's not good to leave out the index value (tcv.ArrayIndex).
G. -
Some of the description of object ID for job master query is displayed in g
some of the description of object ID for job master query is displayed in german language although the language is set as english.This happens in production system.wat may be the issue with this....
ya i checked it is EN only.....but still some problem exists......
-
List the count of each schema objects.. schema wise sql query needed
Hi Friends,
i need a sql query which has to list the schema name along with the count of schema objects like tables,views,triggers.... order by schemaname
Regards,
DBHi
You can try this option if you use 11g .
Get all the object types in your db.
SELECT DISTINCT object_type
FROM dba_objects;Then include all the object types in to the below query.
select *
from (select owner, object_type, 1 CNT
from dba_objects ) e
pivot( sum(CNT) for object_type in
( 'INDEX','TYPE','VIEW','LIBRARY','TRIGGER','DIRECTORY','PACKAGE','QUEUE','PACKAGE BODY','TABLE PARTITION','PROCEDURE',
'WINDOW','CLUSTER','LOB','FUNCTION','CONSUMER GROUP','CONTEXT','RULE','XML SCHEMA','SEQUENCE','INDEX PARTITION','OPERATOR',
'EVALUATION CONTEXT','SCHEDULE','JOB','SCHEDULER GROUP','LOB PARTITION','JOB CLASS','INDEXTYPE','TABLE','TYPE BODY','RESOURCE PLAN',
'TABLE SUBPARTITION','UNDEFINED','DESTINATION','SYNONYM','EDITION','PROGRAM','RULE SET' ) )
order by owner;Cheers
Kanchana -
SQLEception using Complex SQL Query with Java Studio Creator2 Build(060120)
I am evaluating Java Studio Creator2 for a WEB base application project that will be making SQL queries to an Oracle Database but I have stumble into a problem using complex SQL queries.
I am getting an SQLException "org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: [sunm][Oracle JDBC Driver][Oracle]ORA-00923: FROM keyword not found where expected". I looks like it cut my sql.
The SQL that I am trying to execute is
Select part_name
from table1, table2
where table1.part_nbr = table2.part_nbr
and table2.row_add_dt = (select max(table3.row_add_dt)
from table3
where table3.ser_part_id =table2.ser_part_id)
This is a valid query that it is using 2 different selects to get a part number.
If posible, point me to the best solution were I will be able to make complex SQL queries like the one above and bigger.
Is there any way that I can read an SQL query file instead of inserting the SQL query string into the setCommand()?I have read that document looking for some anwsers on how to make this kind of query. If I try the query that I have above in the query editor ,the query editor will cut off from the last select that is between ().
I beleave, there is a work around using the inner joint or outter join command. I will try them to see If I get the corrent result. If not, then I have to keep on asking for possible solutions.
Anyway, someone in the Creator Team should take a note in adding something like a special criteria in the Add Query Criteria Box for cases like the one I have. The special criteria will be like using another select/from/where to get some result that will be compare.
Girish, Are you in the Sun Creator Team? -
Visual Web - How to 'setObject' for an SQL query with an IN ? clause
Hello, I am relatively new to visual web pack. I am stuck at writing the java code for passing parameters to the SQL query. In a normal scenario, where we need to check if some variable is present in a column (= ?), we would pass the parameter as :
setObject(1, whatevervalue);
How do we pass parameters if we need to check for more than one variable? The query editor in VWP has the option IN, which allows us to check for more than one match in a column. The IN clause is supposed to allow the format ('ex1', 'ex2' ...). I tried using an array as a parameter, like, setObject(1, somearray). It gives me a null exception. I even tried sending a variable in ('ex1', 'ex2' ...) format; doesn't like it either.
Any help is greatly appreciated.Check the following docs:
http://www.netbeans.org/kb/60/web/databoundcomponents.html
http://www.netbeans.org/kb/60/web/inserts-updates-deletes.html
See also:
http://developers.sun.com/jscreator/reference/techart/2/query-editor.html -
Update Field On Change For A SQL Query (updateable report)
Hi,
I'd like to request help from anyone with ideas on how to solve this.
We are using APEX 4.2, 10GR2, RedHat5.
I have a report that comes from SQL Query (updateable report).
I'm using the apex_item.text and apex_item.hidden on fields.
I'm using a button to submit and after submit process to add some logic that I need.
There could be 1 - 10 records in the report.
There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
This is the question
When the value of that field is changed then the value of another field in the same row changes immediately.
Is this possible?
All the examples I've seen so far are for a single record and that doesn't work for us.
I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
Could anyone direct me to where I can see an example or help me get directions?
I appreciate all your help an comments and I thank you in advance.Yes why not...what you looking for is a ajax call
See {message:id=10390979}
Please note:-you can also do this as a dynamic action as shown below
Event: Change
Selection type: jQuery Selector
jQuery Selector: input[name="f01"]
True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this -
How to pass a variable for a SQL query in OLEDB source?
Hi All,
I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
eg:
1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
2) I have the file Name in a variable called Variable1.
3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
Any help/suggestions would be of great help.
Thanks,
SriJust to add with Vaibhav comment .
SQL Command : SQL query either with SQL variable or any condition or simple Sql statement
Like ;
Select * from dimcustomer
SQL Command using Varible :
Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
If you Sql query needs a condition based on SSIS variable .
you can find a Example here :
http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
Need help in improving the performance for the sql query
Thanks in advance for helping me.
I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. The data count which is updated in the target table is 2 million records and the target table has 15 million records.
Any suggestions or solutions for improving performance are appreciated
SQL query:
update targettable tt
set mnop = 'G',
where ( x,y,z ) in
select a.x, a.y,a.z
from table1 a
where (a.x, a.y,a.z) not in (
select b.x,b.y,b.z
from table2 b
where 'O' = b.defg
and mnop = 'P'
and hijkl = 'UVW';987981 wrote:
I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. And that meant what? Surely if you spend all that time and effort to try various approaches, it should mean something? Failures are as important teachers as successes. You need to learn from failures too. :-)
The data count which is updated in the target table is 2 million records and the target table has 15 million records.Tables have rows btw, not records. Database people tend to get upset when rows are called records, as records exist in files and a database is not a mere collection of records and files.
The failure to find a single faster method with the approaches you tried, points to that you do not know what the actual performance problem is. And without knowing the problem, you still went ahead, guns blazing.
The very first step in dealing with any software engineering problem, is to identify the problem. Seeing the symptoms (slow performance) is still a long way from problem identification.
Part of identifying the performance problem, is understanding the workload. Just what does the code task the database to do?
From your comments, it needs to find 2 million rows from 15 million rows. Change these rows. And then write 2 million rows back to disk.
That is not a small workload. Simple example. Let's say that the 2 million row find is 1ms/row and the 2 million row write is also 1ms/row. This means a 66 minute workload. Due to the number of rows, an increase in time/row either way, will potentially have 2 million fold impact.
So where is the performance problem? Time spend finding the 2 million rows (where other tables need to be read, indexes used, etc)? Time spend writing the 2 million rows (where triggers and indexes need to be fired and maintained)? Both? -
Minus operator versus 'not exists' for faster SQL query
Hi everybody,
Does anyone know if rewriting a query to use the MINUS operator instead of using NOT EXISTS in the query is faster, giving all else is the same?
Thanks very much!
Bill Loggins
801-971-6837
[email protected]It really depends on a bunch of factors.
A MINUS will do a full table scan on both tables unless there is some criteria in the where clause of both queries that allows an index range scan. A MINUS also requires that both queries have the same number of columns, and that each column has the same data type as the corresponding column in the other query (or one convertible to the same type). A MINUS will return all rows from the first query where there is not an exact match column for column with the second query. A MINUS also requires an implicit sort of both queries
NOT EXISTS will read the sub-query once for each row in the outer query. If the correlation field (you are running a correlated sub-query?) is an indexed field, then only an index scan is done.
The choice of which construct to use depends on the type of data you want to return, and also the relative sizes of the two tables/queries. If the outer table is small relative to the inner one, and the inner table is indexed (preferrable a unique index but not required) on the correlation field, then NOT EXISTS will probably be faster since the index lookup will be pretty fast, and only executed a relatively few times. If both tables a roughly the same size, then MINUS might be faster, particularly if you can live with only seeing fields that you are comparing on.
For example, if you have two tables
EMPLOYEE
EMPID NUMBER
NAME VARCHAR2(45)
JOB VARCHAR2(45)
HIRE_DATE DATE
and
RETIREE
EMPID NUMBER
NAME VARCHAR2(45)
RET_DATE DATEIf you wanted to see if you had retirees that were not in the employee table, then you could use either MINUS or NOT EXISTS (or even NOT IN, but you didn't ask). However you could possibly get different results.
SELECT empid,name
FROM retirees
MINUS
SELECT empid,name
FROM employeeswould show retirees not in the emp table, but it would also show a retiree who had changed their name while retired. A safer version of the above using MINUS would be
SELECT empid,name
FROM retirees
WHERE empid IN (SELECT empid
FROM retirees
MINUS
SELECT empid
FROM employees)A full scan of retirees, a full scan of employees (Assuming indexes on both, then maybe an index fast full scan) and two sorts for the minus, at best an index probe then table access by rowid on retirees, possibly a full scan of retirees for the outer query.
Assuming that employees is indexd on empid then
SELECT empid,name
FROM retirees
WHERE NOT EXISTS (SELECT 1
FROM employees
WHERE retirees.empid = employees.empid)requires a full scan of retirees and an index access into employees index for each row.
As with most things SQL, the only real way to tell is to benchmark.
HTH
John -
Hi,
I was wondering if I could have some help with the query I have below for this general data set, please? I need to do it in a single SQL statement. We're currently running Oracle 10g. The piece I'm struggling with is identifying that the person has all the items in a collection and to include the collection in the resulting collection of items.
persons_items
person item
Ted cup
Ted saucer
Ted plate
Ted fork
Alice book
Alice thimble
Alice knife
Alice cup
Joe cup
Joe saucer
Joe plate
Joe knife
Joe fork
Joe spoon
Jessica spatula
Jessica dish
collections
collection_name item
crockery cup
crockery saucer
crockery plate
cutlery knife
cutlery fork
cutlery spoon
Query:
What single items and collections does Ted have? fork, crockery
What single items and collections does Alice have? book, thimble, knife, cup
What single items and collections does Joe have? crockery, cutlery
What single items and collections does Jessica have? spatula, dish
Thanks in advance.
PatExpanding on Brendan's solution...
For 11g:
SQL> ed
Wrote file afiedt.buf
1 WITH person_items AS (
2 SELECT 'Ted' person, 'cup' item FROM DUAL UNION
3 SELECT 'Ted', 'saucer' FROM DUAL UNION
4 SELECT 'Ted', 'plate' FROM DUAL UNION
5 SELECT 'Ted', 'fork' FROM DUAL UNION
6 SELECT 'Alice', 'book' FROM DUAL UNION
7 SELECT 'Alice', 'thimble' FROM DUAL UNION
8 SELECT 'Alice', 'knife' FROM DUAL UNION
9 SELECT 'Alice', 'cup' FROM DUAL UNION
10 SELECT 'Joe', 'cup' FROM DUAL UNION
11 SELECT 'Joe', 'saucer' FROM DUAL UNION
12 SELECT 'Joe', 'plate' FROM DUAL UNION
13 SELECT 'Joe', 'knife' FROM DUAL UNION
14 SELECT 'Joe', 'fork' FROM DUAL UNION
15 SELECT 'Joe', 'spoon' FROM DUAL UNION
16 SELECT 'Jessica', 'spatula' FROM DUAL UNION
17 SELECT 'Jessica', 'dish' FROM DUAL
18 ), collections AS (
19 SELECT 'crockery' collection_name, 'cup' item FROM DUAL UNION
20 SELECT 'crockery', 'saucer' FROM DUAL UNION
21 SELECT 'crockery', 'plate' FROM DUAL UNION
22 SELECT 'cutlery', 'knife' FROM DUAL UNION
23 SELECT 'cutlery', 'fork' FROM DUAL UNION
24 SELECT 'cutlery', 'spoon' FROM DUAL
25 ), person_item_colls AS (
26 SELECT pi.person, pi.item, co.collection_name,
27 Count(*) OVER (PARTITION BY pi.person, co.collection_name) n_col
28 FROM person_items pi
29 LEFT JOIN collections co
30 ON co.item = pi.item
31 )
32 select person, listagg(collection_name,',') within group (order by collection_name) as collections
33 from (
34 SELECT DISTINCT person, collection_name
35 FROM person_item_colls
36 WHERE collection_name IS NOT NULL
37 AND n_col > 1
38 UNION ALL
39 SELECT person, item
40 FROM person_item_colls
41 WHERE collection_name IS NULL
42 OR n_col = 1
43 )
44* group by person
SQL> /
PERSON COLLECTIONS
Alice book,cup,knife,thimble
Jessica dish,spatula
Joe crockery,cutlery
Ted crockery,forkFor 10g:
SQL> ed
Wrote file afiedt.buf
1 WITH person_items AS (
2 SELECT 'Ted' person, 'cup' item FROM DUAL UNION
3 SELECT 'Ted', 'saucer' FROM DUAL UNION
4 SELECT 'Ted', 'plate' FROM DUAL UNION
5 SELECT 'Ted', 'fork' FROM DUAL UNION
6 SELECT 'Alice', 'book' FROM DUAL UNION
7 SELECT 'Alice', 'thimble' FROM DUAL UNION
8 SELECT 'Alice', 'knife' FROM DUAL UNION
9 SELECT 'Alice', 'cup' FROM DUAL UNION
10 SELECT 'Joe', 'cup' FROM DUAL UNION
11 SELECT 'Joe', 'saucer' FROM DUAL UNION
12 SELECT 'Joe', 'plate' FROM DUAL UNION
13 SELECT 'Joe', 'knife' FROM DUAL UNION
14 SELECT 'Joe', 'fork' FROM DUAL UNION
15 SELECT 'Joe', 'spoon' FROM DUAL UNION
16 SELECT 'Jessica', 'spatula' FROM DUAL UNION
17 SELECT 'Jessica', 'dish' FROM DUAL
18 ), collections AS (
19 SELECT 'crockery' collection_name, 'cup' item FROM DUAL UNION
20 SELECT 'crockery', 'saucer' FROM DUAL UNION
21 SELECT 'crockery', 'plate' FROM DUAL UNION
22 SELECT 'cutlery', 'knife' FROM DUAL UNION
23 SELECT 'cutlery', 'fork' FROM DUAL UNION
24 SELECT 'cutlery', 'spoon' FROM DUAL
25 ), person_item_colls AS (
26 SELECT pi.person, pi.item, co.collection_name,
27 Count(*) OVER (PARTITION BY pi.person, co.collection_name) n_col
28 FROM person_items pi
29 LEFT JOIN collections co
30 ON co.item = pi.item
31 )
32 select person, ltrim(sys_connect_by_path(collection_name,','),',') as collections
33 from (
34 select person, collection_name, row_number() over (partition by person order by collection_name) as rn
35 from (
36 SELECT DISTINCT person, collection_name
37 FROM person_item_colls
38 WHERE collection_name IS NOT NULL
39 AND n_col > 1
40 UNION ALL
41 SELECT person, item
42 FROM person_item_colls
43 WHERE collection_name IS NULL
44 OR n_col = 1
45 )
46 )
47 where connect_by_isleaf = 1
48 connect by person = prior person and rn = prior rn + 1
49* start with rn = 1
SQL> /
PERSON COLLECTIONS
Alice book,cup,knife,thimble
Jessica dish,spatula
Joe crockery,cutlery
Ted crockery,fork
Maybe you are looking for
-
About to throw my thunderbolt and hope it breaks into a million pieces.
Sorry I know that sounds violent but I have had SO many problems with my Thunderbolt and my early upgrade isn't until November...The power button stopped working so I had to download an app that allows me to unlock my screen with the volume button. T
-
Best practice for cleaning up conversations after a recieve timeout
We have a pattern where sql server sends a message through service broker and waits for a response (say 10 ten secs), if it doesn't get a response, it will assume a default response and carry on. The response may come later and also end the conversat
-
I get a square box around any botton i want to push and only then can i access by double clicking. how do i get rid of this?
-
Itunes error message: the itunes library file cannot be saved.
Since I installed the latest version of itunes about a week ago I keep getting a pop-up saying 'the itunes library file cannot be saved. an unknown error occured (-50)' Noooo idea how to go about fixing this :S Please help
-
Comparing 2 dates .. urgent
Hi All, I am trying to compare 2 dates ( Calendar objects ) and not able to get the desired result. Here is the sample code Calendar date1 = Calendar.getInstance(); // 1st date date1.setTime( mdy4Format.parse( "07/31/2002" )); //mdy4Format is Si