Thread: reg:FilePath error
Hi....
When i am trying to insert a string data into my table which has few escape sequence characters...The entire string is not getting inserted.
Like Ex:
If my String data is
C:\ProgramFiles\SampleFiles\General\back.doc
C:\ProgramFiles\SampleFiles\General\rback.gif
C:\ProgramFiles\SampleFiles\General\nback.rar etc like this.
But in my table the string is getting stored as,
C:ProgramFilesSampleFilesGeneraack.doc
Where as the other Strings without these characters are getting inserted fine.How is this happening?How the Strings are getting stored into the Tables?
Bcoz of this \b,\n and \r characters..I am unable to store my data into the database and retrieve it.
Is there any Solution that we have?Or we need to Take care of these situations/cases?
Please give me your Suggestions to resolve this issue..
Thank you very much..
Regards,
Sandhya R
Hi Sandhya, Try using two "\" characters if you want to insert on "\". For example use "C:\\ProgramFiles\\SampleFiles\\General\\back.doc" \b, \r, \t ... have special meanings. Please refer http://www.postgresql.org/docs/8.1/static/functions-matching.html Regards, -Thusitha --- sandhya <sandhyar@amiindia.co.in> wrote: > Hi.... > > When i am trying to insert a string data into my > table which has few escape sequence characters...The > entire string is not getting inserted. > Like Ex: > If my String data is > > C:\ProgramFiles\SampleFiles\General\back.doc > > C:\ProgramFiles\SampleFiles\General\rback.gif > > C:\ProgramFiles\SampleFiles\General\nback.rar etc > like this. > > But in my table the string is getting stored as, > > C:ProgramFilesSampleFilesGeneraack.doc > > Where as the other Strings without these characters > are getting inserted fine.How is this happening?How > the Strings are getting stored into the Tables? > > Bcoz of this \b,\n and \r characters..I am unable to > store my data into the database and retrieve it. > > Is there any Solution that we have?Or we need to > Take care of these situations/cases? > > Please give me your Suggestions to resolve this > issue.. > Thank you very much.. > Regards, > Sandhya R >
If you can't easily use the PostgreSQL extension to SQL, but need to have string literal behavior conform to the ANSI and ISO standards, I have submitted a patch for the 8.2 TODO item to support this. Since we needed it in production mode now, the patch I submitted was relative to the 8.1 stable branch. As far as I know, it has not been reviewed, so there may be issues I missed, but I can say that we have been using in production for several weeks, with maybe 20 million database transactions per day across 8 servers runing on Windows and Linux, and have not seen any problems with it. If you search the lists for it, be sure to take the last patch from the patches list, there were several iterations to this, and you don't want the earlier ones. -Kevin >>> "sandhya" <sandhyar@amiindia.co.in> >>> Hi.... When i am trying to insert a string data into my table which has few escape sequence characters...The entire string is not getting inserted. Like Ex: If my String data is C:\ProgramFiles\SampleFiles\General\back.doc C:\ProgramFiles\SampleFiles\General\rback.gif C:\ProgramFiles\SampleFiles\General\nback.rar etc like this. But in my table the string is getting stored as, C:ProgramFilesSampleFilesGeneraack.doc Where as the other Strings without these characters are getting inserted fine.How is this happening?How the Strings are getting stored into the Tables? Bcoz of this \b,\n and \r characters..I am unable to store my data into the database and retrieve it. Is there any Solution that we have?Or we need to Take care of these situations/cases? Please give me your Suggestions to resolve this issue.. Thank you very much.. Regards, Sandhya R