Re: Insert command

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Fri, 19 Aug 2011 17:53:07 +0200
Message-ID: <9b7f7dFsbvU1_at_mid.individual.net>



On 19.08.2011 15:58, Tim Slattery wrote:
> We're in the midst of converting a system from Sybase to Oracle. This
> involves converting Sybase stored procedures to Oracle procedures and
> functions.
>
> We have a Sybase SP that inserts a line into a table. The syntax of
> the "insert" statement is:
>
> insert into cases
> values(_at_ldbNumber, @num, @submission)
>
> The actual values list is much longer, but the interesting thing is
> that there is no list of columns. Apparently this is legal in Sybase.

This could even be standard SQL.

> When I run this insert statement in Oracle SQLDeveloper, I get
> ORA-00936: Missing Expression. Is this because there is no list of
> columns? Is that list required in Oracle but not in Sybase?

SQL> ed
Wrote file afiedt.buf

   1* create table cases ( a number(10), b number(20) ) SQL> / Table created.

SQL> insert into cases values (1, 2);

1 row created.

SQL> select * from cases;

          A B
---------- ----------

          1 2

Btw, this behavior is documented
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#i2121694

Did you remove the at signs in the Oracle version of the SP?

Cheers

        robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
Received on Fri Aug 19 2011 - 10:53:07 CDT

Original text of this message