Re: [GENERAL] Oracle buys Innobase

Поиск
Список
Период
Сортировка
Искать

Re: [GENERAL] Oracle buys Innobase

От:
Jeff Davis <jdavis-pgsql@empires.org>
Дата:
SCassidy@overlandstorage.com wrote:
> A "PostgreSQL to Oracle converter" might be a really big project.
> 
> Having ported an application from PostgreSQL (7.3) to Oracle 9i, as I
> recall, my biggest problems were:
> 
> -  Quoting issues:  the original PostgreSQL application quoted
> integer/numeric type, and Oracle will not allow that, so I had to make sure
> only types that had to be quoted, were.  (I normally do not quote numbers
> in PostgreSQL, but I inherited the application).

What does the standard say about that? Which types of values in Oracle 
need to not be quoted?

Regards,
	Jeff Davis

Re: [GENERAL] Oracle buys Innobase

От:
Jan Wieck <JanWieck@Yahoo.com>
Дата:
On 10/21/2005 1:58 AM, Jeff Davis wrote:
> SCassidy@overlandstorage.com wrote:
>> A "PostgreSQL to Oracle converter" might be a really big project.
>> 
>> Having ported an application from PostgreSQL (7.3) to Oracle 9i, as I
>> recall, my biggest problems were:
>> 
>> -  Quoting issues:  the original PostgreSQL application quoted
>> integer/numeric type, and Oracle will not allow that, so I had to make sure
>> only types that had to be quoted, were.  (I normally do not quote numbers
>> in PostgreSQL, but I inherited the application).
> 
> What does the standard say about that? Which types of values in Oracle 
> need to not be quoted?

Section 5.3 of SQL92 defines:

       ::=
             
           | 

       ::=
             
           | 

       ::=
             
           | 
           | 
           | 
           | 
           | 

The Restrictions for Entry level SQL say that

         a) A  shall not be a .

         b) A  shall not be a  or
           .

There are no restrictions that say a  cannot be a 
.  is defined without quotes, but from 
the above I conclude that a  is allowed instead of a 
 to represent a numeric value, which means Oracle is 
wrong IMNSVHO.

No reason to swell your breast though, we aren't perfect in the literal 
area either. Because

       ::=
             
           | 

Re: [GENERAL] Oracle buys Innobase

От:
Jonathan Gennick <jgennick@oreilly.com>
Дата:
I hope it's ok if I jump in here. I am having a difficult time
following Jan's logic:

JW> The Restrictions for Entry level SQL say that

JW>          a) A  shall not be a             literal>.

JW>          b) A  shall not be a  or
JW>            .

JW> There are no restrictions that say a  cannot be a 
JW> .

I just took a look at my copy of SQL:2003, and I do agree that there
is no rule per se stating that "a " cannot be a ". However, I also find nothing to indicate that a  *can* be a . Looking at the definition for
, I see:

 ::=

| 
| 
| 
| 
| 
| 

I see seven possible manifestations of a general literal (, , and so forth). None of these
manifestations has to do with numeric values.

I see numeric literals defined as follows:

 ::= [  ] 

 ::=

| 

And, digging down further, I see no quotes anywhere in the
definitions.

From all that I have seen so far in the standard, if you write a
literal such as, say, '23.5', what you have is a character string. I
see no ambiguity on that point.

Now, Oracle (and possibly other databases) will allow you to use a
character string when a number is called for. For example:

SELECT some_number + '23.5' from some_table;

In such cases, Oracle implicitly converts the character string, but
implicit conversion is potentially a can of worms and I don't think
it's really the issue you are talking about, is it?

Interestingly, DB2 is rather hard-nosed about implicit conversions. I
would have to test again to be certain, but I don't believe DB2 would
implicitly convert '23.5' to a number in the above context.

Pardon me if I've missed the boat somewhere, or misunderstood the
issue, but I don't at the moment see where you can put quotes around
digits and still have a numeric literal. I believe the quotes give you
a character string.
 
Best regards,

Jonathan Gennick
Editor, O'Reilly Media
906.387.1698   mailto:jgennick@oreilly.com

Friday, October 21, 2005, 10:29:43 AM, Jan Wieck (JanWieck@Yahoo.com) wrote:
JW> On 10/21/2005 1:58 AM, Jeff Davis wrote:
>> SCassidy@overlandstorage.com wrote:
>>> A "PostgreSQL to Oracle converter" might be a really big project.
>>> 
>>> Having ported an application from PostgreSQL (7.3) to Oracle 9i, as I
>>> recall, my biggest problems were:
>>> 
>>> -  Quoting issues:  the original PostgreSQL application quoted
>>> integer/numeric type, and Oracle will not allow that, so I had to make sure
>>> only types that had to be quoted, were.  (I normally do not quote numbers
>>> in PostgreSQL, but I inherited the application).
>> 
>> What does the standard say about that? Which types of values in Oracle 
>> need to not be quoted?

JW> Section 5.3 of SQL92 defines:

JW>        ::=
JW>              
JW>            | 

JW>        ::=
JW>              
JW>            | 

JW>        ::=
JW>              
JW>            | 
JW>            | 
JW>            | 
JW>            | 
JW>            | 

JW> The Restrictions for Entry level SQL say that

JW>          a) A  shall not be a             literal>.

JW>          b) A  shall not be a  or
JW>            .

JW> There are no restrictions that say a  cannot be a 
JW> .  is defined without quotes, but from 
JW> the above I conclude that a  is allowed instead of a 
JW>  to represent a numeric value, which means Oracle is 
JW> wrong IMNSVHO.

JW> No reason to swell your breast though, we aren't perfect in the literal 
JW> area either. Because

JW>        ::=
JW>              
JW>            | 

Re: [GENERAL] Oracle buys Innobase

От:
Jeff Davis <jdavis-pgsql@empires.org>
Дата:
Jan Wieck wrote:
> On 10/21/2005 1:58 AM, Jeff Davis wrote:
> 
>> SCassidy@overlandstorage.com wrote:
>>
>>> A "PostgreSQL to Oracle converter" might be a really big project.
>>>
>>> Having ported an application from PostgreSQL (7.3) to Oracle 9i, as I
>>> recall, my biggest problems were:
>>>
>>> -  Quoting issues:  the original PostgreSQL application quoted
>>> integer/numeric type, and Oracle will not allow that, so I had to 
>>> make sure
>>> only types that had to be quoted, were.  (I normally do not quote 
>>> numbers
>>> in PostgreSQL, but I inherited the application).
>>
>>
>> What does the standard say about that? Which types of values in Oracle 
>> need to not be quoted?
> 
> 
> Section 5.3 of SQL92 defines:
> 
>       ::=
>             
>           | 
> 
>       ::=
>             
>           | 
> 
>       ::=
>             
>           | 
>           | 
>           | 
>           | 
>           | 
> 
> The Restrictions for Entry level SQL say that
> 
>         a) A  shall not be a            literal>.
> 
>         b) A  shall not be a  or
>           .
> 
> There are no restrictions that say a  cannot be a 
> .  is defined without quotes, but from 
> the above I conclude that a  is allowed instead of a 
>  to represent a numeric value, which means Oracle is 
> wrong IMNSVHO.
> 

Interesting.

> No reason to swell your breast though, we aren't perfect in the literal 
> area either. Because
> 
>       ::=
>             
>           | 
FAQ