473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Parser: parse error - please help...

All,

I am having a problem with an INSERT onto a table I have created. First
off, here is the table:

---

CREATE TABLE reg ("customer number" SERIAL PRIMARY KEY, "company name"
VARCHAR(50) NULL, address VARCHAR(100) NULL, city VARCHAR(50) NULL,
state VARCHAR(2) NULL, zip VARCHAR(50) NULL, phone VARCHAR(50) NULL,
alt_phone VARCHAR(50) NULL, fax VARCHAR(50) NULL, alt_fax VARCHAR(50)
NULL, iaccess BOOL NULL DEFAULT FALSE, browser VARCHAR(50) NULL,
provider VARCHAR(50) NULL, software VARCHAR(50) NULL, sversion
VARCHAR(10) NULL, ynintegrated BOOL NULL DEFAULT FALSE, ynnewtest BOOL
NULL DEFAULT FALSE, login VARCHAR(50) NULL, password VARCHAR(50) NULL,
txtnetid VARCHAR(11) NULL, alias_1 VARCHAR(50) NULL, alias_2 VARCHAR(50)
NULL, url VARCHAR(255) NULL, approval_password VARCHAR(20) NULL,
ynauthalert BOOL NULL DEFAULT FALSE, loi_date VARCHAR(50) NULL,
contract_eff VARCHAR(50) NULL, contract_term VARCHAR(50) NULL, term_code
VARCHAR(255) NULL, main_eff VARCHAR(50) NULL, main_term VARCHAR(50)
NULL, live_eff VARCHAR(50) NULL, renewal_eff VARCHAR(50) NULL, cs_rep
VARCHAR(50) NULL, txtactmanager VARCHAR(50) NULL, txtsalesrep
VARCHAR(50) NULL, txtprojmanager VARCHAR(50) NULL, modem_number
VARCHAR(50) NULL, dbc_users VARCHAR(50) NULL, intbillableusers INT4
NULL, country VARCHAR(50) NULL, mmowarning TEXT NULL, mmositefileflags
TEXT NULL, verified VARCHAR(50) NULL, buildtimedate VARCHAR(50) NULL,
ynhipaaba BOOL NULL DEFAULT FALSE);

---

I have a process which loops and inserts multiple records into this
table. After processing approximately 200 records, it attempts to do the
following insert:

---

INSERT INTO reg("customer number", "company name", address, city, state,
zip, phone, alt_phone, fax, alt_fax, iaccess, browser, provider,
software, sversion, ynintegrated, ynnewtest, login, password, txtnetid,
alias_1, alias_2, url, approval_password, ynauthalert, loi_date,
contract_eff, contract_term, term_code, main_eff, main_term, live_eff,
renewal_eff, cs_rep, txtactmanager, txtsalesrep, txtprojmanager,
modem_number, dbc_users, intbillableusers, country, mmowarning,
mmositefileflags, verified, buildtimedate, ynhipaaba) VALUES ('855',
'Test Company', '1234 West Jazz Street', 'Tempe', 'AZ', '85203', '(602)
123-4567', '(602) 123-4567', '(602) 123-4567', '(602) 123-4567', true,
'Internet Explorer', DEFAULT, 'HP3.5', '13', false, false, 'eci855',
DEFAULT, DEFAULT, 'Test', 'Tester', 'http:\\www.eldocomp.com\', DEFAULT,
false, DEFAULT, '09/11/2002', DEFAULT, DEFAULT, '09/11/2002', DEFAULT,
DEFAULT, DEFAULT, 'Chris Riesgraf ext. 244', 'Keri Daminelli ext. 246',
'Kerry Winkle ext. 229', DEFAULT, DEFAULT, DEFAULT,
'0', 'USA', 'afdsf', DEFAULT, DEFAULT, DEFAULT, false);

---

This generates the following error (from within VB):

Error -2147467259 - ERROR: parser: parse error at or near "09" at
character 847

---

When I try the above insert in psql, I get a prompt like:

dbname'>

Here, if I input ' followed by RETURN, the prompt changes to:

dbname(>

Input ), the prompt changes to:

dbname->

Input ;, the error occurs:

ERROR: parser: parse error at or near "09" at character 847

---

Something is obviously wrong - but what it is, I cannot tell. I have
tried to simplify the problem by comparing prior inserts to this one, to
see what the differences are, to no avail. It is like it is missing a
paren or a quote, or has an extra - but that doesn't seem to be the case.

