Dual table in 10g
Hi!
1 am using forms 6.
my forms were running good but after i take my application to 10g, some forms have not been compiling.
in every form where dual table has been referenced error has come, remaining forms run well
like
select sysdate
into l_Date
from dual
if in form i use sys.dual then it works
in sql plus i can select using select * from dual
is this a bug or any other problem?
thanx
error has comeGive us a clue. What error? Please post error number and message or at least describe the behaviour.
Also, this is primarily a database forum. As your queries run in SQL*Plus it strikes me this is most likely to be a problem with Forms, and so you may be better off trying the OTN > Products > Developer Suite > Forms forum. Unlike this forum, actual Oracle employees answer questions there, so it's definitely a better bet.
Are you using Forms 6 or 6i? Forms 6 is de-supported and so may not play nicely with 10g. 6i is supported and either is or will be certified to run against 10g.
Cheers, APC
Similar Messages
-
Can anybody tell me, What is FAST DUAL in Oracle 10g, How it is different from Oracle 9i DUAL ? with as conceptual example.
He-he, see what you mean, never thought of that. Maybe because my current problems are in a different ball park.
Getting slightly off-topic, this is the preferred way of using dual when getting next value from a sequence.
And I kid you not, if not done exactly like that I won't pass a QA review. (This is just an example, a true implementation would include something like 40-50 lines of headers and comments)
WARNING when reading this. DON'T ever do the following
PROCEDURE fetch_next_empno(inout_contentrec IN OUT add_emp_rec_type)
IS
k_module CONSTANT VARCHAR2(30) := 'FETCH_NEXT_EMPNO'
CURSOR c_next_empno
IS
SELECT empno_seq.NEXTVAL
FROM dual;
v_empno emp.empno%type;
BEGIN
logger.prc_start(k_module);
OPEN c_next_empno;
FETCH c_next_empno
INTO v_empno;
IF c_next_empno%NOTFOUND
THEN
raise_application_error(-20000, 'No entries in Dual table');
END IF;
CLOSE c_next_empno;
inout_contentrec.empno := v_empno;
logger.prc_end(k_module);
EXCEPTION
WHEN OTHERS THEN
IF c_next_empno%ISOPEN
THEN
CLOSE c_next_empno
END IF;
logger.error(k_module, SQLERRM);
RAISE;
END;P.S: This application was started in '95 - Version 7 or something, I guess.
An upgrade from 10gR2 to 11g is currently planned. So far no coding style has been changed.
Why not? - Conformity rules!
Regards
Peter
Edited by: Peter on Jan 23, 2011 6:15 AM
P.S -
Hi,
1. Do dual table take any physical space in the database or it is only logically present?
2. Suppose a table contains 100 rows. Write a query to return 42,43,44 rows.
Thanks,
Mrinmoyuser3001930 wrote:
Hi,
1. Do dual table take any physical space in the database or it is only logically present?Dual table is physically stored. But starting from 10g (I guess) they indroduced the FAST DUAL access path. Which means if you use the DUAL table not to get the value from the table and only to select a constant value then it will not hit the actually table.
2. Suppose a table contains 100 rows. Write a query to return 42,43,44 rows.You can use the analytic function ROW_NUMBER for this purpose. -
How to create SYS.DUAL table by own?
Hi People,
I removed DUAL table from SYS user by mistake.Is it possible to recreate it again similar to that?.how to restore it?.pls help me with suggestions.I use Oracle 10g
With Regards
Vidya.N
Edited by: vidusnat on Sep 6, 2010 1:56 AMvidusnat wrote:
Ya right.but that seems to be a normal table isn't it?.how to avoid insertion in it?.we cant create triggers on sys objects too.what else we can do?.You do not manually interfere with this table at all - via triggers or other hacks to make it a single-row-table You only need to do 4 things:
- start the db in upgrade mode
- create the dual table
- insert the single row
- create a public synonym
Nothing else. Read the Oracle Support notes - they are your best reference. -
How to return number range from sql (dual table)
in sql plus
I need to display values (numbers)1 to 52 from dual
eg,
1
2
3
4
5
etc...
Is this possible, can you display a range of numbers from an sql statment without creating atble holding the required numbers.
I am trying to display 1 to 52 (week numbers) but I need to do this from the dual table.
Creating a table with values 1 to 52 looks like a waste?
Thanks in anticipation.
SD.If you're running on 9i you may find the solution I posted Re: List all days of a month in single SQL to be useful. Otherwise the general discussion will provide some illumination.
Cheers, APC -
Hi,
below is one query
SQL> select * from dual;
D
XNow from the below Query I came to know that there is one field in the dual table DUMMY which is having VARCHAR2(1)
SQL> desc dual;
Name Null? Type
DUMMY VARCHAR2(1)now my doubt is when I run the below query how it is displaying text more than 1 character
SQL> select 'how are you' from dual;
'HOWAREYOU'
how are youplease explain
thanks in advance.Hi,
What you are SELECTing here nas no relation to any column in the table.
There's nothing special about the dual table regarding literals. Try
SELECT 'Hello'
FROM scott.dept;Notice that scott.dept does not have any 5-character columns, yet a query on scott.dept is producing a 5-character column.
When you query a table, you don't have to SELECT all of the columns in the table. In fact, you don't have to SELECT any of the columns in the table, as you demonstrated.
The query you posted, like the query above, does not refer to any columns in its base table; it's not surprising that the output doesn't resemble any column in the base table. In the case of the query above, which is based on a table that has 3 columns, the one column that we are SELECTing can't have the characteristics of all 3 columns in the table. Which column do you think the output should resemble, and why? 'Hello' is the first column of output; does that mean it has to resemble the first column in the table, which happens to be defined as NUMBER (2)? 'Hello' is also the last column of output; does that mean it has to resemble the last column of the table? 'Hello' is directly in the center of the output; does that mean it has to resemble the column that happens to be in the middle of the table? Of course not!
Once agian, it is perfectly legal, and sometimes extremely useful, to have columns in a result set that have no connection at all to any column in the table. -
How to use temporary interface in another interface as derived table in 10g
Hi ,
Can somebody please tell me how to use temporary interface in another interface as derived table in 10g.
I have an option in odi 11g to this task.But i am working on odi 10g for my project.So that please help me to do this task.
I can able to create temporary interface in 10g ,but i dont know how to use that temporary interface in another inerface as derived table.
Thanks in Advance
Thanks,
Srikanth AA temp interface CANNOT be used as a derived table in ODI 10g.
All you can do is to drag and drop the temp interface as the source in the mapping.
PS. Please remember to assign correct/helpful points to the people who help you in the forum. -
Select multiple rows from dual table
Is it possible to select multiple rows from dual table using a single select statement.
i.e., i want the out put to be
column_name
1
2
3
4
Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AMAside from the fact you're responding to an old thread...
1002424 wrote:
While using CONNECT BY, I see it always leave behind one row.
Suppose I have a condition based on which I have to generate constant rows like
SELECT 1 FROM DUAL WHERE ROWNUM < N;
Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
no rows selected
SQL> -
As a quick way to grant privileges to almost all the objects in my schema to a role, i created a procedure (Courtesy of user CD from Oracle Forums). But when i executed the below mentioned procedure i got the error :
ORA-01720: grant option does not exist for 'SYS.DUAL'
To avoid granting privileges to sys.dual, I tried adding AND OBJECT_NAME < > 'SYS.DUAL' and AND OBJECT_NAME < > 'DUAL' to the query. But that this didn't help.
But when i query SELECT * FROM DUAL; i can see that DUAL table exists in my schema.
Any thoughts?
Here is what i did
CREATE ROLE newrole;
DECLARE
v_sql VARCHAR2(4000);
BEGIN
FOR obj IN (SELECT object_name
, object_type
, DECODE (OBJECT_TYPE,
'PROCEDURE','EXECUTE',
'FUNCTION' ,'EXECUTE',
'PACKAGE' ,'EXECUTE',
'SYNONYM' ,'SELECT' ,
'SEQUENCE' ,'SELECT' ,
'MATERIALIZED VIEW','SELECT',
'SELECT, INSERT, UPDATE, DELETE') rights
FROM user_objects where object_type IN
('FUNCTION','PROCEDURE','PACKAGE','SYNONYM','SEQUENCE','MATERIALIZED VIEW','TABLE','VIEW'))
LOOP
v_sql := 'GRANT ' || obj.rights || ' ON ' || obj.object_name || ' TO NEWROLE';
dbms_output.put_line(v_sql);
EXECUTE IMMEDIATE v_sql;
END LOOP;
END;
/One of your views must reference DUAL, perhaps indirectly.
If this comes up again you can create an exception to catch the error inside the loop for the current item and continue. Not pretty, but it should work something like (untested)
for record in cursor loop
--block to catch exception
declare
my_error exception;
--substitute proper error number for -000001 below
pragma exception_init(-000001,my_error)
begin
exception
when my_error then
null;
end;
--continue processing with next loop item
end loop; -
How to generate multiple records on a single sql from dual table
I wanted to generate ten sequence nos in a single sql statement from dual table.
Is there any way to use that.
I think somebody can help me on this by using level clauseI'm not 100% sure if I understand your requirement: Do you really want to use an Oracle Sequence, as Alex already demonstrated?
Or just a 'one-time-bunch-of-sequential-numbers'.
In the latter case you can just select level:
SQL> select level
2 from dual
3 connect by level <= 10;
LEVEL
1
2
3
4
5
6
7
8
9
10
10 rows selected. -
Use of addImageTheme method with dual table in query
Is it possible to specify a query using the dual table that specifies a BLOB type? I'm trying to specify a image theme dynamically using the bean API. My image is a JPEG.
Hi Jen,
if you create a table with a BLOB to store the image, plus a geometry column with the image MBR, then you can easily build the dynamic image theme using the API. Your SQL on the image theme would be something like: select mbr, image from image_table.
I'm not sure if there is a direct function at the SQL level that takes an image file and generates a BLOB. Maybe someone has done something similar. If this function exists, then you may be able to create an image theme issuing a SQL with dual table.
Joao -
Hello gurus
This dual table is a dummy table with varchar2(1)....my question is how it can select many psedocolumns from dual doesn't it exceed the allowed space of varchar2(1)
Edited by: 964145 on Oct 9, 2012 5:35 PM>
it cannot be a real table
>
Not sure why you say that.
The DDL for it is in the dcore.bsq file (11.2) in the rdbms/admin folder
create table dual /* pl/sql's standard pckg requires dual. */
(dummy varchar2(1)) /* note, the optimizer knows sys.dual is single row */
storage (initial 1)
insert into dual values ('X')
/See the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/queries009.htm#SQLRF20036
>
Selecting from the DUAL Table
DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once. Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table. Refer to "About SQL Functions" for many examples of selecting a constant value from DUAL.
>
And the Database Concepts doc
http://docs.oracle.com/cd/B28359_01/server.111/b28318/datadict.htm
>
The DUAL Table
The table named DUAL is a small table in the data dictionary that Oracle Database and user-written programs can reference to guarantee a known result. This table has one column called DUMMY and one row containing the value X.
>
And those pseudo-columns you ask about
>
select sysdate,UID,rowid from dual;
>
You can query those from any table but as the doc quote above says you will get as many values as there are rows in the table. -
Question on dual table..
after i insert another row into dual table,
SQL*PLUS still returns only one row. But PL/SQL Developer returns 2 rows.
What does SQL*PLUS do to return only one row no matter many rows exist in DUAL table?http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1562813956388
-
Avoid Hard Parsing for executing dynamic SQL using DUAL table Oracle
I want to know if dynamic sql statements involving DUAL table can be modified to remove HARD PARSING.
We have several SQL statements are stored in configuration table, here is sample example
-- query 1 before replacing index values as stored in config table ---
select count(*) from dual where 'REPLACE_VALUE_OF_INDEX_3' IN ('K')
AND (('REPLACE_VALUE_OF_INDEX_13' IN ('1053','1095','1199') ) OR ('REPLACE_VALUE_OF_INDEX_13' IN ('1200') ))
AND 'REPLACE_VALUE_OF_INDEX_2' IN ('6')
AND 'REPLACE_VALUE_OF_INDEX_15' IN ('870001305')
-- query 1 after replacing index values--
select count(*) from dual where 'REPLACE_VALUE_OF_INDEX_10' IN ('K')
AND (('1030' IN ('1053','1095','1199') ) OR ('1030' IN ('1200') ))
AND '2' IN ('6')
AND 'X' IN ('870001305')
-- query 2 before replacing index values as stored in config table --
select count(*) from dual where 'REPLACE_VALUE_OF_INDEX_5' IN ('361A','362A')
AND 'REPLACE_VALUE_OF_INDEX_22' BETWEEN '200707' AND '200806'
-- query 2 after replacing index values--
select count(*) from dual where '3MAA' IN ('361A','362A') AND '201304' BETWEEN '200707' AND '200806'If I got it right you have some (maybe lots of) conditions stored in a table (be patient - it's my interpretation)
create table eb_conditions as
select 1 rid,q'{:5 IN ('361A','362A') AND :3 BETWEEN '200707' AND '200806'}' cndtn from dual union all
select 2,q'{:2 IN ('361A','362A') AND :3 BETWEEN '200707' AND '200806'}' from dual union all
select 3,q'{:1 IN ('K') AND ((:2 IN ('1053','1095','1199') ) OR (:4 IN ('1200') )) AND :3 IN ('6') AND :5 IN ('870001305')}' from dual
RID
CNDTN
1
:5 IN ('361A','362A') AND :3 BETWEEN '200707' AND '200806'
2
:2 IN ('361A','362A') AND :3 BETWEEN '200707' AND '200806'
3
:1 IN ('K') AND ((:2 IN ('1053','1095','1199') ) OR (:4 IN ('1200') )) AND :3 IN ('6') AND :5 IN ('870001305')
and you have to check the conditions using values stored in an array
I used a table instead: the vl at rid = 1 representing the value of bind variable :1 in eb_conditions table and so on ...
create table eb_array as
select 1 rid,'K' vl from dual union all
select 2,'1199' from dual union all
select 3,'200803' from dual union all
select 4,'1000' from dual union all
select 5,'870001305' from dual
RID
VL
1
K
2
1199
3
200803
4
1000
5
870001305
You want to check the conditions using select count(*) from dual where <condition with binds substituted fron the array>
Judging from the title Hard Parsing represents the major problem and you cannot avoid it since every condition to be verified is different from every other condition.
I think your best bet is not to evaluate conditions row by row - context shift cannot be avoided and there might be more than one for each iteration.
So try to do it in a single step:
declare
w_cndtn varchar2(4000);
w_clob clob;
w_cursor sys_refcursor;
one number;
two number;
begin
dbms_lob.createtemporary(w_clob,false);
for rw in (select rid,
max(cndtn) cndtn,
listagg(val,',') within group (order by rn)||',' usng
from (select c.rid,c.cndtn,c.rn,c.bind,
replace(rtrim(c.bind),':'||to_char(v.rid),''''||v.vl||'''') val
from (select rid,
cndtn,
regexp_substr(cndtn,':\d+ ',1,level) bind,
level rn
from eb_conditions
connect by level <= regexp_count(cndtn,':')
and prior rid = rid
and prior sys_guid() is not null
) c,
eb_array v
where instr(c.bind,':'||v.rid||' ') > 0
group by rid
loop
w_cndtn := rw.cndtn;
while instr(w_cndtn,':') > 0
loop
w_cndtn := replace(w_cndtn,trim(regexp_substr(w_cndtn,':\d+ ',1,1)),substr(rw.usng,1,instr(rw.usng,',') - 1));
rw.usng := substr(rw.usng,instr(rw.usng,',') + 1);
end loop;
w_cndtn := 'select '||to_char(rw.rid)||' cndtn_id,count(*) from dual where '||w_cndtn||' union all ';
w_clob := w_clob ||' '||w_cndtn;
end loop;
w_clob := substr(w_clob,1,instr(w_clob,'union all',-1,1) - 1);
open w_cursor for w_clob;
loop
fetch w_cursor into one,two;
exit when w_cursor%notfound;
dbms_output.put_line(to_char(one)||':'||to_char(two));
end loop;
dbms_lob.freetemporary(w_clob);
end;
1:0
2:0
3:0
Statement processed.
Regards
Etbin -
How to use dual table in ODI in source side for nested queries?
Hi,
Any idea how to use dual table in source for more than once. I want to build a ODI interface for the following source query
SELECT ACTV_TYP.ACTV_TYP_SRC_CD, ACTV_TYP.ACTV_TYP, PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
FROM
SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BRKR_PORTS'
AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
(SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BANKS'
AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS,
(SELECT 1 ACTV_TYP_SRC_CD, '?????' ACTV_TYP FROM DUAL
UNION ALL
SELECT 2 ACTV_TYP_SRC_CD, '???????' ACTV_TYP FROM DUAL) ACTV_TYP
RegardsIf the below query is equivalent , it seems you don't need dual table at all , just default the values in the interface.
You are using dual tables to populate values ACTV_TYP.ACTV_TYP_SRC_CD, ACTV_TYP.ACTV_TYP values. Look at your query in the following manner :
SELECT '1', '?????', PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
FROM
SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BRKR_PORTS'
AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
(SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BANKS'
AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS
UNION
SELECT 2 , '??????', PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
FROM
SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BRKR_PORTS'
AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
(SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
WHERE TABLE_NAME = 'BANKS'
AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS
Now you can use dataset to make UNION.
Maybe you are looking for
-
How to configure multiple IP-Adresses on one NIC in OVM
Hi guys, we have some OVM Servers 2.2.1 installed. They all have three NICs in them (eth0-2). For eth0 and eth2 we need multiple IP-Adresses configured to work with our storage solution. The configuration should look like this: eth0:0 - 192.168.31.x
-
Hi I want to buy an unlocked iPhone 5 in the Middle East. I want to know if I will be able to use my iPhone and all its applications when we go back to live in the US for long term. Thank you
-
I am designing a business card in Indesign and want to copy my logo from AI. The versions I am using is CS3, The logo is in vector format saved under AI. When I copy it, it doesn't copy right. I am a first time user, so all basic instructions are app
-
How to call a function module dynamically?
Hi I am doing a smartform development and here my scenario. <b>Scenario:</b> There will be a simple report which will trigger a smartform output. The report has a selection screen and and in one of the field the user will enter the layout name or the
-
Business XI 3.0 to 3.1 upgrade : License
Hi Team, We are using Business Objects XI 3.0 with enterprise license and would like to upgrade to BO XI 3.1 by uninstalling 3.0 and installing 3.1 from scratch. Can we use the 3.0 Enterprise license key code for 3.1 as well? Thanks in advance.