Home » RDBMS Server » Server Utilities » query option use in the export utility
query option use in the export utility [message #71784] Fri, 10 January 2003 08:42 Go to next message
Ernest Malagrida
Messages: 3
Registered: January 2003
Junior Member
hello,

I have the following export query which states that
the sql command is not properly ended. I am attempting
to export a set of records from a table that are exactly a year
old using 'sysdate'.

Here is the query using the export utility:

exp username/password query="where timestamp='sysdate' '-' '365'"
file = exp.dmp log=dmp.log

If someone can help me with this,
it would be greatly appreciated.

Thank you,
Ernie Malagrida
Re: query option use in the export utility [message #71788 is a reply to message #71784] Fri, 10 January 2003 10:37 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> select * from emp;

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 09-JAN-03        800                    20
      7499 ALLEN      SALESMAN        7698 09-JAN-03       1600        300         30
      7521 WARD       SALESMAN        7698 09-JAN-03       1250        500         30
      7566 JONES      MANAGER         7839 09-JAN-03       2975                    20
      7654 MARTIN     SALESMAN        7698 09-JAN-03       1250       1400         30
      7698 BLAKE      MANAGER         7839 09-JAN-03       2850                    30
      7782 CLARK      MANAGER         7839 10-JAN-02       2450                    10
      7788 SCOTT      ANALYST         7566 09-JAN-03       3000                    20
      7839 KING       PRESIDENT            10-JAN-02       5000                    10
      7844 TURNER     SALESMAN        7698 09-JAN-03       1500          0         30
      7876 ADAMS      CLERK           7788 09-JAN-03       1100                    20
      7900 JAMES      CLERK           7698 09-JAN-03        950                    30
      7902 FORD       ANALYST         7566 09-JAN-03       3000                    20
      7934 MILLER     CLERK           7782 10-JAN-02       1300                    10

14 rows selected.

SQL> select * from emp where trunc(hiredate)=trunc(sysdate-365);

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7782 CLARK      MANAGER         7839 10-JAN-02       2450                    10
      7839 KING       PRESIDENT            10-JAN-02       5000                    10
      7934 MILLER     CLERK           7782 10-JAN-02       1300                    10

----------------------------------------------------------------------

C:>exp mag/mag tables=emp  query="where trunc(hiredate)=trunc(sysdate-365)"

Export: Release 8.1.6.0.0 - Production on Fri Jan 10 12:20:35 2003

(c) Copyright 1999 Oracle Corporation.  All rights reserved.

Connected to: Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                            EMP          3 rows exported
Export terminated successfully without warnings.
C:>

re:query option use in the export [message #71891 is a reply to message #71788] Wed, 29 January 2003 08:24 Go to previous message
Ernest Malagrida
Messages: 3
Registered: January 2003
Junior Member
Thanks. My export command works fine.
I can now export my records via a cron job
commmand when they become 1 year old.

Regrds,
Ernie Malagirda
Previous Topic: sql loader
Next Topic: float value being rounded by sql loader
Goto Forum:
  


Current Time: Tue May 14 19:56:20 CDT 2024