Am I missing something obvious, can somebody help?

Thank you,

Andrew L. Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
2 1743
On Mon, Dec 22, 2003 at 04:24:52PM -0700, Andrew Ayers wrote:
INSERT INTO reg("customer number", "company name", address, city, state,
zip, phone, alt_phone, fax, alt_fax, iaccess, browser, provider,
software, sversion, ynintegrated, ynnewtest, login, password, txtnetid,
alias_1, alias_2, url, approval_password, ynauthalert, loi_date,
contract_eff, contract_term, term_code, main_eff, main_term, live_eff,
renewal_eff, cs_rep, txtactmanager, txtsalesrep, txtprojmanager,
modem_number, dbc_users, intbillableusers, country, mmowarning,
mmositefileflags, verified, buildtimedate, ynhipaaba) VALUES ('855',
'Test Company', '1234 West Jazz Street', 'Tempe', 'AZ', '85203', '(602)
123-4567', '(602) 123-4567', '(602) 123-4567', '(602) 123-4567', true,
'Internet Explorer', DEFAULT, 'HP3.5', '13', false, false, 'eci855',
DEFAULT, DEFAULT, 'Test', 'Tester', 'http:\\www.eldocomp.com\', DEFAULT,
Note here: ^^
false, DEFAULT, '09/11/2002', DEFAULT, DEFAULT, '09/11/2002', DEFAULT,
DEFAULT, DEFAULT, 'Chris Riesgraf ext. 244', 'Keri Daminelli ext. 246',
'Kerry Winkle ext. 229', DEFAULT, DEFAULT, DEFAULT,
'0', 'USA', 'afdsf', DEFAULT, DEFAULT, DEFAULT, false);


You have an escaped ', which will make the string literal continue till
the next '. You should really be escaping your \ and ' when they are
embedded in data. Consider something like "Joh\n"; it will insert Joh
followed by a newline.

Also, an URL with \ is quite weird ... I think they like / best.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
You liked Linux a lot when he was just the gawky kid from down the block
mowing your lawn or shoveling the snow. But now that he wants to date
your daughter, you're not so sure he measures up. (Larry Greenemeier)

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2
On Mon, Dec 22, 2003 at 04:24:52PM -0700, Andrew Ayers wrote:
DEFAULT, DEFAULT, 'Test', 'Tester', 'http:\\www.eldocomp.com\', DEFAULT,
false, DEFAULT, '09/11/2002', DEFAULT, DEFAULT, '09/11/2002', DEFAULT,


The \ at the end off the URL in the first line here is escaping the '
after it, so the string which should consist of just the URL is being
taken to include everything up to the next ' , the one at the beginning
of the date. Then the date itself appears to fall outside quotes, hence
Pg tries to parse it, hence parse error at 09.

The \ in the URL should be / - this goes for all \ in all URL.

Richard

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Mike | last post by:
Does anyone know of a minimal/mini/tiny/small xml parser in c? I'm looking for something small that accepts a stream or string, builds a c structure, and then returns an opaque pointer to that...
2
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
0
by: Phlip | last post by:
C++ newsgroupies: I wrote a parser to solve math expressions like "3.0 ^(4 - 5)", or "3 / 8". Below my sig is recursiveDescentParser.cpp, the test suite that drove the implementation of the...
2
by: Andrew Ayers | last post by:
All, I am having a problem with an INSERT onto a table I have created. First off, here is the table: --- CREATE TABLE reg ("customer number" SERIAL PRIMARY KEY, "company name" ...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
2
by: Marshall | last post by:
Hi All, I am building an asp.net web app using Visual Studio 2003. Today I created a new folder called 'Secured' at the root of my web app so I could partition off all of the restricted...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
18
by: Just Another Victim of the Ambient Morality | last post by:
Is pyparsing really a recursive descent parser? I ask this because there are grammars it can't parse that my recursive descent parser would parse, should I have written one. For instance: ...
4
by: fbrewster | last post by:
I'm writing an HTML parser and would like to use Internet Explorers DOM parser. Can I use Internet Explorers DOM parser through a web service? thanks for the help
1
by: Sidhartha | last post by:
Hi, I am facing a problem while parsing local language characters using sax parser. We use DOM to parse and SAX to read the source. But when our application parses strings with local language...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.