Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 19th, 2004, 09:44 AM
haahwee haahwee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 haahwee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 sec
Reputation Power: 0
Need help with insert statement

I am trying to insert the following string into a varchar2(4000) column using sql insert.

Here is the sql:

insert into table1
column1
values
('http://server/servlet/ADPTable?_bm=y&-tree_id=302&-BucketID=NO&-context=adp&-type=null&-all_geo_types=N&-Tables=(ACS_2002_EST_G00_DP4)&-subject=Air%20Conditioning%20and%20Heating%20Fuel&-subject=Kitchen%20Facilities&-subject=Owner%20Costs&-subject=Plumbing%20Facilities&-subject=Renter%20Statistics&-subject=Rooms%20and%20Bedrooms&-subject=Telephone%20Service%20Available&-subject=Units%20in%20Structure&-subject=Value%20of%20Home%20(Owned%20and%20Vacant)&-subject=Vehicles%20Available&-subject=Year%20Householder%20Moved%20Into%20Unit&-subject=Year%20Structure%20Built&-redoLog=true&-EC_NAME=NO&-_lang=en&-geo_id=D&-ExpandSubject=NO&-CONTEXT=adp&-format=null&-what=1&-what=2&-what=3&-what=4&-what=5&-what=6!&-what=7&-what=8&-what=9&-ds_name=D&-qr_name=ACS_2003_EST_G00_DP4&-table=(ACS_2002_EST_G00_DP4)&-WhatTable=pr,qt,adp,np,myp,gct,grt,tm,dt,&-ExpandItem=NO')

When i execute the statement, i get an oracle error ORA-00917, missing comma.

Does it have anything to do with commas in the string i'm trying to insert. Do I need to escape them?
I'm using a Java Statement to perform the insert.

The way I am assuming the insert works is once it encounters the first single quote, it should keep parsing the string until it finds another single quote, and everything else inside the quotes should be treated as data for the string. Is this right?

Any help??

Reply With Quote
  #2  
Old October 19th, 2004, 10:29 AM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,784 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 21 h 42 m 49 sec
Reputation Power: 37
Code:
insert into table1
(column1)
values


You only need to escape apostrophes (using an ') in the inserted value. I.e.

Code:
insert into t(c1) values ('Pepe''s bodega')

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Need help with insert statement


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT