strings

Started by Hugoover 20 years ago2 messagesgeneral
Jump to latest
#1Hugo
htakada@gmail.com

Hi,
calling a function with select esquema.fn_importa_csv('c:\file.csv')
I get this errror:

ERROR: could not open file "c:file.csv" for reading: No such file or
directory
CONTEXT: SQL statement "copy comisiones.avon(
zona,ano,campana,fechapro,contrato,situacion,documento,tipo,subtipo,exentas,gravadas,iva,importe
) from 'c:\file.csv' with CSV"
PL/pgSQL function "fn_importa_csv" line 11 at execute statement

but if I call it with select esquema.fn_importa_csv('c:\\\\file.csv')
everything works fine, what can I do to call the function with the
'c:\file.csv' parameter and make it work ??

thanks for any help

Hugo

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hugo (#1)
Re: strings

Hugo <htakada@gmail.com> writes:

ERROR: could not open file "c:file.csv" for reading: No such file or
directory
CONTEXT: SQL statement "copy comisiones.avon(
zona,ano,campana,fechapro,contrato,situacion,documento,tipo,subtipo,exentas=
,gravadas,iva,importe
) from 'c:\file.csv' with CSV"

Looks like you need to double that backslash ... or use a forward slash.

regards, tom lane