hai everybody,
I need to copy data from a text file to a table i used copy command
like this -
-
copy city from 'e\ccccc.txt' with delimiter as ','
-
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
if use copy command like this -
copy city from '\\Ttcpl2\e\ccccc.txt' with delimiter as ','
-
I got an error -
WARNING: nonstandard use of \\ in a string literal
-
LINE 1: copy city from '\\Ttcpl2\e\ccccc.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
-
-
If i use /copy command -
\COPY city FROM '\\ttcpl2\e\ccccc.txt ' WITH DELIMITER ','
-
-
ERROR: syntax error at or near "\"
-
SQL state: 42601
-
Character: 1
-
Please help me as soon as possible....... ...
3 12184 michaelb 534
Recognized Expert Contributor
Try either to double the backslashes (use \\\\ instead of \\) or replace them with forward-slashes, that is use "/" in place of "\"
hai everybody,
I need to copy data from a text file to a table i used copy command
like this -
-
copy city from 'e\ccccc.txt' with delimiter as ','
-
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
if use copy command like this -
copy city from '\\Ttcpl2\e\ccccc.txt' with delimiter as ','
-
I got an error -
WARNING: nonstandard use of \\ in a string literal
-
LINE 1: copy city from '\\Ttcpl2\e\ccccc.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
-
-
If i use /copy command -
\COPY city FROM '\\ttcpl2\e\ccccc.txt ' WITH DELIMITER ','
-
-
ERROR: syntax error at or near "\"
-
SQL state: 42601
-
Character: 1
-
Please help me as soon as possible....... ...
i have did as if u have said -
\COPY city FROM '//ttcpl2/e/ccccc.txt ' WITH DELIMITER ',';
-
-
ERROR: syntax error at or near "\"
-
SQL state: 42601
-
Character: 1
-
-
michaelb 534
Recognized Expert Contributor
i have did as if u have said -
\COPY city FROM '//ttcpl2/e/ccccc.txt ' WITH DELIMITER ',';
-
-
ERROR: syntax error at or near "\"
-
SQL state: 42601
-
Character: 1
-
Why do you have a backslash at the beginning of your command?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sarah |
last post by:
Hi!
I have perhaps a strange question... I have a javascript that
activates on a right click and shows the user a little menu of links.
However, by doing so, it disables the users ability to use the Copy
Command when doing a normal right click. I know that in some cases
this would be good for someone who wants to make it harder to copy
pictures from their site... but in this case I WANT people to be able
to copy the pictures....
|
by: Don Isgitt |
last post by:
Hi,
I am recreating a database and its applications onto a new server and
new software; old version of pg was 7.2.4 and new version is
gds2=# select version();
version
--------------------------------------------------------------------------------------------------------
|
by: J M |
last post by:
How do I run following from csharp from "server"?
copy file.txt \\server\printer1
Also how can I submit a text file print job to local print queue "printer1"?
Assuming I run copy command from server.
TIA!
|
by: Bob Powell |
last post by:
To whom it may concern:
Does anyone know if it is possible to make the COPY command in postgres
verbose. It would be very helpful if an error would generate when
something goes wrong with a COPY. In the case of an extraneous comma
or quote, it would identify the offending record. Thanks
Bob Powell
|
by: Jon Asher |
last post by:
Hi,
I'm trying to do a simple import of a comma delimited text file with COPY
but it's returning an error. The file has been granted all permissions in
Linux, so it's not clear to me what the problem is. Version 7.41 is
installed... see below for details:
A comma delimited text file has been placed in a local directory with
permissions set to allow any user to read or write to it:
/root/Desktop/server_transfer/WorldPoints_v2.txt'
| |
by: Robert Fitzpatrick |
last post by:
I have a PHP script that was having problems using the COPY command with
files around 1500 lines in size. The script will build the copy data
from incoming CSV file into a temp file, then start a COPY command and
loop through the copy data using pg_put_line to insert and then
pg_end_copy after posting the last line as '\.'. Worked well under that
1500 line area. What I found was if I issue a pg_connection_busy($dbh)
before the...
|
by: devinath |
last post by:
I came across a problem while running the system file. When the copy command is run using system command , it doesn’t copy files which have size of 0kb.
But the same command works if run thru the dos prompt , which is activated thru windows command prompt.
pls let me know if there is some other way out..
regs
devinath
|
by: coolminded |
last post by:
can we use the copy command to copy it in the local disk
copy temp_swap TO ''c:\folder_name\";
|
by: ibo3 |
last post by:
I used the copy command as stateed below, to copy a file containing data, which I want to load into my evaluations table. I get the following error, can some one explain to me what I may be doing wrong.
COPY evaluations FROM 'c:\evaluations.txt'
DELIMITERS ':';
WARNING: nonstandard use of escape in a string literal
LINE 1: COPY evaluations FROM 'c:\evaluations.txt'
^
HINT: Use the escape string...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |