block based query clause
Hi all...I use form 10g...
When I tried the query clause from block...
I used this query (SELECT * FROM exit INNER JOIN enter ON exit.ent_num = enter.ent_num where to enter departure = 1)...
When I run the form...
error frm-40505 oracle unable to execute the query
Thank you
Published by: osa3_12 on December 10, 2009 04:33
Hello
I think that you are joining two tables which have duplicate column names... In this case you must give the name of different aliases for the similar columns... You cannot use select *...
Should be selected enter.ent_num enter_ent_num, exit.ent_num exit_ent_num...
concerning
Dora
Tags: Oracle Development
Similar Questions
-
Block based on the stored procedure cannot modify Default_where clause
Hi all
I tried to create a block based on the stored procedure that it works very well with the result set for the refcursor. But if I need to add filters on the block using where clause in the palette of goods or
using the property block set in where clause, it does not error but does not review filters .
tried everything to you please let me know. This is a restriction whereby we can set filters on the block when we create the block based on the stored procedure.
Thank you
Check in Form Builder Help:
Creating a block of data from a procedure that uses a ref cursor
... You can't pass a WHERE or ORDER BY clause clause in a stored procedure.
But you can send your WHERE condition using the query Source Arguments.
If the procedure is on the side of the database (not in the forms module), ensure that the procedure is not vulnerable to injection of SQL code.
Kind regards
Zlatko
-
Query clause ignores to export records
Hi all;
I am trying to export a few records from table but query clause the customer the throwing error.
SCOTT > customer desc
Name Null? Type
----------------------------------------- -------- ----------------------------
NUMBER OF CUST_ID
CUST_NAME VARCHAR2 (15)
VARCHAR2 (15) REGION
NUMBER OF CUST_CREDIT_LIMIT
$ expdp System/Manager dumpfile = dp:1.dmp tables = scott.customers query = scott. "CUSTOMERS:" where exists (select cust_id from CUSTOMERS c where cust_credit_limit > 12400 and ku$ .cust_id = c.sust_id) "" reuse_dumpfiles = yes
Export: Release 11.2.0.1.0 - Production on Fri Aug 7 17:11:32 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With partitioning, OLAP, Data Mining and Real Application Testing options
Start "SYSTEM". "" SYS_EXPORT_TABLE_01 ": System / * dumpfile = dp:1.dmp tables = scott.customers query = scott. CUSTOMERS: "where exists (select cust_id from CUSTOMERS c where cust_credit_limit > 12400 and ku$ .cust_id = c.sust_id)" reuse_dumpfiles = yes "
Current estimation using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Object type TABLE_EXPORT/TABLE/TABLE processing
ORA-31693: Table object data 'SCOTT '. "' CUSTOMERS ' could not load/unload and being ignored because of the error:
ORA-00942: table or view does not exist
Main table 'SYSTEM '. "" SYS_EXPORT_TABLE_01 "properly load/unloaded
******************************************************************************
Empty the file system set. SYS_EXPORT_TABLE_01 is:
/U01/DataPump/1.dmp
Work 'SYSTEM '. "" SYS_EXPORT_TABLE_01 "completed with error (s 1) at 17:11:50
Hello
I think the problem is that you run the job as system by default, all object references are to the system, you need to change
$ expdp System/Manager dumpfile = dp:1.dmp tables = scott.customers query = scott. "CUSTOMERS:" where exists (select cust_id from CUSTOMERS c where cust_credit_limit > 12400 and ku$ .cust_id = c.sust_id) "" reuse_dumpfiles = yes
TO
$ expdp System/Manager dumpfile = dp:1.dmp tables = scott.customers query = scott. "CUSTOMERS:" where exists (select cust_id scott. CUSTOMER c where cust_credit_limit > 12400 and ku$ .cust_id = c.sust_id) "" reuse_dumpfiles = yes
I also recommend that you use one parfile to avoid problems of interpretation of the characters by the shell
See you soon,.
Rich
-
IDS sensor blocking based on received syslog denied ACL messages.
Hi / Help
How to set up the sensor 4230 (from the CSPM) to receive and generate alarms (and block) syslog messages send a Cisco router when an ACL denied is detected. For example, how the sensor generates an alarm (and block) based on a like this syslog message:
% S 6-IPACCESSLOGP: list 120 denied tcp 1.1.1.1 (80)-> 2.2.2.2 (1031)
I would be grateful if you could explain/describe the solution in detail.
In particular how the sensor to interpret the text of syslog and how he 'read' what to block.
What is the correct "text syntax" syslog to send before the sensor 'understand' and do the blocking.
Thank you.
Gert Schaarup
The following link shows how to configure by IDM on the sensor itself.
You will need to do the same steps using CSPM:
http://www.Cisco.com/univercd/CC/TD/doc/product/iaabu/csids/csids8/13876_01.htm#xtocid35
When an ACL is created the user can put a keyword "journal" at the end of a line to refuse to have a message from sylog created when this line refuses a package. Syslogs are sent to the sensor router (router must be configured to di it). For ACL syslog messages have a specific format that the sensor has been coded to identify. In this format, the IP is in a specific location. So if the sensor is configured correctly, then the sensor will create an alarm for this acl deny syslog message.
NOTE: The alarm is for that fact that the sensor has received an acl deny syslog message from the router. The acl who refused the package might have been created by the user or created sensor.
NOTE2: The alarm would be an acl that has already been created, it blocks the alarm would generate a new acl to block address that is already blocked. So it blocks these alarms is not common practice.
-
JDeveloper does not support the SQL expert, cannot add query clause to view link
For developers who can know:
I use JDeveloper 10.1.3.4 and I have two tables, we're STUDENTS, the other is the PRICE, with a one-to-many relationship (a student may have several awards), and ID is the foreign key:
In the application, when a student (9999, JOHN) connects, the information above is displayed. I need to add up all the awards for the student and to display not only the elements of price, but also the total amount of all awards. To do this, I created another object to view named TotalAwards in the object entity the price just to get the total amount. The SQL code of the VO'sSTUDENTS ------------------------ ID NAME DOB ------------------------ 9999 JOHN 01/02/1990 | | | | AWARDS | ------------------------ | ID DESC AMOUNT | ------------------------ ----------- 9999 PELL 500 9999 PERKINS 800 9999 LOAN 900
Then, a link is created between the students and the TotalAwards, and use of the new link to the view is added to the application module. TotalAwards is now available in the data control palette to be drag-and - drop to pages.SELECT SUM(Awards.AMOUNT) AS TOTAL FROM AWARDS Awards
Problem occurs when the application is invoked. An error is caught before the application can begin. The error message indicates that "the ends or the link view do not specify an attribute.
It seems that the TOTAL 'SUM (Awards.AMOUNT) AS TOTAL' is not recognized as an attribute. I have reviewed the query clause in the display link to see if it is there, such as:
There is no such clause in the query clause page. And I can not add a no more, because the page is grayed out and disabled. I think maybe it's for the same reason: TOTAL is not recognized as an attribute of the price.Attribute Bind Variable ------------ -------------- Students.ID :Bind_Id WHEHE :Bind_Id = Awards.ID
How to get around the problem? Or are there other ways to summarize the total amount and view it in the browser?
Thank you very much for help!
NewmanHello
Here you have a solution for the TOTAL:
http://www.freewebalbum.com/blogs/faces/bjanko/blogs.jsp?blog=bjanko20070725180020Kind regards
Branislav
-
How to query the master block based on one of the values of the detail block
Hello
In the form of version 6i, I have a field in data block which is not defined as a database element. I use this field to store a block of retail value. If I want to ask the form using this field (which represents one of the values of retail block), how should I do this? Pointers?
TIA,Yes, as Ammad10786 says, the ID's I mentioned are just placeholders for your real values. And done MASTERBLOCKID refers to columns in the masterblock which is the primary key or the join condition to the retail block.
-
Fill called block based on the criteria of the previous block
I have a form where the query is based on the zip code provided. I have a button in block has that calls another block b to display all records with this particular zip code. I want to display on the block b to display only the records for the specified zip code. Please help and tell me how to make this happen?-In the property WHERE-Clause of block b, enter:
: BLOCK_A.ZIP_CODE-Put a button next to the postcode of the block has
in the WHEN BUTTON PRESSED trigger, enter:
GO_BLOCK ("BLOCK B");
EXECUTE_QUERY;Another option would be to use a relationship between the two blocs.
-
Hello
I use this query in a from clause
SELECT PM.PATIENT_FILE_NO, PE.EPISODE_NO, DECODE(CURRENT_LANG_P_S, 'P', PATIENT_NAME_P || ' ' || PATIENT_NAME_2_P || ' ' || PATIENT_NAME_3_P || ' ' || PATIENT_NAME_F_P, PATIENT_NAME_S || ' ' || PATIENT_NAME_2_S || ' ' || PATIENT_NAME_3_S || ' ' || PATIENT_NAME_F_S) PATIENT_NAME, PE.START_DATE, PE.END_DATE, EXSYS.GET_AGE(PM.DATE_OF_BIRTH) AGE, CODES_PKG.GET_DESCRIPTION(PM.GENDER, 103) GENDER, PE.ATTENDANCE_TYPE, PATIENT_CATEGORY FROM RC_PATIENTS PM, RC_PATIENT_EPISODES PE WHERE PM.PATIENT_FILE_NO = PE.PATIENT_FILE_NO AND PE.STATUS != 'C'
The query works in "pl/sql Developer", but when I run the form I had 'query caused no records to retrieve.
-I wrote
go_block ('block_name');
execute_query;
in a trigger w-n-f-i
-J' have elements compatible with the number and names of the collected columns of the query, but I have more elements in the same block
??
I found it, thanks
There are certain triggers prevent execution of code
Thank you
-
BLOCK based ON PROCEDURES in the FORMS
I'm looking to create a stored procedure-based forms (10 gr 2) block and I am unable to get all records to display in the form after the interrogation.
So far, I have:
1) created a package that defines a Ref Cursor
(2) created a procedure in this package that returns the ref cursor. The package has 2 arguments: the first is the ref cursor, defined as in OUT. The second is a parameter used in the SELECTION that fills the ref cursor.
(3) only tested the procedure by writing a routine of PL/SQL separated and proved that the procedure works and returns the expected values.
(4) using the wizard block, I created the forms block according to the procedure.
(5) define the QUERY DATA SOURCE ARGUMENTS to provide the second argument required for the procedure. The argument is hardcoded to the same value I used during the test in step 3.
When I run the form, and run the query in the menu (QUERY-> EXECUTE), absolutely nothing happens.
Where should I start to solve this problem?
Thank youHave you tried the forum search? a block on the stored database procedure
-
Master detail form: block details query by description field
Hello
I have a form master detail where detail block has LOV by querying the master block, the block of retail is filled with the values of description not code values in the secondary table which I am able to do using Post-requete trigger on block of retail.
When go to mode query in detail block and enter the description and the query I get not all records. How to do the query mode works by description
Help, please
Thank youYes... you have to...
((table_col_desc comme: m_desc ou: m_desc est null))
and (as table_col_desc: m_desc_1 or: m_desc_1 is null)
and (as table_col_desc: m_desc_2 or: m_desc_2 is null)
)or include the clause to exist...
Guess it works for you... Post the result
Published by: Dora on December 15, 2009 08:25
-
Hello
There are three blocks: block 1 is based on two tables Table1 and Table2 block 2 is based on table 3.
Block 1 includes the fields: when enter query for Sku: 123, then it should show more results.
If primary Sku is not available then substitute with level 1 and if level 1 is out of stock then replaced by level 2.Sku : 123 Price : $100 Qty : 10 (Primary) Sub Sku : 345 Price : $110 Qty : 8 (Level 1) Sub Sku : 456 Price : $90 Qty : 12 (Level 2)
Data of table 1:
Data in table 2:Client Sku Sub_Sku Level 20 123 345 1 20 123 456 2
I created the database based on the Table1 block and Table2.The problem I have isClient Sku Price Qty 20 123 100 10 20 345 110 8 20 456 90 12
How to view price information and amounts Sku1 Sub and Sub Sku2. I intend to use the drop down menu to
levels 1 and 2. When level 1 is selected, it will display all levels 1infor and so on.
Thank you very much in advance
Sandy
Published by: sandy09 on August 13, 2009 12:42What is the difference between the block and block2. I thought that all the information you see comes from table 2?
-
Connect By hierarchical query clause-
Hello
I wrote a query using the Connect By clause to generate the table data structure tree with appropriate levels.
But given could not correct as there may be data that did the trick. As Table1 is parent from table 2 and table 2 is parent from table 3 and table 3 is again Parent from table 1. If these incorrect data then I get error Oracle "ORA-01436: CONNECT loop in the user data" which is correct.
What I need is, whenever this error message is triggered I give my own error instead of this Oracle error message in the SQL statement. Please note that I do not use any PLSQL block, I have just one SQL statement. Appreciate any help on this topic. Thank you.Hello
Outside of PL/SQL, I don't know anyway to substitute your own error messages for those that oracle provides.
In Oracle 10 (and more), you can write a query using the CONNECT_BY_ISCYCLE pseudo-column. Using CONNECTION BY NOCYCLE, the query will never actually throw the error ORA-01436, but you can get it to display your message in the case there, you not used CONNECT BY NOCYCLE.
Here's how:
Equip your actual query, CONNECT_BY_ISCYCLE, the WITH clause.
Get this subquery (CONNECT_BY_ISCYCLE) MAX. We'll call this max_cbi.
Do a UNION ALL of two pins:
(1) selects everything (except, pehaps, CONNECT_BY_ISCYCLE), subquery, WHERE max_cbi = 0
(2) allows you to select your 'error message' double, WHERE max_cbi = 1.Published by: Frank Kulash, November 26, 2008 14:09
-
How to show total for an Object(read only, not based on entity) view based query
Hi Experts,
JDEV version 12.1.3.0
I want to show the total of column salary for reading only VO (not based on the entity, but the query based).
The readonlyVO has some display criteria to display the data. So the total should appear only for values, I see in the user interface.
Thank you
Roy
Looks like JDEV problem which was not allowing me to add the transition attribute. After the reboot of jdev im able to add the transition attribute.
-
Hi all;
I did not finish the rewrite of the query (M.view) clause, trying to activate I get the error message
and I asked this question "https://forums.oracle.com/forums/thread.jspa?threadID=2543789".
Question incorrectly displayed data communication model. -If this isn't a duplicate thread.
Please answer me what was missing here?
SQL > alter system set query_rewrite_enabled = 'TRUE' scope = SPFILE;
SQL > grant query rewrite in *;
Grant succeeded.conn xxx/xxxx@xxxxxx
1 SQL > ALTER SESSION SET OPTIMIZER_MODE = FIRST_ROWS.
Altered session.2 SQL > alter session set query_rewrite_enabled = true;
Altered session.3 SQL > execute dbms_stats.gather_table_stats ('rose', 'mv1');
PL/SQL procedure successfully completed.4 SQL > exec dbms_mview.explain_rewrite ("select * sales ', but 'MV1'");
thanks in advance...
BEGIN dbms_mview.explain_rewrite ("select from sales, 'MV1'"); END; *
* ERROR at line 1:
ORA-30380: REWRITE_TABLE does not exist
ORA-06512: at "SYS." DBMS_SNAPSHOT", line 3085
ORA-06512: at "SYS." DBMS_SNAPSHOT", line 3206
ORA-06512: at line 1Hello
Run utlxrw.sql to create the table.
concerning
-
[10g] need help with order by hierarchical query clause
I have the following data samples:
And the following query gives me exactly what I want, in the order I want. However, I wonder if there is a way to get this order without creating the column SEQ, given that I don't need in my resultsCREATE TABLE bill_test1 ( parent_part CHAR(25) , child_part CHAR(25) , line_nbr NUMBER(5) , qty_per NUMBER(9,5) ); INSERT INTO bill_test1 VALUES ('ABC-1','ABC-10',100,1); INSERT INTO bill_test1 VALUES ('ABC-1','ABC-20',200,2); INSERT INTO bill_test1 VALUES ('ABC-1','ABC-30',300,3); INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-1',401,10); INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-2',402,5); INSERT INTO bill_test1 VALUES ('ABC-10','ABC-155',100,2); INSERT INTO bill_test1 VALUES ('ABC-10','HARDWARE-1',200,1); INSERT INTO bill_test1 VALUES ('ABC-155','RAW-2',100,4.8); INSERT INTO bill_test1 VALUES ('ABC-155','HARDWARE-3',200,3); INSERT INTO bill_test1 VALUES ('ABC-20','RAW-1',100,10.2); INSERT INTO bill_test1 VALUES ('ABC-30','RAW-3',100,3);
SELECT part_nbr , parent_part , child_part FROM ( SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr , b.parent_part , b.child_part , SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq FROM bill_test1 b , dual CONNECT BY parent_part = PRIOR child_part ) WHERE part_nbr = 'ABC-1' ORDER BY seq ; Results of above query, except with SEQ included in SELECT (just to show what I'm sorting off of): PART_NBR PARENT_PART CHILD_PART SEQ ---------------------------- ---------------------------- ---------------------------- ----------------- ABC-1 ABC-1 ABC-10 100 ABC-1 ABC-10 ABC-155 100 100 ABC-1 ABC-155 RAW-2 100 100 100 ABC-1 ABC-155 HARDWARE-3 100 100 200 ABC-1 ABC-10 HARDWARE-1 100 200 ABC-1 ABC-1 ABC-20 200 ABC-1 ABC-20 RAW-1 200 100 ABC-1 ABC-1 ABC-30 300 ABC-1 ABC-30 RAW-3 300 100 ABC-1 ABC-1 HARDWARE-1 401 ABC-1 ABC-1 HARDWARE-2 402
Hello
As long as there is that a single root, brothers and SŒURS of ORDER BY, you say, but you can not do in a subquery (well, you can, but usually there is no interest in a subquery). If the CONNECT BY in a subquery, there is no guarantee that the main request will preserve the hierarchical order which provides the subquery.
The query you posted does not require a query of Tahina, so you can say:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr , b.parent_part , b.child_part --, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq FROM bill_test1 b WHERE CONNECT_BY_ROOT b.parent_part = 'ABC-1' CONNECT BY parent_part = PRIOR child_part ORDER SIBLINGS BY b.line_nbr ;
I said the query you posted does not require a subquery. It also does not require double, so I guess that what you posted is a simplification of what you are really doing, and that could have a subquery. In particular, if you want to GROUP BY part_nbr, you need the subquery. We can use CONNECT_BY_ROOT expression in the WHERE clause (or, come to think of it, use a START WITH clause instead WHERE), but, for some reason, we cannot use CONNECT_BY_ROOT in a clause GROUP BY; We need to calculate CONNECT_BY_ROOT in a subquery, give it a name (like part_nbr) and Super GROUP OF this column in a query.
This requires that there is that one node root. ORDER OF brothers and SŒURS means just that: children of a common parent will appear in the order, but the root nodes, which have no parents, may not be in order.
Here's what I meant by using START WITH place WHERE:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr , b.parent_part , b.child_part --, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq FROM bill_test1 b START WITH b.parent_part = 'ABC-1' CONNECT BY parent_part = PRIOR child_part ORDER SIBLINGS BY b.line_nbr ;
This should be much more effective, because it reduces the results before waste you your time by getting their descendants.
With the help of a clause START WITH here is analogous to me sending you an email, saying "come to a meeting one my office at 03:00."
By using a WHERE clause here is similar by sending me an e-mail to all members of society, saying: "come to a meeting one my office at 3:00" and then, as people get here, tell everyone except you could go back.Brothers and SŒURS ORDER BY was introduced in Oracle 9.
Published by: Frank Kulash, December 9, 2010 14:39
Added version with the START WITH clause
Maybe you are looking for
-
I upgraded to 12.4.3.1 and now I have no playlists. They were hidden somewhere? And if so, where?
-
Satellite C600 does not start correctly
I seem to have committed the cardinal sin of being too eager on the initial commissioning. I had 4g RAM installed at purchase (yesterday).At startup, I selected Windows 64-bit and sat down to wait for the entire boot process to happen. I got the mess
-
LaserJet P1102: Stuck on new device is now connected
Thank you for takeing your time to read this. I have a problem installing my new LaserJet P1102, the instalation of driver's stuck to new device is connected now... As far as I can see it is a known problem, but cannot find a way to fix it. The prin
-
additional features in windows 8.1 Upgrade
not able to improve the additional features of windows 8.1 im... I tried to get the product key from the bios, but the specifications say its no good try another... Help, please.! thnx in advance
-
I have no idea why I get this Blue screens me and says "driver power state failure" and trigger a dump of memory