Syntax for taking export with the "Query" parameter

Hi all

Please help me about the syntax for export with the query parameter taking

Hello

exp file=d:\exp.dmp log=d:\exp.log tables=scott.emp query='where empno=10'

exp file=d:\exp.dmp log=d:\exp.log tables=scott.emp query='where ename='''SCOTT''

Salman

Tags: Database

Similar Questions

  • Problem with the query parameter

    Hi,
    I have data some thing like 
    
    SQL> select * from temp_tabr;
    
    INSTITUTE  STUDNAME   GR     MARKS
    ---------- ---------- -- ---------
    xxxx       abc        A        500
    xxxx       pqq        A        550
    xxxx       zzz        B        300
    xxxx       sss        B        400
    yxxx       abc        A        500
    yxxx       pqq        A        550
    yxxx       zzz        B        300
    yxxx       sss        B        400
    
    
    
    I want a query to retrive the data based on 3 parameters
    Institue is mandatory
    GR and MARKS are optional
    
    user may pass any one of the Optional parameters GR or MARKS not both
    
    example he may pass Intitute and get all 8 records
    if he pass Institue and grade it should retrive only those matching
    if he pass institute and marks it should retrive only those matching
    
    only grade or marks will be passed or neighter of them will be passed.
    
    
                                 
    
    
    
    create table temp_tabr(institute varchar2(10),
                      studname  varchar2(10),
                      grade     varchar2(2),
                      marks      number);
    
    insert into temp_tabr values
    ('xxxx',             'abc',           'A',       '500');
    insert into temp_tabr values('xxxx',             'pqq',           'A',       550);
    
    insert into temp_tabr values('xxxx'  ,          'zzz' ,          'B'  ,     300);
    insert into temp_tabr values('xxxx'  ,          'sss' ,          'B'  ,    400);
    
    
    insert into temp_tabr values
    ('yxxx',             'abc',           'A',       '500');
    insert into temp_tabr values('yxxx',             'pqq',           'A',       550);
    
    insert into temp_tabr values('yxxx'  ,          'zzz' ,          'B'  ,     300);
    insert into temp_tabr values('yxxx'  ,          'sss' ,          'B'  ,    400);

    Like this?

    select * from temp_tabr
    where
    institute='&a'
    and grade = nvl('&b',grade)
    and marks = nvl(to_number('&c'),marks)
    

    If you pass parameters using the variable, you do not have to use to_number, you can directly pass the name of the variable. I have provided for you to test it in sql * more.

    HTH,
    Prazy

  • DataPump the QUERY parameter with string values? -SOLVED

    All,

    I'm trying to specify a query to the datapump API parameter but can't seem to get my correct single/double quotes so that it can work. I can successfully use the QUERY parameter with something like QUERY = table: '"number_column = 6" ' but NOT with something like QUERY = table:'"string_column ="value"" "

    I tried different versions of the single/double quotes, but all fails with slightly different errors. Someone at - it an example where a string value is used with success?

    Thanks in advance. Oracle 10.2.0.3.0 - AIX 5.3

    So after reading some other reviews on another thread - I tried this and it worked:

    QUERY = table:------"where string_column = 'value\' \' \

    Looks like you have escape all single/double quotation marks for this parameter

    Published by: potter_geek on August 31, 2009 10:47

    Hello

    Use the parameter file or if you run expdp command-line use escape character '-' (backslash) in this case.

    Concerning
    Anurag Tibrewal.

  • Using the QUERY parameter in exp/expdp

    Hi, I've faced a nite last question.
    IM currently using Oracle 10 g (10.2.0.4) OS - MS Windows Server 2003

    I want a dump of tables to export multiple schemas. say (acb.m1, pqr.b2, xyz.b1)

    Each table has a minimum lines of 2,000,000,

    And I want to just the initials 10 rows in each table of export

    Is it possible that I can do this...

    Please answer.
    Thanks in advance

    Export tables in multiple schemas is not supported in Data Pump until 11.1.0.7. So if you're on 10g, you will need to run multiple commands expdp. For only 10 lines of each table, use the query parameter

    Query = "where rownum"<>

    This will apply to all the tables you export.

    I hope this helps.

    Dean

    Published by: Dean WINS January 30, 2012 08:42

  • Problem in the export using the QUERY functionality

    Problem in the export using the QUERY functionality


    I'm trying to export some rows in a table using the query functionality
    and I have some errors... I'm using the syntax is

    system@orcl QUERY = scott.emp expdp: '"WHERE emp_no = 123455" '
    DIRECTORY = data_pump_dir DUMPFILE = data_pump.dmp
    LOGFILE = data_pump_12345.log INDEX = n

    Can someone tell me please the problem with that statement

    I also tried to use the simple export

    exp file system@orcl = orcl_export.dmp log = orcl_export.log
    tables = Scott.EMP index = QUERY = n------"WHERE emp_no\ = 123455\"

    and this error

    EXP-00008: ORACLE error 904
    ORA-00904: identify invalid

    My os is Solaris
    Please let me know what the problem

    Hello

    Try to create parfile and use that, otherwise, you will need to escape each clause correctly to run exp or expdp successfully.

    test.par

    tables=emp
    query="WHERE emp_no=123455"
    
    or
    tables=myobjects
    query="WHERE owner='SYS'"
    
    $> exp username/password parfile=test.par
    
    Export: Release 10.2.0.1.0 - Production on Thu Mar 19 10:17:48 2009
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining Scoring Engine options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    
    About to export specified tables via Conventional Path ...
    . . exporting table                      MYOBJECTS      22650 rows exported
    Export terminated successfully without warnings.
    

    Concerning

    Published by: OrionNet on March 19, 2009 10:21

  • When taking picture with the light in the background with the camera back from my iPhone more than 6 s, there is a clear blue colour square (a bit like a reflection of the light) will appear.

    When taking picture with the light in the background with the camera back from my iPhone more than 6 s, there is a clear blue colour square (a bit like a reflection of the light) will appear.

    someone has an idea of what's going on?

    The blue square is the area of the camera is in point and exposure on.

    Tap on the area actually taking a picture of. For example, if you take a photo of someone int eh the room and the bottom is very light (or dark), tap on the face of the person to turn to that.

    See it-> http://iphonephotographyschool.com/how-to-use-iphones-camera-app/

  • Help with the query

    Hi, can someone help me with the query. I try to display comm based on calculation below

    SAL < 5000 then 10%

    5000 - 10000 then 15%

    > 10000 then 20%

    This is the query

    DECLARE

    v_comm number (7.2);

    v_Name emp.ename%type;

    v_empno emp.empno%type;

    v_sal emp.sal%type;

    BEGIN

    SELECT ename, empno, sal IN

    v_Name, v_empno, v_sal

    EMP;

    v_comm: = (IF v_sal < v_sal*.10 then 5000;)

    ELSIF v_sal between 5001 AND 10000 THEN v_sal*.15;

    Of ANOTHER v_sal > 10001 THEN v_sal*.20;

    END IF ;);

    dbms_output.put_line(v_Name||) e with empno' | v_empno | "win a comm' | v_comm);

    END; /

    also tried

    DECLARE

    v_comm number (7.2);

    v_Name emp.ename%type;

    v_empno emp.empno%type;

    v_sal emp.sal%type;

    BEGIN

    SELECT ename, empno, sal IN

    v_Name, v_empno, v_sal

    EMP;

    IF v_sal < v_comm then 5000: = v_sal*.10;

    ELSIF v_sal between 5001 AND 10000 THEN v_comm: = v_sal*.15;

    Of ANOTHER v_sal > 10001 THEN v_comm: = v_sal*.20;

    END IF ;);

    dbms_output.put_line(v_Name||) e with empno' | v_empno | "win a comm' | v_comm);

    END;

    /

    Hello

    Look at the syntax of the IF in the PL/SQL manual.  Comapre to the instruction BOX and also the expression BOX.

    Perhaps, instead of an IF statement

    v_comm: = (IF v_sal<5000 then="">

    ELSIF v_sal between 5001 AND 10000 THEN v_sal*.15;

    ELSE v_sal > 10001 THEN v_sal*.20;

    END IF ;);

    you wanted to write an expression BOX, like this:

    v_comm: = BOX

    WHEN v_sal< 5000                ="" then="" v_sal="" *="">

    WHEN v_sal BETWEEN 5001 AND 10000 THEN v_sal *.15

    WHEN v_sal > 10001 THEN v_sal *.20

    END;

    Or perhaps cela:

    v_comm: = v_sal * CASE

    WHEN v_sal<=  5000="" then="">

    WHEN v_sal<= 10000="" then="">

    OF AUTRE.20

    END;

    You can also use a CASE expression in the SELECT statement.

  • Help with the query to select only one record from the result set in double

    Hello

    Please help with the query. Version of Oracle database we use is 10g R2.

    I have a vision that is duplicated IDS, but they are used across the different functions. See below examples of data. Please help me with a query to select only one record (based on ID regardless of the area) from the bottom of the result set of duplicate records. For what is the point of view is there unique records, given the combination of the fields ID, Org, DF, dry, Sub-Sec

    ID
    Org
    DF
    Sec Sub-Sec

    (163)CQCPDMCPDMHD(163)PCENGENGENG(163)CQASICASICIS8888TSTACTACTAC(163)TSHEHESW6789CQINFOINFOFOS6789PCSECSYSSECSYSINFO16789TSSECSYSSECSYSINFO29009PCBMSBMSBMS1

    My result set must eliminate the duplicate identifiers regardless of whoever we choose of the result set. (I mean without distinction Org, DF, s, Sub-s). My expected result set should be.

    ID
    DSB

    DF
    SEC
    Sub-Sec
    (163)CQCPDMCPDMHD8888TSTACTACTAC6789CQINFOINFOFOS9009PCBMSBMSBMS1


    Thank you

    Orton

    Hello

    This sounds like a job for ROW_NUMBER:

    WITH got_r_num AS

    (

    SELECT id, DSB, df, s, sub_sec org

    ROW_NUMBER () OVER (PARTITION BY ID.

    ORDER BY org

    ) AS r_num

    OF view_x

    )

    SELECT id, DSB, df, sub_sec s,

    OF got_r_num

    WHERE r_num = 1

    ;

    He is a Top - N query example, where you choose the elements of N (N = 1 in this case) from the top of an ordered list.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) to your sample data and the results desired from these data.  (I know that you said that you were a view selection.  Just for this thread, pretending it is a picture and post simple CREATE TABLE and INSERT statements to simulate your point of view).
    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.  (I didn't quite understand the explanation above.  I don't know why you want to

    ID ORG DF DRY SUB_SEC

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

    1234 CQ DPRK DPRK HD

    and is not

    1234 IS CQ ASIC, ASIC

    or

    TS 1234 IT IT SW

    or

    1234 CQ ASIC ASIC HD

    )
    If you change the query at all, post your modified version.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • The rendering is essential prior to export with the SOUL?

    Hello guys!

    My sequence has red and yellow lines. This means that I have to go to the preview. I don't want to make because I don't know the result in preview (I did the same thing with other projects)

    She must be rendered prior to export with the SOUL or not?

    I don't know, but once I forgot to make the effect of stabilization of deformation and the blue line appeared on my images...

    Hi Yiotal,

    You shouldn't have to make before you export a project either through the integrated version or autonomous of the SOUL.  If you got a blue line in your film, this must be a bug in PP/SOUL.  I got errors, export projects when using the AE projects related, so output bugs exist.

    Rendering is for smooth playback when editing (especially the clips with a red bar.  Any decent system will well with the yellow bars).  Even if you make everything before exporting it, never use make files in the output (i.e. make sure that the "Use Previews" checkbox is disabled).  I did some tests and the quality of the image you get when you work with files of rendering is less.

    I hope this helps!

  • exp using the query parameter

    Hi all
    I need to export a table with the query clause = "" where rownum < 100 ' "
    His works well, but the extraction of all columns.
    But I need only selective columns.

    Is it possible to export the follwing records
    Select some_columns from table where rownum < 100
    how with exp util?

    DB version 10.2.0.4
    AIX OPERATING SYSTEM

    Thank you

    You can not specify columns, only where clause may be specified with exp/expdp.

    generate instructions insert with the help of select instead then.
    Or if you need to import this data into another database - create link db and just do insert by it.

  • I paid for a year with the full creative cloud but can't find p´the program to download

    I paid for a year with the full creative cloud but couldn't findthe program to download

    To start https://helpx.adobe.com/creative-cloud.html the Cloud

    -Installation, update or uninstall and launching after installation

  • need help with the query, thx

    Hello
    I need a little help with the query I have to write;
    the table has 4 columns:
    col1               col2         col3       col4
    emp_name     empl_id    salary      year
    
    content of data:
    
    col1               col2         col3       col4
    smith             12           1200      1999
    smith             12           1340      2000
    smith             12           1500      2001
    jones             13           1550      1999 
    jones             13           1600      2000
    aron              14           1200      2002
    what I am asking is the following result: salary according to the latest available year
    i.e.
    smith         12         1500        2001
    jones         13         1600        2000
    aron          14         1200        2002
    ID appreciate some guidance on how to achieve
    Thank you
    Rgds
    select *from
    (select col1, col2,col3, col4,row_number() over(partition by col1 order by col4 desc)  rn  from 
    ) where rn=1
    
  • Check for multiple users with the value of the UID 0

    Hi gurus,

    The runclufvy.sh gives the warning below can I ignore this or need to fix for the installation of the 11202 RAC on RHEL 5?

    Check for multiple users with the value of the UID 0
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa6".
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa2".

    Thank you

    Hello

    The runclufvy.sh gives the warning below can I ignore this or need to fix for the installation of the 11202 RAC on RHEL 5?

    Check for multiple users with the value of the UID 0
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa6".
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa2".

    User jnftsi0 cannot be used by the Oracle Installer or start the Oracle process, because what is the root group.

    If the user jnftsi0 is used by Oracle install or start Oracle process should then be removed from the root group, otherwise you can ignore it.

    Kind regards
    Levi pereira

  • Error exporting Oracle on the QUERY parameter

    Hi all

    I would like to ask for help.

    This is my environment:
    OS: Linux 5.4 32-bit
    DB: Oracle 10.2.0.4

    Here's what I would do:
    Export the selected lines of SH. Table SALES using the query:

    SQL > select * from sh.sales
    where to_date(time_id,'DD-MON-RR:HH24:MI:SS') = to_date('28-DEC-01:00:00:00','DD-MON-RR:HH24:MI:SS');

    My parfile is:

    UserID = ' oracle/sys as sysdba'
    buffer = 10000000
    file = mysales148.dmp
    Journal = mysales148.log
    TABLES is sh. MySales
    Query = "(où to_date(time_id,\'DD\-MON\-RR:HH24:MI:SS\')=\to_date(\'28\-DEC\-01:00:00:00\',\'DD\-MON\-RR:HH24:MI:SS\')" "
    RecordLength = 65535
    Statistics = none


    When I run the script, I get this error:

    [oracle@shaoran selective_export] $ exp parfile = exp_mysale.par

    Export: Release 10.2.0.1.0 - Production the game 3 Feb 16:57:08 2011

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With partitioning, OLAP and Data Mining options
    Export in US7ASCII and AL16UTF16 NCHAR character set
    Server uses WE8ISO8859P1 (possible character set conversion) character set

    About to export specified tables by conventional means...
    Current user has changed to SH
    . . MYSALES table export
    EXP-00056: ORACLE 911 error encountered
    ORA-00911: invalid character
    Export completed successfully with warnings.


    Hope to hear from you soon.

    Thank you very much!

    First of all,

    export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
    

    It is probably the cause of your problem if you have unusual characters in your data.

    If this isn't the case, you do not have these "------" in your QUERY. Since you're using parfile, just go with what you would do in sqlplus:

    query="where time_id=to_date('28-DEC-01:00:00:00','DD-MON-RR:HH24:MI:SS')"
    
  • Export DataPump with the query option

    Hi all

    My environment is IBM AIX, Oracle 10.2.0.4.0 database.

    I need a few sets of records using a query in export production. Request is attached to several tables. Since we have the BLOB data type, we export using datapump.

    We have weaker environments, but have not the same set of data and tables, and therefore not able to simulate the same query in lower environment. But created a small table and faked the query.

    My order is

    expdp system / < pwd > @orcl tables = dump.dump1 query = dump.dump1:' ' where num < 3 ' ' directory = DATA_PUMP_DIR dumpfile = exp_dp.dmp logfile = exp_dp.log

    Query in the command pulls two records directly. By running the command above, I see the size 80KO dump file,
    In the export log file.

    I see Total estimation using BLOCKS method: 64 KB.
    export Dump.Dump1 = 4,921 KB 2 rows.

    My doubts are,
    (1) is the correct command that I am running.
    (2) estimate said 64 k, considering that it says also exported 4,921 KB. But the dump file created is 80KO. It is exported correctly?
    (3) given that I run with the use of the system, apart from 2 rows, export all data. We must send the dump file to the other Department. We should not export all of the data other than the query output.
    (4) in the order if I am not using "tables = dump.dump1), the export file big mess." Don't know which is the right.

    Your answers will be more useful.

    The short answer is 'YES', he did the right thing.

    The long answer is:

    Query in the command pulls two records directly. By running the command above, I see the size 80KO dump file,
    In the export log file.

    I see Total estimation using BLOCKS method: 64 KB.
    export Dump.Dump1 = 4,921 KB 2 rows.

    My doubts are,
    (1) is the correct command that I am running.

    Yes. As long as you query is correct. DataPump will export on the lines that match this query.

    (2) estimate said 64 k, considering that it says also exported 4,921 KB. But the dump file created is 80KO. It is exported correctly?

    Estimate is made using the full picture. Since you specify, he used the method of estimation of block. Basically, how many blocks have been attributed to this table. In your case, I guess it was 80KB.

    (3) given that I run with the use of the system, apart from 2 rows, export all data. We need to send the dump file to other > Department. We should not export all of the data other than the query output.

    I will export all the data, but going to export metadata. It exports the table definition, all indexes on it, all the statistics on tables or indexes, etc. This is why the dump file could be bigger. There is also a 'main' table that describes the export job who gets exproted. This is used by export and import to find what is in the dumpfile, and where in the dumpfile these things are. It is not user data. This table needs to be exported and will take place in the dumpfile.

    (4) in the order if I am not using "tables = dump.dump1), the export file big mess." Don't know which is the right.

    If you only want this table, then you order export is right. If you want to export more, then you need to change your export command. From what you say, it seems that you order is correct.

    If you do not want any expoirted metadata, you can add:

    content = data_only

    at the command line. This will only export the data and when the dumpfile is imported, it must have the table already created.

    Dean

