Home » SQL & PL/SQL » SQL & PL/SQL » Multiple Table Insert - pls. help...
Multiple Table Insert - pls. help... [message #392480] Wed, 18 March 2009 03:13 Go to next message
Maverick27
Messages: 84
Registered: October 2008
Member
Somebody pls. help with SYNTAX of multiple table insert.
It's complaining of 'missing expression'

INSERT
INTO MST_ITEM_IMAGE (VC_COMP_CODE,
VC_DEFAULT_COMP,
VC_ITEM_CODE,
VC_SUP_ITEM_CODE,
VC_UNIT,
LG_ITEM_IMAGE,
DT_MOD_DATE,
VC_AUTH_CODE)
VALUES (SELECT VC_COMP_CODE,
VC_DEFAULT_COMP,
VC_ITEM_CODE,
VC_SUP_ITEM_CODE,
VC_UNIT,
LG_ITEM_IMAGE,
DT_MOD_DATE,
VC_AUTH_CODE
FROM ITEM_IMAGE);
Re: Multiple Table Insert - pls. help... [message #392483 is a reply to message #392480] Wed, 18 March 2009 03:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle is certainly right.
Reread documentation.
Copy and paste your SQL*Plus session.
Format it with code tags.
Format your query with indentation, use SQL Formatter for instance.

Regards
Michel
Re: Multiple Table Insert - pls. help... [message #392484 is a reply to message #392483] Wed, 18 March 2009 03:19 Go to previous messageGo to next message
Maverick27
Messages: 84
Registered: October 2008
Member
Michel Cadot wrote on Wed, 18 March 2009 03:15
Oracle is certainly right.
Reread documentation.
Copy and paste your SQL*Plus session.
Format it with code tags.
Format your query with indentation, use SQL Formatter for instance.

Regards
Michel



Thanks Michel - sorry don't have the slightest clue what you are talking about... is there anything wrong with syntax ??
Re: Multiple Table Insert - pls. help... [message #392487 is a reply to message #392484] Wed, 18 March 2009 03:29 Go to previous messageGo to next message
Maverick27
Messages: 84
Registered: October 2008
Member
Missing expression - see atachment of error
Re: Multiple Table Insert - pls. help... [message #392489 is a reply to message #392487] Wed, 18 March 2009 03:36 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@Maverick27,

Please read and understand INSERT Statement.

Another link that might be useful.

Hope these helps.

Regards,
Jo
Re: Multiple Table Insert - pls. help... [message #392493 is a reply to message #392484] Wed, 18 March 2009 03:47 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You an either use INSERT... VALUES(...) to insert a single row, or INSERT...SELECT... to insert multiple rows - the two syntax cannot be combined.
Re: Multiple Table Insert - pls. help... [message #392512 is a reply to message #392493] Wed, 18 March 2009 04:35 Go to previous messageGo to next message
Maverick27
Messages: 84
Registered: October 2008
Member
JRowbottom wrote on Wed, 18 March 2009 03:47
You an either use INSERT... VALUES(...) to insert a single row, or INSERT...SELECT... to insert multiple rows - the two syntax cannot be combined.


Thank u Sir !!
Have got syntax for INSERT...SELECT...
Can;t seem to find it anywhere

Mave
Re: Multiple Table Insert - pls. help... [message #392515 is a reply to message #392512] Wed, 18 March 2009 04:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
INSERT

Just remove the VALUES clause from your current SQL.
Re: Multiple Table Insert - pls. help... [message #392522 is a reply to message #392515] Wed, 18 March 2009 04:51 Go to previous messageGo to next message
Maverick27
Messages: 84
Registered: October 2008
Member
JRowbottom wrote on Wed, 18 March 2009 04:42
INSERT

Just remove the VALUES clause from your current SQL.


Thanks.
Re: Multiple Table Insert - pls. help... [message #392525 is a reply to message #392480] Wed, 18 March 2009 04:57 Go to previous message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
Should also point out that there is a Multiple table insert in oracle but that's not what you're trying to use.
Multiple table insert inserts into multiple tables.
Getting the terminology right will get you answers faster.
Previous Topic: add a restriction depending on IN Variable
Next Topic: Validate option
Goto Forum:
  


Current Time: Sun Dec 04 18:58:05 CST 2016

Total time taken to generate the page: 0.14729 seconds