how to store whole XML file in database

Started by deepak palabout 19 years ago4 messagesgeneral
Jump to latest
#1deepak pal
deepak.05pal@gmail.com

hi,,
i have to insert whole xml file in database ,there is a text field
for that.but it shows error parse error where there are attribute ..plz
help me out.

#2Tommy Gildseth
tommy@gildseth.com
In reply to: deepak pal (#1)
Re: how to store whole XML file in database

deepak pal wrote:

hi,,
i have to insert whole xml file in database ,there is a text
field for that.but it shows error parse error where there are
attribute ..plz help me out.

I'm guessing you have a quoting problem. Try escaping the XML-data
before inserting it into the database, so that any single quotes doesn't
mess up your insert statements.

--
Tommy

#3Brandon Aiken
BAiken@winemantech.com
In reply to: deepak pal (#1)
Re: how to store whole XML file in database

You'll have to escape any quotation marks or your SQL will not parse
your strings correctly.

--

Brandon Aiken

CS/IT Systems Engineer

________________________________

From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of deepak pal
Sent: Monday, February 12, 2007 4:07 AM
To: PostgreSQL - General
Subject: [GENERAL] how to store whole XML file in database

hi,,
i have to insert whole xml file in database ,there is a text
field for that.but it shows error parse error where there are attribute
..plz help me out.

--------------------------------------------------------------------
** LEGAL DISCLAIMER **
Statements made in this e-mail may or may not reflect the views and
opinions of Wineman Technology, Inc. or its employees.

This e-mail message and any attachments may contain legally privileged,
confidential or proprietary information. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are hereby notified
that any dissemination, distribution or copying of this e-mail
message is strictly prohibited. If you have received this message in
error, please immediately notify the sender and delete this e-mail
message from your computer.

#4Richard Huxton
dev@archonet.com
In reply to: Brandon Aiken (#3)
Re: how to store whole XML file in database

Brandon Aiken wrote:

You'll have to escape any quotation marks or your SQL will not parse
your strings correctly.

And you have to do this for all your data, not just XML. Otherwise the
first Mr. O'Malley you have a record for will break your application.

--
Richard Huxton
Archonet Ltd