Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A side-thread off "death knell for Informix" discussing the complaint that DB2 rejects a bare "SELECT 1+2" with SQL0104N, which newcomers from MySQL cite as a flaw. Posters clarify this isn't a bug: standard SQL requires a FROM clause, so you write "select 1+2 from sysibm.sysdummy1" (confirmed working by two posters), or use the standardized VALUES statement, which MySQL lacks. The rest is banter about what people try first on a new DBMS, with one poster noting he mainly looks for the system catalog tables. No technical problem beyond this remained open.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Um....
==> db2 "select 1+2 from sysibm.sysdummy1"
1
-----------
3
1 record(s) selected.
Knut Stolze <stolze@de.ibm.com> wrote in
news:59b4puF2jds9eU1@mid.individual.net:
> Jan M. Nelken wrote:
>
>> Serge Rielau wrote:
>>
>> ...
>>> I sure would love to see mySQL users stop nagging: DB2 is bad
>>> because "SELECT 1+2" returns an syntax error ... ;-)
>> ...
>>
>> Hmmmm, I seem to be confused again:
>>
>> C:\\>db2 connect to sample
>>
>> Database Connection Information
>>
>> Database server = DB2/NT 9.1.3
>> SQL authorization ID = DB2ADMIN
>> Local database alias = SAMPLE
>>
>> C:\\>db2 select 1+2 from sysibm.sysdummy1
>>
>> 1
>> -----------
>> 3
>>
>> 1 record(s) selected.
>
> $ db2 "select 1+2">
> SQL0104N An unexpected token "END-OF-STATEMENT" was found following
> "select 1+2". Expected tokens may include: "<table_expr>".
> SQLSTATE=42601
>
> MySQL accepts this crap because they don't have the standardized
> VALUES statement.
>
mairhtin o'feannag wrote:
> Um....
>
> ==> db2 "select 1+2 from sysibm.sysdummy1"
>
> 1
> -----------
> 3
>
> 1 record(s) selected.
Mairhtin,
You'd be surprised how many mySQL folks never get that far before giving
up. Severe ADD if you ask me...
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Why would you want to do this in the first place?
-t-
Serge Rielau wrote:
> mairhtin o'feannag wrote:
>> Um....
>>
>> ==> db2 "select 1+2 from sysibm.sysdummy1"
>>
>> 1 -----------
>> 3
>>
>> 1 record(s) selected.
> Mairhtin,
>
> You'd be surprised how many mySQL folks never get that far before giving
> up. Severe ADD if you ask me...
>
> Cheers
> Serge
>
Tool wrote:
> Why would you want to do this in the first place?
You're right. Most people would do SELECT 3.
What is the first SQL try when you start playing with a new DBMS?
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
I hate SQL so as a general rule I try to avoid it. To answer your question, I typically want to know where the system tables are since most vendors don't provide decent schema or system information at the command line. So I want to know where the system information is stored to provide more relevant information that would help me as a DBA. So, system information SQL is what I really focus on, to build meaningful reports and a better understanding of the system. If I'm building applications I focus on simple SQL that a child can understand. :-)
Serge Rielau wrote:
> Tool wrote:
>> Why would you want to do this in the first place?
> You're right. Most people would do SELECT 3.
> What is the first SQL try when you start playing with a new DBMS?
>
> Cheers
> Serge
Tool wrote:
> I hate SQL so as a general rule I try to avoid it.
?!
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.