Thread: strings

strings

From
Hugo
Date:
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

Re: strings

From
Tom Lane
Date:
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