Questions tagged [dual-table]

The DUAL table is a special one-row, one-column table. It is present by default in Oracle and other database installations. In Oracle, the table has a single VARCHAR2(1) column, called DUMMY, that has a value of 'X'. It is suitable for use in selecting a pseudo-column, such as SYSDATE or USER.

The DUAL table is a special one-row, one-column . It is present by default in and other database installations. In Oracle, the table has a single VARCHAR2(1) column, called DUMMY, that has a value of X. It is suitable for use in selecting a pseudo-column, such as SYSDATE or USER.

Useful Links:

30 questions
1
vote
2 answers

SQL time and date formatting against dual table

I am trying to only display the date and time of a table in a certain format. This format is DD-MON-YYYY and the time HH24:MI:SS. I don't understand how to make both formats work together. I can get them to function separately. select…
lnjblue
  • 140
  • 1
  • 13
1
vote
1 answer

How to search oracle db timezone in Ruby on Rails

I want to connect to oracle database in my ruby on rails application and i need to get db timezone with sql "select dbtimezone from dual" I have the code class Bug < ActiveRecord::Base establish_connection :bug def self.get_db_timezone …
Morris
  • 71
  • 8
1
vote
1 answer

Selecting condition of a dual column (ORA-00904: Invalid identifier)

I have a list with days and numbers generated by dual table as follow: SELECT TO_CHAR (TO_DATE ('19-02-1984', 'DD-MM-RRRR') + LEVEL, 'DAY') DAY, LEVEL FROM DUAL CONNECT BY LEVEL <= 7 And it's produces this table: DAY | LEVEL…
nitrosama
  • 13
  • 5
1
vote
1 answer

IS or (WHEN IS) DUAL considered an X$ hidden table (file)?

This is in reference to Mark J. Bobak's last comment to his answer on: The magic of DUAL post Those are all standard columns in any X$ table. ADDR is the address, literally, the memory address where that particular row is mapped in the SGA. I…
0
votes
1 answer

Use of 'dual' table using jdbc

I want to test the connection so I am using the query: 'SELECT 1 FROM dual' to compare the value returned. ResultSet rs = stmt.executeQuery("SELECT 1 FROM dual"); on doing rs.next() the exception thrown is: java.sql.SQLException: Closed…
Ashish Anand
  • 3,531
  • 6
  • 34
  • 45
0
votes
1 answer

Is there a way to emulate a table in the Azure Resource Explorer reduced version of Kusto?

Question In Kusto, is there a way to select constant values without having a source table; e.g. in a similar way to how we could use the DUAL table in Oracle (or do a SELECT without a FROM in many other query languages)? E.g. () | project colA =…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
0
votes
1 answer

Multiple columns from DUAL?

I'm using Oracle 12c. I need to generate dates for the start and end of weeks which begin on Thursday and end the following Wednesday. An example of the output I'd like is - I have the following SQL to generate the Start Date(s) - SELECT startdate …
steve
  • 137
  • 1
  • 2
  • 10
0
votes
2 answers

Main select query together with subquery having "select * dual"

I have the following query that having a sub-query to select from dual. Both result of main and subquery need to be display in the output. SELECT a.ROW_EXISTS AS CLIENT_EXIST, c.AP_Before AS AP_before, c.AP_TIMESTAMP AS AP_TIMESTAMP, cd.AAM_FLAG AS…
user2102665
  • 429
  • 2
  • 11
  • 26
0
votes
1 answer

Slow performance for dual table and views after upgrading from 10g to 19c

After upgrading the Oracle database from 10g to 19c, I'm experienced the performance issue as querying in dual table and views on a large database when using update/ insert statement. I've to wait for more than a hour when comparing the performance…
0
votes
1 answer

how to use oracle sequence in hibernate?

i am trying to access the below sql to generate the next sequence number. i am getting QuerySyntaxException caused by dual is not mapped. sql = Select sequence_caseid.NEXTVAL from DUAL public Long generate(Session session) throws…
0
votes
1 answer

Join other table in SQL with dual table

SQL Console select trunc((:FromDate)+1)-rn as date_Val from ( select rownum rn from dual connect by level <= ((:FromDate)-(:todate))+1) order by trunc(:FromDate)-rn I want to join this column with other tables. When I write…
0
votes
1 answer

EXECUTE IMMEDIATE using column names from dual

In my package, I have a procedure like this: PROCEDURE sp_directUpdate(COL C%ROWTYPE) IS BEGIN EXECUTE IMMEDIATE 'INSERT INTO T1(SELECT COL.F0, COL.F1 FROM DUAL)'; END IF; END; for table T1, I need only two columns from dual: COL.F0 & COL.F1.…
Neptune_Runner
  • 61
  • 1
  • 1
  • 6
0
votes
2 answers

SQL How to create a list from Dual inside a WITH

I don't want to create tmp tables. How to make this work? with a as ( 340401182, 340401183 ) select * from a
jim
  • 228
  • 4
  • 10
0
votes
2 answers

Arrange the date query result [oracle 11g]

This is my query to get all possible dates between two dates based on days. select A.presentationID, A.PRESENTATIONDAY, TO_CHAR(A.PRESENTATIONDATESTART+delta,'DD-MM-YYYY','NLS_CALENDAR=GREGORIAN') LIST_DATE from PRESENTATION A,…
Mong2203
  • 71
  • 1
  • 12
-1
votes
3 answers

Create a table from DUAL

How can I create the following table in Oracle. +------+------+ | col1 | col2 | +------+------+ | A | 1 | | B | 2 | +------+------+ I need it as an itermediate table in a WITH-clause.
shmail
  • 31
  • 1
  • 5
1
2