Solved

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

Posted on 2013-05-20
4
392 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

929 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now