Home » RDBMS Server » Server Utilities » How to use a Query in the Export utility
How to use a Query in the Export utility [message #70674] Fri, 12 July 2002 06:10 Go to next message
sahaslad
Messages: 23
Registered: May 2002
Junior Member
Hi,
How do i use a Query to fire in a Export utility.
i have tried like this in the command prompt:
exp scott/tiger Query=select room_no from test where room_id=5895

It returns me error as:
LRM-00112: multiple values not allowed for parameter 'query'

EXP-00019: failed to process parameters, type 'EXP HELP=y' for help
EXP-00000: Export terminated unsucessfully

Thanks for ur help.
Re: How to use a Query in the Export utility [message #70675 is a reply to message #70674] Fri, 12 July 2002 06:18 Go to previous messageGo to next message
Grant
Messages: 578
Registered: January 2002
Senior Member
Depends on the OS but you may need to escape it. Here are a couple examples. You will need to play with it in different combo's to see waht works for you. You can also put it in a parameter file which changes the syntax. This was extracted from "Query= Syntax in Export in 8i" in 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

WINDOWS NT / 2000 and NETWARE syntax:
---------------------------------------------------------

Under WindowsNT or Windows 2000, as well as NetWare, the following syntax applies:

Example:

EXP demo/demo tables=test file=exp1.dmp query="""where enum >12345"""

NOTE: There should be NO spaces surrounding the double quotes in the
following statement. There are NO spaces between the double quotes either.

If you are going to use a 'PARFILE' parameter instead, then use the following syntax in the
Parfile:

file=exp66.dmp
query="where enum > 12345"
tables=(test)
log=log66.txt
userid=demo/demo
Re: How to use a Query in the Export utility [message #70678 is a reply to message #70674] Fri, 12 July 2002 23:59 Go to previous messageGo to next message
sahaslad
Messages: 23
Registered: May 2002
Junior Member
Thanks a lot it worked....
Re: How to use a Query in the Export utility [message #70687 is a reply to message #70678] Sun, 14 July 2002 02:20 Go to previous messageGo to next message
fsdsh
Messages: 1
Registered: July 2002
Junior Member
test
Re: How to use a Query in the Export utility [message #70763 is a reply to message #70674] Sun, 21 July 2002 20:42 Go to previous message
sunil bhola
Messages: 58
Registered: July 2002
Member
It's very from os to os

eg for windows
query='''where ename like 's%';

remember there are three single quotes
Previous Topic: How to export an Excel file to an Oracle table ?
Next Topic: How to Exclude Just One Table but take the FULL DB BACKUP using Exp/Imp in Oracle8i ?
Goto Forum:
  


Current Time: Mon Dec 23 06:54:23 CST 2024