How to fetch records between two seq uence numbers?

We have thousands of records with seq uence numbers in the oracle database, we need to retrieve a number of records between two seq uence numbers, i.e. to retrieve records between 100 and 200 seq uence numbers. Could some one help me to find a query to fetch records.
I'll be waiting for your response..
Edited by: sumant on Jul 27, 2010 12:42 PM

Is this is what you are looking for?
SQL> create table tab1 (id number);
Table created.
SQL> insert into tab1 values (1);
1 row created.
SQL> insert into tab1 values (2);
1 row created.
SQL> insert into tab1 values (3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from tab1;
        ID
         1
         2
         3
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
  2  from tab1;
RANDOM_NUMBER
           43
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
  2  from tab1;
RANDOM_NUMBER
           39
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
  2  from tab1;
RANDOM_NUMBER
           13 This will generate a random number that will be greater then the maximum value in the table and lower then the maxvalue + 50. Having the range starting from maxvalue in the table you will never get a number generated which already exists in the table.
As you see in the above number genrated they are all between 4 and 53.
If you want to increase the range from where the number are generated just increase the value 50 that I used in the query.

Similar Messages

  • How to fetch records with two recordset

    i want fetch records from the table using two recordset like
    ResultSet r1=stmt.executeQuery("select * from pf_data");
    i want to take another recodeset
    ResultSet r2=stmt.executeQuery("select * from finyr");
    I am using Microsoft SQL server as my database.
    I am also closing the recordset like r1.close();
    then i cannot take two recordset at the same time.

    Hi,
    This is an example of a Top-N problem, and here's one way to do it:
    WITH got_r_num AS
        SELECT  item_id, supp_id, rnk                         -- RANK is not a good column name
        ,       DENSE_RANK () OVER ( PARTITION BY  item_id    -- Just guessing
                                     ORDER BY      rnk
                                   )  AS r_num
        FROM    table_x
        WHERE   item_id  = 2      -- If desired
    SELECT    item_id, supp_id. rnk
    FROM      got_r_num
    WHERE     r_num    <= 2
    RANK is the name of a built-in function in Oracle, so it will cause lots of trouble if you use it as a column name.  (The RANK function is closely related to DENSE_RANK, used above.)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places.  If you changed the query at all, post your code.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Oracle-java How to fetch data between two Timestamps

    hai...
    I am using a program where i have to get all the data entered into oracle db between two dates
    (The first date being manually inputted and the second one is inputdate-24hrs) . The code is as follows....
    Connection c = null;
    PreparedStatement pStmt = null;
    ResultSet rs = null;
    try
    //eg  String dt=14/03/2007, hr=03, min=27, ampm=am
         DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
         DateFormat outForm = new SimpleDateFormat("yyyy/MM/dd");
         Calendar cl = Calendar.getInstance();
         Date inDate = new Date();
         inDate = dateFormat.parse(dt);
         cl.setTimeInMillis(inDate.getTime());
         cl.add(Calendar.DAY_OF_MONTH, -1);
         String str1 = outForm.format(new Date(cl.getTimeInMillis()));
         String str2 = outForm.format(dateFormat.parse(dt));
         System.out.println("Changed date = "+str1);
         System.out.println("Original date = "+str2);
         String toStr = str2+" "+hr+":"+min+" "+ampm.toUpperCase();
         String fromStr = str1+" "+hr+":"+min+" "+ampm.toUpperCase();
         System.out.println("From date = "+fromStr);
         System.out.println("To date = "+toStr);
    // For example, if u r confused, From date = 2007/03/14 03:27 AM
    //                            To date = 2007/03/13 03:27 AM
         String sql = "SELECT TRANS_ID, TO_CHAR(CONCAT('Rs.',TRANS_VALUE)) AS TRANS_VALUE, " +
                   "TO_CHAR(TRANS_DATE,'DD/MM/YYYY HH:MM AM') AS TRANS_DATE, ACCOUNT_ID,  " +
                   "TO_CHAR(CREATED_DATE,'DD/MM/YYYY HH:MM AM') AS CREATED_DATE, CREATED_BY, " +
                   "INSTR_D_BANK_CD FROM TRANS_TB WHERE " +
                   "ACCOUNT_ID=? AND TO_CHAR(TRANS_DATE,'YYYY/MM/DD HH:MM AM') " +
                   "BETWEEN ? AND ? ;
         c=ds.getConnection();
         pStmt = c.prepareStatement(sql);
         pStmt.setString(1, accountId);
         pStmt.setString(2, fromStr);
         pStmt.setString(3, toStr);               
         rs = pStmt.executeQuery();     
    }The problem is that i am not getting results as expected
    Can anyone point out if there is something wrong in the logic or in the program....

    But how to make that string to the Timestamp object.
    I tried this way but failed !!!
    // Eg :fromStr = 2007/03/14 03:27 AM
    //       toStr= 2007/03/13 03:27 AM
         SimpleDateFormat sdfOutput = new SimpleDateFormat("yyyy/MM/dd hh:mm a");
         Date fromDate = sdfOutput.parse(fromStr);
         Date toDate = sdfOutput.parse(toStr);
    SELECT TRANS_ID, TO_CHAR(CONCAT('Rs.',TRANS_VALUE)) AS TRANS_VALUE, " +
                   "TO_CHAR(TRANS_DATE,'DD/MM/YYYY HH:MM AM') AS TRANS_DATE, ACCOUNT_ID,  " +
                   "TO_CHAR(CREATED_DATE,'DD/MM/YYYY HH:MM AM') AS CREATED_DATE, CREATED_BY, " +
                   "INSTR_D_BANK_CD FROM TRANS_TB WHERE " +
                   "ACCOUNT_ID=? AND TRANS_DATE BETWEEN ? AND ? ;
    //Eg TRANS_DATE = "11-MAR-07 12.30.59.729000000 PM"(Timestamp)
    c=ds.getConnection();
         pStmt = c.prepareStatement(sql);
         pStmt.setString(1, accountId);
         pStmt.setString(2, fromDate);
         pStmt.setString(3, toDate);               
         rs = pStmt.executeQuery();     
         I think there is problem in both String-Date conversion and in the query.....

  • How to fetch values between two days of a month

    Hi,
    I have fetch the values which are greater inserted on or after of 16th day of one and any month.
    I am trying with following query for a month of dec :
    select *
    from tablename
    where SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) >= '16-Dec'
    and SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) < '31-Dec'
    but its not giving me the desired result.
    I have to pick the resultset of everyyear.
    Please help me in this matter.

    Thanks a lot guys!!
    My problem is solved.That's good news, but be aware that the solutions presented are not all good:
    SQL> select * from tablename order by colname
      2  /
    COLNAME
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    02-01-2006 11:03:12
    13-11-2006 11:03:12
    13-12-2006 11:03:12
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    9 rijen zijn geselecteerd.
    SQL> select colname
      2    from tablename
      3   where to_date(to_char(colname,'ddmm') || '2006','ddmmyyyy')
      4         between to_date('16122006','ddmmyyyy')
      5             and to_date('01012007','ddmmyyyy') - 1/24/60/60
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Mohana's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON') >= '16-DEC'
      4  and TO_CHAR(colname, 'DD-MON') < '31-DEC'
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    5 rijen zijn geselecteerd.
    SQL> remark user503699's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'MON') = 'DEC'
      4  and ( TO_NUMBER(TO_CHAR(colname, 'DD')) >= 16
      5  and TO_NUMBER(TO_CHAR(colname, 'DD')) <= 31 )
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Rup's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON-yyyy') >= to_date('16-DEC','dd-mon')
      4  and TO_CHAR(colname, 'DD-MON-yyyy') < to_date('31-DEC','dd-MON')
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    3 rijen zijn geselecteerd.So use user503699's solution or mine ;-)
    Hope this helps.
    Regards,
    Rob.

  • How to append records between two internal tables

    hi all,
    im trying to append from an internal table to another internal table with same structure. i tried the following but it overwrites previous contents of i_dest:
    move i_src to i_dest
    thanks,
    sid

    hey u try to move it record by record
    <b>itab2 = itab.
    append itab2.</b>
    This should work I guess
    just check the code below, if u want to move the whole itab into itab2 then use <b>itab2[] = itab.</b>
    <b>loop at it_pgm.
      read table itab with key obj_name = it_pgm-pgm_name.
      if sy-subrc = 0.
        itab_final-obj_name = itab-obj_name.
        itab_final-func_spec = itab-func_spec.
        itab_final-func_area = itab-func_area.
        itab_final-dev_class = itab-dev_class.
        append itab_final.
    else.
       itab_alt-pgm_name = it_pgm-pgm_name.
       append itab_alt.
      endif.</b>
    please reward points if found helpful

  • Count the number of records between two key values (BTREE)

    How can I count the number of keys between two values?
    I'm using python driver, and BTREE access method.
    ====>
    ideally what I want is to average a whole time-series data set (the intervals can change) to a given number of points. The keys are the time stamps and the values are the data that needs to be averaged. I need to count the number of records between two time stamps so that I can divide that number by the number of points i need, and average the data. What is the best way to do this?  Or should I just keep the intervals for the time stamp constant and use RECNO access method?
    Thank you
    (first post btw.. and why aren't there many people in stackoverflow who answer Berkeley DB questions?)

    BDB is an embedded db and it does not have any internal counters or statistics that you could grap to use for this.    You will need to do it manually.
    You can create a cursor, grap the records you want, each time you get the next record you bump a counter.
    If you are using RECNO, you can use a cursor to get the record number of the record (DB_GET_RECNO), and if all you data is in
    sequentail records with no missing records you can figure out the total count by take last rec # - initial rec # + 1 to get a total count.
    If you switch over to the SQL API, you can issue a SQL query to give you a count.  Select count(*) Where .......
    Since you have to grab the data anyway, then best may be to count records as you go along.
    thanks
    mike

  • How to pass parameters between two xterm windows?

    Hi,
    I would like to know how to pass parameters between two xterm windows where there are two independence processes running on them respectively ? Would appreciate if any one out there can advise me . Thanks.

    Global variables can be used, but you can do what the online help
    says ...
    Parameters are passed to called forms by means of a parameter
    list. A parameter list is a named programmatic construct that is
    simply a list of parameter names (called keys) and their values.
    You can pass parameter values to forms invoked by the built-in
    subprograms CALL_FORM, OPEN_FORM, and NEW_FORM. In addition, you
    can pass parameter values to other Oracle tools with the
    RUN_PRODUCT procedure.
    A parameter you include in a parameter list can be either a text
    parameter or a data parameter. The parameter type determines how
    its value is interpreted.
    Text Parameters The value of a text parameter being passed to a
    called product is a CHAR string that can represent the following:
    n a user-defined form parameter defined in a form invoked
    by the CALL_FORM, OPEN_FORM, or NEW_FORM built-in subprograms
    n a command line or user-defined parameter for a product
    invoked with the RUN_PRODUCT built-in subprogram
    Data Parameters The value of a data parameter being passed to a
    called product is always the name of a record group defined in
    the current form. (A record group is a data structure that
    stores records derived from a query or through programmatic
    assignment.) Data parameters are used to pass data to products
    invoked with the RUN_PRODUCT built-in subprogram. You cannot
    pass data parameters to forms.
    The following table shows the structure of a parameter list that
    contains four parameters:
    Key Paramtype Value
    CITY Text_Parameter 'BOGOTA'
    CATEGORY Text_Parameter 'EXPORTS'
    MULTIPLIER Text_Parameter '.0275'
    NEW_DATA Data_Parameter 'RECORD_GROUP8'
    arun reddy (guest) wrote:
    : im trying to do this but i could not find any way for this.
    : can any one help me how can i pass parameters between two forms
    : in forms4.5. any help will be appreciated
    : thanks.
    null

  • How to get relationship between two  views in the  reports

    How to get relationship between two  views in the  reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports

    Hi,
    Please explain your question in detail...what do you want to read ?
    If you want to know about the navigation links between the views then you can use APIs  like
    wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
    Iterate through the navigationLinkInfo from above collection and can read the other properties .
    I haven't tried the above , but it should work !!!
    Regards,Anilkumar

  • How can we navigate between two windows of same component in webdynpro ABAP

    Hi
    how can we navigate between two windows( not views ) of same component in webdynpro ABAP. its an urgent requirement
    Thanks in advance.
    Regards
    Laeeq

    Hi Laeeq,
    You cannot navigate between windows of one component. You can only call a dialog box showing the contents of a second window, or you can embed the contents of a window of a different component.
    Just add all the views you need to the one and only main window of the component.
    Ciao, Regina

  • In jsp file, how to transfer parameter between two javabean?

    In jsp file, how to transfer parameter between two javabean?
    for example
    Bean1 has a attribute A
    Bean2 has a attribute B
    how to transfer the value of A to B

    Have you tried something like...
    <jsp:setProperty name="Bean2" property="B" value="<jsp:getProperty name="Bean1" property="A" />" />

  • How to get space between two values in a single cell of a table.

    hello,
            how to get space between two values in a single cell of a table.
    thanks a lot.
    kailash.

    sorry i got the answer.

  • How to make search between two dates accept null not obligatory search proplem

    Hi guys when i search record between two dates it works ok success but you must enter date from and dateto first to  to make search
    i will show what i need from this example
    I need to search dynamic by 4 textbox
    1-datefrom
    2-dateto
    3-EmployeeNo
    4-EmployeeName
    but search i need must be dynamic meaning
    if i enter employee no only give me employee no found in database
    if i enter employee name give me employees found with this name using like
    if i enter all 4 text box null and enter button search get all data
    but i have proplem in this query when i need to search by click search button
    i must write date from and date to firstly then write employee no or employee name if i need to search
    so that i need to search by employee no alone or employee name alone without using date from and date to
    And if i search without using datefrom and dateto it give me message error 'string wasnot recognized as valid datetime"
    my stored procedure and code as following :
    ALTER proc [dbo].[CollectsearchData]
    @StartDate datetime,
    @EndDate datetime,
    @EmployeeID  NVARCHAR(50),
    @EmployeeName  nvarchar(50)
    as
    Begin
    Declare @SQLQuery as nvarchar(2000)
    SET @SQLQuery ='SELECT * from ViewEmployeeTest Where (1=1)'
    If (@StartDate is not NULL)
    Set @SQLQuery = @SQLQuery + ' And (joindate >= '''+ Cast(@StartDate as varchar(100))+''')'
    If (@EndDate is not NULL)
    Set @SQLQuery = @SQLQuery + ' And (joindate <= '''+ Cast(@EndDate as varchar(100))+''')' 
    If @EmployeeID <>''
    Set @SQLQuery = @SQLQuery + 'And (EmployeeID = '+ @EmployeeID+') '
    If @EmployeeName Is Not Null
    Set @SQLQuery = @SQLQuery + ' AND (DriverName LIKE
    ''%'+@EmployeeName+'%'') '
    Print @sqlQuery
    Exec (@SQLQuery) 
    End
    Function using
    public DataTable SearchDataA(string ConnectionString,string EmployeeNo,string EmployeeName, DateTime StartDate, DateTime EndDate)
    SqlConnection con = new SqlConnection(ConnectionString);
    SqlCommand cmd = new SqlCommand();
    cmd.Connection = con;
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = "CollectsearchData";//work
    cmd.Parameters.Add("@StartDate", SqlDbType.DateTime);
    cmd.Parameters.Add("@EndDate", SqlDbType.DateTime);
    cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar, 50);
    cmd.Parameters.Add("@EmployeeName", SqlDbType.NVarChar, 50);
    cmd.Parameters["@StartDate"].Value = StartDate;
    cmd.Parameters["@EndDate"].Value = EndDate;
    cmd.Parameters["@EmployeeID"].Value = EmployeeNo;
    cmd.Parameters["@EmployeeName"].Value = EmployeeName;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    DataSet ds = new DataSet();
    da.Fill(ds);
    DataTable dt = ds.Tables[0];
    return dt;
    interface button search
     try
    CultureInfo ukCulture = new CultureInfo("en-GB");             
    FleetManagment.Fleet fleet = new FleetManagment.Fleet();
    DataTable Table = fleet.SearchDataA("Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "",textBox3.Text,textBox4.Text, DateTime.Parse(textBox1.Text,
    ukCulture.DateTimeFormat), Convert.ToDateTime(textBox2.Text, ukCulture.DateTimeFormat));
    dataGridView1.DataSource = Table;
    dataGridView1.Refresh();
    catch (Exception ex)
    MessageBox.Show(ex + "error");

    Yes, the below code should not be passed any value: (I am not sure of the syntax in .NET,Sorry) 
    --If startdate len is 0 - do not assign this value
    cmd.Parameters["@StartDate"].Value = StartDate;
    --If endate len is 0 - do not assign this value
    cmd.Parameters["@EndDate"].Value = EndDate;

  • How to caluclate tat between two dates of one timestamp field

    Hi,
    could some one help how to caluclate days between two dates of single timestamp filed and with this
    query
    Select * from m_activity_transaction where actn_opp_id in (
    Select actn_opp_id from m_activity_transaction where ACTN_ACTV_ID = 218
    Group by actn_opp_id
    having count(*) > 1 ) and ACTN_ACTV_ID = 218
    order by actn_performed_on
    iam getting output is
    ACTN_ID ACTN_OPP_ID ACTN_PERFORMED_ON
    319415 95831 27-JAN-12 11.06.20.000000 AM
    315249 95831 08-FEB-12 05.32.54.000000 PM
    301927 103509 20-DEC-11 04.01.43.000000 PM
    301458 103509 19-DEC-11 04.51.03.000000 PM
    294841 115840 10-JAN-12 03.20.12.000000 PM
    312062 115840 11-JAN-12 05.17.06.000000 PM
    and i nedd to caluclate no.of days between two dates like 27-JAN-12 11.06.20.000000 AM and 08-FEB-12 05.32.54.000000 PM where actn_id is unique AND ACTN_OPP_ID IS NOT UNIQUE.
    Thanks in Advance,
    vvr.

    This way?
    with data as
    select 315249 a, 95831 b, to_timestamp('27-JAN-12 11.06.20.000000 AM', 'DD-MON-RR HH.MI.SS.FF6 AM') dt from dual union all
    select 319415, 95831, to_timestamp('08-FEB-12 05.32.54.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
    select 301927, 103509 , to_timestamp('20-DEC-11 04.51.03.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
    select 301458 , 103509 , to_timestamp('19-DEC-11 04.01.43.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
    select 363810 , 144656 , to_timestamp('27-JUN-12 12.43.28.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
    select 363500 , 144656 , to_timestamp('26-JUN-12 11.41.50.000000 AM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual union all
    select 363354 , 144656 , to_timestamp('25-JUN-12 12.41.13.000000 PM', 'DD-MON-RR HH.MI.SS.FF6 AM') from dual
    select a, b, diff
      from (
            select a, b, extract( day from (dt - lag(dt) over (partition by b order by dt, a)) ) diff
              from data
           ) tab
    where tab.diff is not null;
    A                      B                      DIFF                  
    319415                 95831                  12                    
    301927                 103509                 1                     
    363500                 144656                 0                     
    363810                 144656                 1

  • How to check similarity between two Databases 9i & 10g after imp in 10g

    Dear all,
    Source
    =======
    OS server     ==>     HP-UX
    Oracle version     ==>     Oracle 9.2.0.8
    DB Name          ==>     MSST
    DB total users     ==>     320
    Full export in     ==>     /u02/export/Jan09.dmp
    Tablespaces     ==>     SC, SC_I, SA, SA_I, PP, PP_I, AC, AC_I, SD
    Destination
    ============
    OS server          ==>     HP-UX
    DB Name               ==>     CHDB
    Existg DB users          ==>     20
    Oracle version          ==>     Oracle 10.2.0.4
    copied 9i dump file in     ==>     /u03/export
    Tablespaces created same as Oracle 9i i.e;          
    Tablespaces     ==>     SC, SC_I, SA, SA_I, PP, PP_I, AC, AC_I, SD
    I had run full import on Destination server i.e; Oracle 10g & following is the command i used:
    imp system/pwd@conn_string file=/u03/export/Jan09.dmp log=/u03/export/Jan09_imp.log full=y ignore=y statistics=none
    *=== Imported successfully with few errors like ====*
    IMP-00017: following statement failed with ORACLE error 2299:
    "ALTER TABLE "EMP_PROMOTIONS_ORD" ADD CONSTRAINT "EMP_PROMOTIONS_ORD_UK" UN"
    "IQUE ("EMP_NO", "RANK_NO_FOLLOW") USING INDEX PCTFREE 10 INITRANS 2 MAXTRAN"
    "S 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "PP" "
    "LOGGING ENABLE "
    IMP-00003: ORACLE error 2299 encountered
    ORA-02299: cannot validate (PP.EMP_PROMOTIONS_ORD_UK) - duplicate keys found
    ORA-02299: cannot validate (PP.EMP_PROMOTIONS_ORD_UK) - duplicate keys found
    . . importing table "EMP_PROMOTION_DETAILS" 13333 rows imported
    . . importing table "EMP_PROMOTION_MAST" 725 rows imported
    . . importing table "EMP_PUNISHMENT" 271 rows imported
    . . importing table "EMP_REPORT_BOOKS" 60528 rows imported
    . . importing table "EMP_SALARY_HISTORIES" 120871 rows imported
    . . importing table "EMP_SALARY_HISTORIES_TEMP" 77044 rows imported
    . . importing table "EMP_TRANSACTIONS" 96536 rows imported
    IMP-00017: following statement failed with ORACLE error 2299:
    "ALTER TABLE "EMP_TRANSACTIONS" ADD CONSTRAINT "TRANS_UK" UNIQUE ("EMP_NO","
    " "DIR_NO", "DIR_DATE", "TRN_CODE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRA"
    "NS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "PP_"
    "I" NOLOGGING ENABLE "
    IMP-00003: ORACLE error 2299 encountered
    ORA-02299: cannot validate (PP.TRANS_UK) - duplicate keys found
    Now my question is
    ===================
    How to check everything is same/similar like Oracle 9i database ( source ), for example ( i used this technique ):
    Can anyone tell me how to check similarity between two Databases 9i & 10g after import in 10g.
    MSST_DB>SHOW USER
    MSST_DB>SA
    MSST_DB>select object_type, count(*) from user_objects group by objects;
    OBJECT_TYPE     COUNT(*)
    DATABASE LINK     2
    FUNCTION     23
    INDEX          1795
    LOB          6
    PACKAGE          8
    PACKAGE BODY     8
    PROCEDURE     30
    SEQUENCE     67
    SYNONYM          60
    TABLE          644
    TRIGGER          3
    VIEW          20
    CHDB_DB>SHOW USER
    CHDB_DB>SA
    CHDB_DB>select object_type, count(*) from user_objects group by objects;
    OBJECT_TYPE     COUNT(*)
    INDEX          1794
    PROCEDURE     30
    TABLE          644
    TRIGGER          3
    VIEW          20
    FUNCTION     23
    SYNONYM          60
    PACKAGE BODY     8
    SEQUENCE     67
    PACKAGE          8
    LOB          6
    Edited by: VIKHARAHMED on Jan 10, 2012 3:02 AM

    [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_export.htm#sthref67]Guide.

  • How to check relation between two tables in same database

    How to check relation between two tables in same database using Oracle SQL developer. Version 2.1.1.64

    Hi,
    Try this,
    SELECT   cons.owner AS child_owner, cons.table_name AS child_table,
             cons.constraint_name constaint_name,
             cons.constraint_type constraint_type, col.owner parent_owner,
             col.table_name parent_table, col.column_name column_name
        FROM dba_cons_columns col, dba_constraints cons
       WHERE cons.r_owner = col.owner
         AND cons.r_constraint_name = col.constraint_name
         AND col.owner = 'MY_USER'
    ORDER BY child_table;Thanks,
    Shankar

Maybe you are looking for

  • Logic 9.1.6 32bit crash when pressing play

    Hey, I have recently switched back to 32bit mode as Peavey Revalver mkIII.V has only 32bit AUs and the 32bit AU bridge constantly crashed. Anyhow, whenever I press play in 32bit mode I get the spinning beach ball or a CTD. The plugins I use are: Peav

  • Sample WebDynpro for Java for BAPI error

    Hi, I have created one BAPI which will take matnr as an input and gives table of matnr, maktx. This BAPI i have used (through Adaptive RFC) to create sample WebDynpro Application (JAVA) through NWDS. I have deployed it and tried to run it, but it fai

  • Rounding off to nearest value with formatNumber

    Can I use the formatNumber tag to round my numeric value to the nearest value? Like if it's 15.7 I would like to display 16 And if it's 15.2, I would like to display 15 I could successfully truncate by giving a patteren but Im not sure if I can round

  • Where can I find a version of windows 7 home premium to download?

    I am trying to locate a copy of windows 7 home premium that I can download to run on my new iMac.  Google has netted me nothing.  Any other ideas? Thanks!

  • Call Oracle Forms 11 from ADF

    Hi, I search for a example/source/demo for calling an Oracle Forms 11 "page" from an ADF (ADF Faces -> *.jspx) page. I use Jdeveloper "Bulldog" with ADF BC and ADF Faces. I need the option to start an oracle forms application (which would build with