Escape character + Oracle .NET

  • Thread starter Thread starter christof
  • Start date Start date
C

christof

I wish to make a backup, with host copy operation but got problems with
double backslash \\ occuring in my OracleCommand, got always exception
"Invalid SQL", here's my command (.txt only as example):

OracleCommand oraCmdCopy = new OracleCommand(String.Format("host copy
{0} {1}", @"D:\a.txt", @"F:\b.txt"), oraConn);

I've put a watch there's always:
D:\\a.txt
F:\\b.txt

I've tried with String.Replace(@"\\",@"\")...

but there is no positive result..

Can anyone tell me how to handle that situation?
[Oracle accepts D:\a.txt, but not D:/a.txt, tried that also...]

Thanks
 
christof said:
I wish to make a backup, with host copy operation but got problems with
double backslash \\ occuring in my OracleCommand, got always exception
"Invalid SQL", here's my command (.txt only as example):

OracleCommand oraCmdCopy = new OracleCommand(String.Format("host copy
{0} {1}", @"D:\a.txt", @"F:\b.txt"), oraConn);

I've put a watch there's always:
D:\\a.txt
F:\\b.txt

I've tried with String.Replace(@"\\",@"\")...

but there is no positive result..

Can anyone tell me how to handle that situation?
[Oracle accepts D:\a.txt, but not D:/a.txt, tried that also...]

Thanks
What sort of command is that?
Based on a quick google I cannot find any mention of oracle supporting
sql syntax like that.
Are you sure that oracle will accept that 'SQL' statement.
Bear in mind that that is _not_ a valid sql statement so if oracle does
it must be some sort of extension.

JB
 
What sort of command is that?
Based on a quick google I cannot find any mention of oracle supporting
sql syntax like that.
Are you sure that oracle will accept that 'SQL' statement.
Bear in mind that that is _not_ a valid sql statement so if oracle does
it must be some sort of extension.

Taken from "Expert Oracle9i Database Administration":

The following is the command you issue to perform hot backups. You'll
repeat the command for all the tablespaces in the database:

SQL> alter tablespace proddata_01 begin backup;

Copy all the data files that are part of the proddata_01 tablespace. The
operating system copy command is invoked at this point to perform the
physical copy of all the data files.

SQL> host cp /u10/app./oracle/oradata/remorse/users01.dbf
/u01/app/oracle/remorse/backup

End the tablespace backup after the copying of all the files is
completed with the following statement:

SQL> alter tablespace proddata_01 end backup;
 
Probably not all the command in Oracle can send from ADO.NET.

chanmm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top