dbTalk Databases Forums  

Connectby function, to use or not to use, this is the question now.

comp.databases.postgresql comp.databases.postgresql


Discuss Connectby function, to use or not to use, this is the question now. in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Connectby function, to use or not to use, this is the questionnow. - 05-21-2010 , 08:15 AM






On Fri, 21 May 2010 10:43:02 +0200, Lennart Jonsson wrote:


Quote:
Not only in Oracle. It was a reserved word in sql92 and in sql99. What's
peculiar is that it does not appear to be a reserved word in sql2003.
My query ran with the "level" column, with no problems, pgsql 8.4.3.



--
http://mgogala.byethost5.com

Reply With Quote
  #12  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: Connectby function, to use or not to use, this is the questionnow. - 05-21-2010 , 10:58 AM






On 2010-05-21 14:15, Mladen Gogala wrote:
Quote:
On Fri, 21 May 2010 10:43:02 +0200, Lennart Jonsson wrote:


Not only in Oracle. It was a reserved word in sql92 and in sql99. What's
peculiar is that it does not appear to be a reserved word in sql2003.

My query ran with the "level" column, with no problems, pgsql 8.4.3.

A dbms may or may not accept reserved words, but in general it is a bad
idea to (ab)use them. Even though DB2 V9.5 gladly accepts:

db2 "create table from ( where char(5) not null primary key )"
db2 "insert into from (where) values ('where')"
db2 "select where from from where where = 'where'"

WHERE
-----
where

I would not use those names.


/Lennart

Reply With Quote
  #13  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Connectby function, to use or not to use, this is the questionnow. - 05-21-2010 , 05:02 PM



On Fri, 21 May 2010 16:58:23 +0200, Lennart Jonsson wrote:


Quote:
I would not use those names.

That's a reasonable suggestion. I used "LEVEL" to emulate Oracle's
"CONNECT BY" behavior which produces the level column. Well, it'll have
be "LEV", from now on.



--
http://mgogala.byethost5.com

Reply With Quote
  #14  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: Connectby function, to use or not to use, this is the questionnow. - 05-22-2010 , 01:16 AM



On 2010-05-21 23:02, Mladen Gogala wrote:
[...]
Quote:
That's a reasonable suggestion. I used "LEVEL" to emulate Oracle's
"CONNECT BY" behavior which produces the level column. Well, it'll have
be "LEV", from now on.

Don't get me wrong. There might be perfectly good reasons to violate a
principle, guideline, rule of thumb, etc. But one should be aware that
it was done and why it was done. In some situations it might not even be
possible to conform to all requirements. By documenting these exceptions
it will be easier to fix them if necessary (in another dbms, a later
version of the same dbms, etc).

/Lennart

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.