dbTalk Databases Forums  

Insert command

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Insert command in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Slattery
 
Posts: n/a

Default Insert command - 08-19-2011 , 08:58 AM






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(@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.

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?

--
Tim Slattery
Slattery_T (AT) bls (DOT) gov
http://members.cox.net/slatteryt

Reply With Quote
  #2  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Insert command - 08-19-2011 , 10:53 AM






On 19.08.2011 15:58, Tim Slattery wrote:
Quote:
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(@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.

Quote:
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/B...4.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/

Reply With Quote
  #3  
Old   
Tim Slattery
 
Posts: n/a

Default Re: Insert command - 08-19-2011 , 11:27 AM



Robert Klemme <shortcutter (AT) googlemail (DOT) com> wrote:


Quote:
Did you remove the at signs in the Oracle version of the SP?
Yes, they're gone, I don't know why I put them in the original post.
The "ORA-00936: Missing Expression" appears whether or not the column
list is in the insert statement.

Three of the columns are named "name", "category", and "native". SQL
Developer shows these in bold face when I include the column list in
the insert statement. I don't think it has anything to do with the
error, but what's up with that? They're not reserved words, I looked
up a list of Oracle reserved words and none of them are on it.

--
Tim Slattery
Slattery_T (AT) bls (DOT) gov
http://members.cox.net/slatteryt

Reply With Quote
  #4  
Old   
ddf
 
Posts: n/a

Default Re: Insert command - 08-19-2011 , 03:50 PM



On Aug 19, 9:27*am, Tim Slattery <Slatter... (AT) bls (DOT) gov> wrote:
Quote:
Robert Klemme <shortcut... (AT) googlemail (DOT) com> wrote:
Did you remove the at signs in the Oracle version of the SP?

Yes, they're gone, I don't know why I put them in the original post.
The "ORA-00936: Missing Expression" appears whether or not the column
list is in the insert statement.

Three of the columns are named "name", "category", and "native". SQL
Developer shows these in bold face when I include the column list in
the insert statement. I don't think it has anything to do with the
error, but what's up with that? They're not reserved words, I looked
up a list of Oracle reserved words and none of them are on it.

--
Tim Slattery
Slatter... (AT) bls (DOT) govhttp://members.cox.net/slatteryt
Where did you find this list? In 10g both 'NATIVE' and 'CATEGORY'
are found in v$reserved_words, indicating that Oracle considers them
as such.


David Fitzjarrell

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.