Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Export with query clause
What documentation set are you looking at?
Excuse any line-wrapping below - I need to reset a few netscape defaults - from the 8.1.6 Oracle8i Utilties manual:
For example, if user SCOTT wants to export only those employees whose job title is SALESMAN and whose salary is greater than 1600, he could do the following (note that this example is UNIX-based):
exp scott/tiger tables=emp query=\"where job=\'SALESMAN\' and sal\<1600\"
[ snip ]
When executing this command, Export builds a SQL SELECT statement similar to this:
SELECT * FROM EMP where job='SALESMAN' and sal <1600;
The QUERY is applied to all tables (or table partitions) listed in the TABLE parameter. For example, the following statement will unload rows in both EMP and BONUS that match the query:
exp scott/tiger tables=emp,bonus query=\"where job=\'SALESMAN\' and sal\<1600\"
Again, the SQL statements that Export executes are similar to these:
SELECT * FROM EMP where where job='SALESMAN' and sal <1600;
SELECT * FROM BONUS where where job='SALESMAN' and sal <1600;
If a table is missing the columns specified in the QUERY clause, an
error message will be produced and
no rows will be exported for the offending table.
Restrictions
The parameter QUERY cannot be specified for full, user, or transportable tablespace mode exports. The parameter QUERY must be applicable to all specified tables. The parameter QUERY cannot be specified in a direct path export (DIRECT=Y) The parameter QUERY cannot be specified for tables with inner nested tables. You will not be able to determine from the contents of the export file whether the data is the result of a QUERY export. -----------------------------------------
Brian McCarthy - Oracle
NeilC wrote:
>
> Hi,
>
> could someone give a quick example of using the QUERY clause of export.
> I have looked at the documentation but there is no example.
> At what level can it be used at FULL, USER, TABLE ??
>
> any help and examples appreciated
>
Received on Fri Jan 14 2000 - 06:32:56 CST
![]() |
![]() |