Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Any Dummy Table In Informix?

7,379 views
Skip to first unread message

James

unread,
Nov 1, 2002, 2:05:29 AM11/1/02
to
Hi,

I would like to use the SQL function for some manipulation but every
SQL needs a table. Therefore a dummy table with 1 row of record is
needed. For example, if I would to get the system date through SQL -
select today from <dummy table>

We can surely create the dummy table but I'm just wondering whether
Informix does have a special table for this purpose. In Oracle, there
is a table called dual for this purpose.

Any ideas?

Thanks in advance.

Obnoxio The Clown

unread,
Nov 1, 2002, 3:02:39 AM11/1/02
to

Generally I use (and I think most people do)

"SELECT TODAY FROM systables WHERE tabid = 1;"

Tsutomu Ogiwara

unread,
Nov 1, 2002, 3:23:03 AM11/1/02
to

Hi James.

AFAIK, Informix does not have dummy table like dual.
So you use the following SQL.

select xxx from systables where tabid=1;

Regards.

--
Tsutomu Ogiwara from Tokyo Japan.
ICQ#:168106592

>From: ehc...@hotmail.com (James)
>Reply-To: ehc...@hotmail.com (James)
>To: inform...@iiug.org
>Subject: Any Dummy Table In Informix?
>Date: 31 Oct 2002 23:05:29 -0800
>
>Hi,
>
>I would like to use the SQL function for some manipulation but every
>SQL needs a table. Therefore a dummy table with 1 row of record is
>needed. For example, if I would to get the system date through SQL -
>select today from <dummy table>
>
>We can surely create the dummy table but I'm just wondering whether
>Informix does have a special table for this purpose. In Oracle, there
>is a table called dual for this purpose.
>

>Any ideas?
>
>Thanks in advance.


_________________________________________________________________
Get faster connections -- switch to MSN Internet Access!
http://resourcecenter.msn.com/access/plans/default.asp

Colin Bull

unread,
Nov 1, 2002, 3:46:50 AM11/1/02
to

James asked -

> Hi,
>
> I would like to use the SQL function for some manipulation but every
> SQL needs a table. Therefore a dummy table with 1 row of record is
> needed. For example, if I would to get the system date through SQL -
> select today from <dummy table>
>
> We can surely create the dummy table but I'm just wondering whether
> Informix does have a special table for this purpose. In Oracle, there
> is a table called dual for this purpose.
>
> Any ideas?
>
> Thanks in advance.
>

It is normally done with a system table, how about systables ?

Colin Bull
c.b...@VideoNetworks.com

Malcolm Weallans

unread,
Nov 1, 2002, 6:26:05 AM11/1/02
to

I guess we could even produce a view and call it dual

CREATE VEW dual AS SELECT * FROM systables WHERE tabid=1

Then we could do SELECT TODAY FROM dual

Malcolm

-----Original Message-----
From: Obnoxio The Clown [mailto:obn...@hotmail.com]
Sent: 01 November 2002 08:03
To: inform...@iiug.org
Subject: Re: Any Dummy Table In Informix?


James wrote:
> Hi,
>
> I would like to use the SQL function for some manipulation but every
> SQL needs a table. Therefore a dummy table with 1 row of record is
> needed. For example, if I would to get the system date through SQL -
> select today from <dummy table>
>
> We can surely create the dummy table but I'm just wondering whether
> Informix does have a special table for this purpose. In Oracle, there
> is a table called dual for this purpose.

Generally I use (and I think most people do)

"SELECT TODAY FROM systables WHERE tabid = 1;"

DISCLAIMER
This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version.

Pavel Hruska

unread,
Nov 1, 2002, 7:40:08 AM11/1/02
to
Hi

I use objected-relational properties of IDS


SELECT TODAY FROM TABLE(SET{1})

Pavel

"James" <ehc...@hotmail.com> píse v diskusním príspevku
news:46fb4b22.02103...@posting.google.com...

Jonathan Leffler

unread,
Nov 2, 2002, 2:18:34 AM11/2/02
to
Pavel Hruska wrote:
> I use objected-relational properties of IDS
>
> SELECT TODAY FROM TABLE(SET{1})

I use a real table:

CREATE TABLE dual (value INTEGER NOT NULL CHECK (value = 0) UNIQUE);
INSERT INTO dual VALUES(0);
REVOKE ALL ON dual FROM PUBLIC;
GRANT SELECT ON dual TO PUBLIC;

> "James" <ehc...@hotmail.com> wrote:
>>I would like to use the SQL function for some manipulation but every
>>SQL needs a table. Therefore a dummy table with 1 row of record is
>>needed. For example, if I would to get the system date through SQL -
>>select today from <dummy table>
>>
>>We can surely create the dummy table but I'm just wondering whether
>>Informix does have a special table for this purpose. In Oracle, there
>>is a table called dual for this purpose.

--
Jonathan Leffler #include <disclaimer.h>
Email: jlef...@earthlink.net, jlef...@us.ibm.com
Guardian of DBD::Informix 1.00.PC2 -- http://dbi.perl.org/

sergio...@gmail.com

unread,
Jun 28, 2016, 6:54:50 PM6/28/16
to
Starting IDS 11.70 there is a new sysdual table in sysmaster database
you can query sysdual as oracle's dual table.

select * from sysmaster:sysdual

it will return

X

I hope this helps you
0 new messages