Home » RDBMS Server » Server Utilities » Export gives invalid col name
Export gives invalid col name [message #70779] Mon, 22 July 2002 21:46 Go to next message
MJ
Messages: 11
Registered: April 2002
Junior Member
Hi the foll exp syntax gives invalid column name though
col name is valid in table .
OS is Sun Solaris :

exp test/test file=expt.dmp tables=emp
query="where empno in ('12345')"

what is wrong with syntax
Re: Export gives invalid col name [message #70786 is a reply to message #70779] Tue, 23 July 2002 05:36 Go to previous message
Grant
Messages: 578
Registered: January 2002
Senior Member
I don't think you need to escape (. Try:

query="where empno in ('12345')"

From MetaLink:

UNIX syntax:
----------------

- Example:
Export table data from DEMO.EMP that only includes FRAN like last
names.

exp demo/demo query="where lname like 'FRAN%'" tables=emp
file=exp.dmp log=exp.log


- Example: If you want to export multiple tables and use the QUERY parameter
in the export, the WHERE clause must be applicable to all tables.

Export all data for employees and customers residing in the state
of New York.

exp demo/demo query="where st='NY'" tables=(emp,cust)
file=exp.dmp log=exp.log

In the Utilities Guide we are warned of the possibility of needing to use
the UNIX escape ('') to make some UNIX reserved characters a literal rather
than being interpreted as the reserved character. The example given is

query="where JOB = 'SALESMAN' and salary < 1600"

Note that the ", ', and < are all UNIX reserved characters and thus need
to be escaped.

However, an important addendum to this is that this only applies when giving
export options at the command line. If you are using a parfile these need
not be escaped, and in fact it will cause an error if you do. The same option
in a parfile would look like

query="where JOB = 'SALESMAN' and salary < 1600"

Note the need for the double quotes as this is still a UNIX argument and
spaces are not allowed. The double quotes are necessary to tell UNIX this
is a string literal.

If there are no single quotes in the query string you may use single quotes or
double quotes to denote the literal. Some examples of valid arguments,
given a table FOO(BAR number)

From the command line:

query='where bar = 2'
query="where bar = 2"
(note that here we may use single or double quotes)

query='where bar < 2' (note the extra to allow the use of the < as a
literal)

These three in a parfile would simply be(respectively):

query='where bar=2'
query="where bar=2"
query='where bar < 2'
Previous Topic: Problem in loading fields carrying carriage return
Next Topic: ORA-01033: ORACLE initialization or shutdown in progress
Goto Forum:
  


Current Time: Sat May 04 10:45:22 CDT 2024