hai everybody,
I need to copy data from a text file to a table i used copy command
like this
[code=sql]
copy city from 'e\ccccc.txt' with delimiter as ','
[/code]
it worked successfully. But now i need to copy a data from a text file which is in my system to the database in server..
path of the file in my system is
[code=text]
\\ttcpl2\e\cccc c.txt
[/code]
if use copy command like this
[code=sql]
copy city from '\\Ttcpl2\e\ccc cc.txt' with delimiter as ','
[/code]
I got an error
[code=text]
WARNING: nonstandard use of \\ in a string literal
LINE 1: copy city from '\\Ttcpl2\e\ccc cc.txt' with delimiter as ','
^
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
ERROR: could not open file "\Ttcpl2eccccc. txt" for reading: No such file or directory
SQL state: 58P01
[/code]
If i use /copy command
[code=sql]
\COPY city FROM '\\ttcpl2\e\ccc cc.txt ' WITH DELIMITER ','
[/code]
[code=text]
ERROR: syntax error at or near "\"
SQL state: 42601
Character: 1
[/code]
Please help me as soon as possible....... ...
I need to copy data from a text file to a table i used copy command
like this
[code=sql]
copy city from 'e\ccccc.txt' with delimiter as ','
[/code]
it worked successfully. But now i need to copy a data from a text file which is in my system to the database in server..
path of the file in my system is
[code=text]
\\ttcpl2\e\cccc c.txt
[/code]
if use copy command like this
[code=sql]
copy city from '\\Ttcpl2\e\ccc cc.txt' with delimiter as ','
[/code]
I got an error
[code=text]
WARNING: nonstandard use of \\ in a string literal
LINE 1: copy city from '\\Ttcpl2\e\ccc cc.txt' with delimiter as ','
^
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
ERROR: could not open file "\Ttcpl2eccccc. txt" for reading: No such file or directory
SQL state: 58P01
[/code]
If i use /copy command
[code=sql]
\COPY city FROM '\\ttcpl2\e\ccc cc.txt ' WITH DELIMITER ','
[/code]
[code=text]
ERROR: syntax error at or near "\"
SQL state: 42601
Character: 1
[/code]
Please help me as soon as possible....... ...
Comment