Maybe you are looking for

  • Make a ringtone on new iTunes - Help!

    I'm doing a song I recently bought into a ringtone for my iPhone 6 s, and each unique tutorial directs turn you into an AAC file, but with the new iTunes, when you right click on the song there no option to turn it into an AAC file. In fact, when I c

  • I can't buy all the apps from the App Store

    I can't buy all the apps from the App Store. Every time I try, I get a message saying required verification and the update, billing information. I changed my I cloud of password yesterday and it checked and my billing information are up to date. I do

  • IdeaPad Z560 without web. Thoughts?

    I am using my new * no intention Z560 as a media and remaining out of the net completely. I've not used a windows machine in about a year... I have a MacBook Pro and a MacMini and I'm very happy Windows for free! I thought that if I need to download

  • Windows 7 - Error Codes: 80072F8F & 0 x 80248014 (cannot install updates)

    Operating system: Win7 HomePremium 64 bit A few weeks ago, windows update could not connect it out of error 80072F8F Code, it can not make contact with the server. At the same time Microsoft Security Essentials also not able to get up-to-date send me

  • Stuck in a loop trying to reinstall Windows Vista

    Original title: computer turns off in the middle of the reinstallation of windows... Now, what gives the "Windows cannot complete the installation in Mode safe. To continue installing Windows, restart the computer "message. It is, when I restart it g