Subject Re: [firebird-support] Cannot Insert Filepath into database
Author Helen Borrie
Hello Simon,

At 11:00 p.m. 24/06/2014, 'Simon Gallitscher' Adun.SG@... [firebird-support] wrote:
>
>I'm trying to insert a filename into my database using a .net firebird connector.
>Unfortunatly the standard escape character '\' is not working.
>When i'm trying to insert a path like this: "C:\\etc\\files\\text1.txt" i'm getting a erro tellign emt hat the column count doe snot match the value count.
>I have compared the count many times and i'm pretty sure the error is related to none-workign escape characters.
>

It's not exactly clear what you mean by "insert a filename into my database". A file name (or path) as *data* would need to be stored as a string. Strings in SQL are delimited by the apostrophe character, aka single quotes. The backslash character is not an escape character in SQL.

If you are talking about an INSERT statement then the syntax would be

INSERT INTO MYTABLE ( {some other fields}, FILEPATH)
VALUES ( {some other values}, 'C:\etc\files\text1.txt')

Note, if you have to escape an apostrophe within the string, the escape character is also an apostrophe. We sometimes refer to that as "doubling the apostrophe".

If you are talking about something different, specific to the .NET connector, this is not the right place to ask. You should subscribe to the firebird-net-provider list and ask there:
List-Subscribe:<mailto:firebird-net-provider-request@...?subject=subscribe>



Helen Borrie, Support Consultant, IBPhoenix (Pacific)
Author of "The Firebird Book" and "The Firebird Book Second Edition"
http://www.firebird-books.net
__________________________________________________________________