Solved

Insert statment too many values error when inserting comma delimited string.

Posted on 2013-05-20
4
395 Views
Last Modified: 2013-06-07
When I try running the following insert statements, I encounter too many values error
Is it because of the comma delimited string?
If so, what syntax do I use to make this one string?

insert into g_values
  (g_value_id,
   name,
   data_type,
   value,
   description,
   min_value,
   max_value,
   allow_local,
   allow_user,
   synchronize)
values
  ('A1',
   'DATA_FLAG',
   'STRING',
   'MAC','PC','EDSON','LOGITECH',
   'List of itmess.',
   '1',
   '255',
   'N',
   'N',
   'N'
   )
0
Comment
Question by:cookiejar
  • 2
4 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 39182428
The following is equivalent to 4 values:
'MAC','PC','EDSON','LOGITECH',

Open in new window

0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 39182429
If all of this: 'MAC','PC','EDSON','LOGITECH'  goes into one field, then it needs to be a single string:

'''MAC'',''PC'',''EDSON'',''LOGITECH''',
0
 
LVL 40

Expert Comment

by:Sharath
ID: 39182439
try this
insert into g_values
  (g_value_id,
   name,
   data_type,
   value,
   description,
   min_value,
   max_value,
   allow_local,
   allow_user,
   synchronize)
values
  ('A1',
   'DATA_FLAG',
   'STRING',
   'MAC,PC,EDSON,LOGITECH',
   'List of itmess.',
   '1',
   '255',
   'N',
   'N',
   'N'
   )

Open in new window

0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39182441
I should also point out that those are all individual single quotes.  No double quotes used.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to take different types of Oracle backups using RMAN.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question