Generate a Number for a already existing table with records

Hi All,
Is it possible to generate number for a column in a table. The table already has 50,000 records. I have a empty column in which I want to generate number sequentially for reference purpose......
Whether it can be done ?????
I was thinking og Merge/ rownum I didnt get any possibls solution out of it .........any suggestions....
Thanks
Ananda

I have a empty column in which I want to generate number sequentially for reference purposeThe following table content :
Oracle
DB2
MSSQLNow, you have to put a kind of ID, but what row will get the 1st ? What row will get the 2nd ? etc.
If you don't care, then sequence as suggested is your friend. Then, you could use also sequence for further insert.
Nicolas.

Similar Messages

  • How add primary key constraint to already existing table with data

    I want apply primary key constraint to already existing table with data
    is there any command or way to do

    Alternatively, assuming you want to ensure uniqueness in your primary key column you can do this:
    alter table <table name> add constraint <cons name> primary key (col1,col2) exceptions into <exception_table>
    If the altter table statement fails this will populate the EXCEPTIONS table with the rows that contain duplicate values for (col1,col2).
    You will need to run (or get a DBA to run) a script called UTLEXCPT.SQL (which will be in the $ORACLE_HOME/rdbms/admin directory) if you don't already have an EXCEPTIONS table.
    Cheers, APC

  • Generate xml using FOR XML PATH from table with hierarchy

    I need to create xml from a table like:
    EL1 EL2 EL3 Attr01 Attr02 Attr03 Attr04
    E10,    ,    ,a,b,c,d
    E10,E1010,    ,a,b,c,d
    E10,E1010,E101010,a,b,c,d
    E10,E1010,E101020,a,b,c,d
    E10,E1010,E101030,a,b,c,d
    E10,E1020,    ,a,b,c,d
    E10,E1020,E102010,a,b,c,d
    E20,    ,    ,a,b,c,d
    E20,E2010,    ,a,b,c,d
    E20,E2010,E201010,a,b,c,d
    E20,E2020,    ,a,b,c,d
    E20,E2020,E202010,a,b,c,d
    E20,E2020,E202020,a,b,c,d
    The hierarchy is EL1--EL2--EL3, and the 3 columns should be elements of xml;
    The other for columns Attr01,Attr02,Attr03,Attr04 should be attributes of xml;
    The actual table could have more than 500 rows(there are many values for El1,EL2,and EL3). 
    The expected xml should like:
    <root>
      <E10 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E1010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E101010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101030 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1010>
        <E1020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E102010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1020>
      </E10>
      <E20 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E2010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E201010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2010>
        <E2020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E202010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E202020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2020>
      </E20>
    </root>
    I create a sample Src table:
    CREATE TABLE Src
    EL1 VARCHAR(10),
    EL2 VARCHAR(10),
    EL3 VARCHAR(10),
    Attr01 VARCHAR(10),
    Attr02 VARCHAR(10),
    Attr03 VARCHAR(10),
    Attr04 VARCHAR(10)
    GO
    INSERT INTO Src
    (EL1,EL2,EL3,Attr01,Attr02,Attr03,Attr04
     SELECT 'E10','','','a','b','c','d'
     UNION SELECT 'E10','E1010','','a','b','c','d'
     UNION SELECT 'E10','E1010','E101010','a','b','c','d'
     UNION SELECT 'E10','E1010','E101020','a','b','c','d'
     UNION SELECT 'E10','E1010','E101030','a','b','c','d'
     UNION SELECT 'E10','E1020','','a','b','c','d'
     UNION SELECT 'E10','E1020','E102010','a','b','c','d'
     UNION SELECT 'E20','','','a','b','c','d'
     UNION SELECT 'E20','E2010','','a','b','c','d'
     UNION SELECT 'E20','E2010','E201010','a','b','c','d'
     UNION SELECT 'E20','E2020','','a','b','c','d'
     UNION SELECT 'E20','E2020','E202010','a','b','c','d'
     UNION SELECT 'E20','E2020','E202020','a','b','c','d'
    GO
    I tried to use FOR XML PATH to generate xml for the sample data. When the records increase to a few hundreds, it's not a good idea.
    Here is my script:
    SELECT
    (SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101010'
    FOR XML PATH('E101010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101020'
    FOR XML PATH('E101020'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101030'
    FOR XML PATH('E101030'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1010'),TYPE
    ) AS 'node()'--1010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E102010'
    FOR XML PATH('E102010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1020'),TYPE
    ) AS 'node()'--1020
    FROM Src
    WHERE EL1 = 'E10' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E10'),TYPE) 'node()'
    ,(SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E201010'
    FOR XML PATH('E201010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2010'),TYPE
    ) AS 'node()'--2010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202010'
    FOR XML PATH('E202010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202020'
    FOR XML PATH('E202020'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2020'),TYPE
    FROM Src
    WHERE EL1 = 'E20' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E20'),TYPE) AS 'node()'
    FOR XML PATH(''),ROOT('root')
    If I get a few hundreds of rows, how huge the script should be. Does anyone have better solution for this? Thanks.
    Tao

    wBob,
    Thanks! And sorry for late feedback.
    The XSD requires the xml structures like the following
    <Schools>
    <School01>Some school</School01>
    <School02>Some other school</School02>
    </Schools>
    I have to use the number in the element name. 
    Right now I just use the nested FOR XML PATH, although I have to write thousand lines code.
    Thanks anyway.
    Tao
    Tao

  • Mess SR 053 - Creation not possible (Mapping for product already exist..

    There is an error ocurring when the CIF is executed, this message I can see in the transaction SMQ1, the error " SR 053 - Creation not possible (Mapping for <product> already exists <product> ", the product really exists in APO but I don't know why this error occur because in this case the material should be updated. Anyone know why this error occur ?? and how can I fix ??
      When I try to execute only this material in CFM2 no errors occur.
      Regards,
    Edson Suzuki

    We did faced a similar problem. The reason was the external material number was different in both cases.
        ie the already existing record has the external material number padded with '0000' and the one coming doesn't have leading '0000'
    If this suggestion helps you, please reward by points..
    Shibu

  • How to generate BP number for the employee (ECC to CRM) ...

    Hi all,
    can any one give solution for ,how to generate BP number for the employee from ECC to CRM other than active status,as i downloaded employee data from ECC to CRM through ALE/IDOC,as only active employment status employees are got BP number generated,remaining also transfered to CRM but BP number is not generated for those employees,these employee records i can able to see in the HRP5580- HRP5587 tables.
    thanks in advance.
    vamshi.
    Message was edited by:
            vamshidher rao

    Hi,
    Or are you looking for this:
    SELECT serial_number, paaf.assignment_number
    FROM pay_assignment_actions paa, per_all_assignments_f paaf
    WHERE action_status = 'C'
    AND paaf.assignment_id = paa.assignment_id
    AND serial_number IS NOT NULL
    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date;
    - Viky
    Edited by: Viky on Dec 17, 2010 11:42 AM

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • PRAA - Personnel numbers with already existing Vendor master record

    Hi gurus,
    We are using tcode PRAA to create vendor master, we notice some employees did not get converted to FK02 with the message "Personnel numbers with already existing Vendor master record". I checked FK02/FK03, but i didn't see any employee/vendor code there, I also checked vendor table, it is not there. why the system prompts me personnel numbers exist?
    Thanks in advance.

    Hi,
    Just go to the table LFB1 and put in the field PERNR that you are trying to create.
    If is created just put the transaction on modify instead of create.(if you want to change).
    And is better to see the vendor in tansaction XK03.

  • Partitioning an Existing Table with data

    Hi All,
    I am few tables with data, I need to Partition the table without affecting existing table values is it possible?.
    if yes then Please suggest me some ideas to archive that..
    Thanks & Regards
    Sami

    Hi All,
    I Need to partition for existing table with 1 million records
    1. First partition should be created for 6 months
    2.Second partition should created for 1 year.
    3.So as of now we have 6 months Data in production + another 6 months data in First partition + another 1 year data in Second partition.
    4.More than 2 year’s data’s should be moved other partition or archived.
    kindly provide your valuabe suggestion.
    Thanks & Regards
    Sami

  • How do I unregister a serial number for LR and replace it with another one?

    Hello
    I got LR3 with my Leica M9. Now I sold my M9 and I'm waiting for the next Leica M to arrive in the next few months. Since LR is more or less part of the Leica-Software, I sold it with it and for the time, while I waiting for the next M, I bought a new LR-License.
    Now I want to give the buyer of my camera the license number for the LR3, that came with the M9 and the LR4-update to it, so he can use it with the camera.
    My problem is now, that I can not unregister the license-number in my Adobe-account for the old LR. How do I do that? After unregistering I want to install my new LR, that just arrived today and register it, but I'm afraid, that I have two registered LR4 versions then and can't give the solde one to the buyer of the camera.
    Thanks for any help and best regards!

    Excerpt from the Lr EULA:
    4.4 No Transfer. YOU MAY NOT RENT, LEASE, SELL, SUBLICENSE, ASSIGN OR TRANSFER YOUR RIGHTS IN THE SOFTWARE, OR AUTHORIZE ANY PORTION OF THE SOFTWARE TO BE COPIED ONTO ANOTHER INDIVIDUAL OR LEGAL ENTITY'S COMPUTER EXCEPT AS MAY BE PERMITTED HEREIN. You may, however, transfer all your rights to use the Software to another individual or legal entity provided that: (a) you also transfer this agreement, (ii) the serial number(s), the Software and all other software or hardware bundled, packaged or pre-installed with the Software, including all copies, upgrades, updates and prior versions, and (iii) all copies of font software converted into other formats to such individual or entity; (b) you retain no upgrades, updates or copies, including backups and copies stored on a computer; and (c) the receiving party accepts the terms and conditions of this agreement and any other terms and conditions under which you purchased a valid license to the Software. NOTWITHSTANDING THE FOREGOING, YOU MAY NOT TRANSFER EDUCATION, PRE-RELEASE, OR NOT FOR RESALE COPIES OF THE SOFTWARE. Prior to a transfer Adobe may require that you and the receiving party confirm in writing your compliance with this agreement, provide Adobe with information about yourselves, and register as end-users of the Software. Allow 4-6 weeks to transfer. Please visit http://www.adobe.com/supportor contact Adobe's Customer Support Department for more information."
    For full text of EULA see here: http://labs.adobe.com/technologies/eula/lightroom.html

  • Sample report for filling the database table with test data .

    Hi ,
    Can anyone provide me sample report for filling the database table with test data ?
    Thanks ,
    Abhi.

    hi
    the code
    data : itab type table of Z6731_DEPTDETAIL,
           wa type Z6731_DEPTDETAIL.
    wa-DEPT_ID = 'z897hkjh'.
    wa-DESCRIPTION = 'computer'.
    append wa to itab.
    wa-DEPT_ID = 'z897hkjhd'.
    wa-DESCRIPTION = 'computer'.
    append wa to itab.
    loop at itab into wa.
    insert z6731_DEPTDETAIL from wa.
    endloop.
    rewards if helpful

  • Already existing tables in oracle 10g problem

    Hi, i am new to oracle and just installed oracle 10g, my porblem is that when i ran the query i got an error.
    SQL> select *
    2 from emp;
    from emp
    ERROR at line 2:
    ORA-00942: table or view does not exist
    As emp table already exist in database but it does not show result. please help me. Thanks.

    i have heared form someone that i should copy some text (from files) or some files which resides in bin folder (i don't know the exact path) in the sql console to access existing tables. is that ture?Not sure what that means... to access existing tables, or to create new ones you have to use Sql commands (or some graphic stuff).
    What about reading some documentation ?
    System user is a DBA, and can possibly read any tables, but most probably is not the owner of emp table. To know it you can do
    SQL> select owner from dba_tables where table_name='EMP';
    then connect to that user, or, as system user, do
    SQL> select * from <owner>.emp;

  • Partitioning an already existing table

    Hi,
    I need to partition many existing tables. All these tables hold more than 50 million data each.
    Since i am new to partitioning, can any one kindly guide what are the best practices one should look for under such circumstances.
    Is it neccessary to dwell on the following point
    1) Type of table (Heap or IOT etc).
    2) Indexes and kinds of indexes along with the columns in which they are defined.
    3) Block size
    4) Constraints
    5) Row Chaining, Migration etc.
    I have very basic idea about the above mentioned points.
    Please guide me as to how should the partitioning be done, what sort of partitioning is best, any performace issues.
    I sincerely appreciate the cooperation of all members.
    Thanks in advance
    Message was edited by:
    Master

    Hi,
    to create a partitioned table from the non portioned table
    create table part partition XXXXXXXX
    (partition p01 tablespace XX1,
    partition p02 tablespace XX2,
    partition p03 tablespace XX3,
    partition p04 tablespace XX 4
    nologging
    as select * from old data ;
    OR
    export the old non partition table data – rename the non partitioned table, create partitioned table import the data
    OR
    Exchanging Partitions
    You can convert a partition (or sub partition) into a non-partitioned table, and a non-partitioned table into a partition (or sub partition) of a partitioned table by exchanging their data segments. You can also convert a hash-partitioned table into a partition of a range-hash partitioned table, or convert the partition of the range-hash partitioned table into a hash-partitioned table. Similarly, you can convert a list-partitioned table into a partition of a range-list partitioned table, or convert the partition of the range-list partitioned table into a list-partitioned table
    One of the great features about partitioning, and most specifically range-based partitioning, is the ability to load in new data quickly and easily with minimal impact on the current users. The manuals indicate that the critical command to achieve this is as follows:
    alter table pt_tab1 exchange partition p_9999
    with table new_data
    Ani

  • Generate Turing Number for form submission to prevent automated registraton

    Hi,
    How I want to have a script to generate and check a turing number. A turing number is a number the user has to read and copy in order to be able to validate a form. This avoids automated submissions. Just like when you register for yahoo mail etc it asks for this number to prevent automated registrations. Any help is appreciated.
    Thanks

    Just so happens 3 days ago, I took a few hours to research and write a few methods that generate a "turing" sequence of characters and numbers or custom and write an image, I call them viverification (vivo = life , verify = proof) images. Very simple, I have different methods for different needs in my client application code. Here are the methods:
         * Returns a random character chosen from the input charset. If the charset is an empty string returns a char
         * from the set:
         *"1AaBb2CcDdEe3FfGgHh4IiJjKk5LlMmNn6OoPp7QqRr8SsTt9UuVvWw0XxYyZz"
         * Implicit use of the java.util.Random() provides the pseudo random selection algorithm. Iteration of provided set
         * means that efficiency decreases with char set length, so use of very long charsets will incur a performance penalty.
         * If you desire simply to have a random roman letter provided , the getRandomRomanLetter(boolean)  allows returning upper case
         * or mixed case chars.
         *@param String charset -- The set of characters to use as random selection items. If you provide "eaAVB456" the output will be randomized
         * about those 8 characters returning. "e" or "B" or "4" ...in a random fashion.
         *@returns char -- A randomly selected char from the string provided as charset.
        public static char getRandomCharFromString(String charset) {
            if(charset.trim().equals("")) charset = "1AaBb2CcDdEe3FfGgHh4IiJjKk5LlMmNn6OoPp7QqRr8SsTt9UuVvWw0XxYyZz";
            java.util.Random ur = new java.util.Random();
            java.text.StringCharacterIterator sci = new StringCharacterIterator("");
            sci.setText(charset);
            sci.setIndex(ur.nextInt(charset.length()));
            return sci.current();
         * Returns a random character chosen from a character set as defined by the boolean mixed case.
         * Implicit use of the java.util.Random() provides the pseudorandom selection algorithm. Iteration of provided set
         * means that efficiency decreases with char set length, so use of very long charsets will incur a performance penalty.
         * If you desire simply to have a random letter from an arbitrary string of characters, the getRandomCharFromString(String)
          *a char from a user provided set.
         * @param boolean mixed case -- If false, returns only chars from the set [A...Z] if true returns char from set. [aAbB...zZ]
          *@returns char -- A randomly selected char from the string provided as charset.
        public static char getRandomRomanLetter(boolean mixedcase) {
            String set = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            if(mixedcase)  set = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
            return Utilities.getRandomCharFromString(set);
         * Generates a 7 character Viverification Image used to confirm that only in vivo agents are filling out forms presented with the image.
         * The generated characters have forced capital roman letters at start and ends with 5 numerals in the center like: <p>
         * S35872F or R87356H
         * In conjunction with a confirmation field, the characters generated in the image can be matched against the returned string
         * value of those characters returned by this method to ensure a human agent filled out the form. An obfuscation diagonal line is
         *  drawn across the embedded sequence to obfuscate the image from OCR discovery techniques. This prevents bots from
         * being programmed to fill out forms or create accounts on systems built using the framework.
         * @param String path -- The fully qualified file path on the system to write the generated jpeg image file along with the file name.
         * @param int width -- The width of the generated image.  Must be long enough to accommodate the 7 characters as rendered on the generating platform to avoid truncation.
         * @param int height -- The height of the generated image.
         * @returns String -- If the Image generation succeeded, the string of the randomly generated character embedded in the generated image, empty string otherwise.
        public static String createViverificationImageAtPath(String path,int width, int height) throws IOException {
            String out = "";
            java.awt.image.BufferedImage bi = new java.awt.image.BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
            String viver = (int)((float)Math.random() * 100000) + "";
            viver = Utilities.getRandomRomanLetter(false) + viver + Utilities.getRandomRomanLetter(false);
            Graphics2D g2d =  bi.createGraphics();
           // g2d.setBackground(new Color(200,200,200));
            g2d.drawString(viver,3,height - 5);
            g2d.drawLine(0,height,width,0);
            ImageIO.write(bi,"jpeg",new File(path));
            return viver;
         * Generates a n character Viverification Image used to confirm that only in vivo agents are filling out forms presented with the image.
         * Where n is the length of the input message string.
         * In conjunction with a confirmation field, the characters generated in the image are matched against the returned string
         * value of those characters returned by this method to ensure a human agent filled out the form. This prevents bots from
         * being programmed to fill out forms or create accounts on systems built using the framework. Provides a boolean to enable
         * or disable character obfuscation using a line drawn diagonally across the image text. This prevents OCR automated tools
         * from being used to divine the characters. Accepts a custom desired string rather
         * than generating a random string as is done in createViverificationImageAtPath().
         * @param String path -- The fully qualified file path on the system to write the generated jpeg image file along with the file name.
         * @param String messg -- The desired message string to insert into the image, input image width must be long enough to accomodate the text or it will be truncated.
         * @param int width -- The width of the generated image.messg character string must be less than this width otherwise it will be truncated.
         * @param int height -- The height of the generated image.
         * @returns String -- If the Image generation succeeded, the string of the randomly generated character embedded in the generated image, empty string otherwise.
        public static String createViverificationImageAtPathWithString(String path,String messg,int width, int height,boolean obfuse) throws IOException {
            String out = "";
            java.awt.image.BufferedImage bi = new java.awt.image.BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
            String viver = messg;
            Graphics2D g2d =  bi.createGraphics();
            g2d.drawString(viver,3,height - 5);
            if(obfuse) g2d.drawLine(0,height,width,0);
            ImageIO.write(bi,"jpeg",new File(path));
            return viver;
        }You'll just need to import the requisite java packages used and you are good to go. If you want to make more complex images you can investigate the image API's further to get a more fancy (though it really is pointless to do so) minimally visually obfuscated images are all you need to thwart even the best subversive OCR (optical character recognition) algorithms that might be used by nefarious agents to spoof viverification.
    Use:
    Ideally you'd call the method as part of generating a page for an authentication or form in a dynamic fashion. (jsp /servlet) The returned string will allow the method to verify the sequence generated against the value returned by the vivo agent viewing the form. As part of validation you would write simple code to check if the string returned during the image generation doesn't match the form field for agent entry. If so you can deny the action, otherwise you can authorize it.
    Enjoy!
    Regards,
    David

  • Performing impdp into an already existing table

    hi
    i have a schema named current_students
    which has a table of all the student information (student_master)
    i was to syncronize this table with another schema's same table.
    (i want to sync this student master of current_students into student_master of all_students schema)
    the thing is student_master of all_students schema already has values. what i want is to just append the table.
    it was possible in the old exp / imp by ignore=y keyword.
    how can i do this using impdp ???
    plea help
    thanx in advance

    how can i do this using impdp ???impdp help=yes

  • Oracle 11g imp erroneously tries to recreate existing tables with CLOBs?

    I have a shell script for loading database dumps from both Datapump and the older exp/imp.
    Often when loading dumps, I need to rename the schema owner and tablespace names (which is handled by REMAP_SCHEMA and REMAP_TABLESPACE in Datapump).
    However I have a whole bunch of dumps created with exp at this point and not that many Datapump dumps yet. As such the old style dumps are handled by the shell script in this way:
    1) A first pass imp is run using INDEXFILE to generate a file with the SQL to create tables and indexes. Options also include FROMUSER and TOUSER.
    2) A series of sed command edit the SQL file to change the tablespace names (which are schema owner specific in our case).
    3) The editted SQL file is run with sqlplus to create the tables and indexes.
    4) A second pass imp is run to load the table rows as well as triggers, stored procedures, views, etc. Options include FROMUSER, TOUSER, COMMIT=Y, IGNORE=Y, BUFFER, STATISTICS=NONE, CONSTRAINTS=N
    This shell script has been working great for loading exp dump files into Oracle 9 and Oracle 10 databases, but now that I'm trying to load these dumps into Oracle 11, it fails.
    The problem is in step 4, the imp program is trying to create some of the tables that already were created with sqlplus in step 2. The problematic tables all seem to have CLOB columns in them. The table creation fails because it tries to use the tablespace names from the dump file, which do not exist in the destination database. And when the table creation fails, imp then decides not to load the rows for those table.
    This seems like a bug in the Oracle 11 imp program. I don't understand why it thinks it needs to recreate tables that already exist when those tables have CLOB columns. Is there something different about CLOB columns in Oracle 11 that I should know about that might be confusing imp into thinking that it needs to create tables when they already exist? Maybe I need to do something to those tables in SQL so that imp does not think it needs to recreate them?
    I know that the tables with the CLOBs were created correctly because I was trying to find some way to workaround this. For step 4, I tried using DATA_ONLY=Y, in which case imp does not try to create the tables and just loads the table rows. Of course using DATA_ONLY, I don't get a lot of other things like triggers, view and stored procedures. I started to try to get around that by doing 3 passes with imp, so that I could pick up the missing pieces by using an imp pass with ROWS=N, but strangely that has the same problem of trying to recreate the existing tables.

    The only solution I've found so far as a workaround is rather convoluted.
    1. I took an export using datapump's expdp of SCHEMA1 (in 10g it will skip the table with the xmltype).
    2. I imported the data to my empty schema (SCHEMA2) using impdp. To avoid the error that the type already exists with another OID, I used the TRANSFORM=oid:n parameter e.g.
    impdp user/pwd dumpfile=noxmltable.dmp logfile=importallbutxmltable.log remap_schema=SCHEMA1:SCHEMA2 TRANSFORM=oid:n directory=MYDUMPDIR
    3. I then manually created my xmltype table in the SCHEMA2 and did a select into to load it (make sure you have the select privileges to do so):
    INSERT INTO SCHEMA2.XMLTABLE2 SELECT * FROM SCHEMA1.XMLTABLE1;
    4. I am still taking an export with exp of the xmltable as well even though I'm not sure I can do anything with it.
    Thanks!
    Edited by: stacyz on Jul 28, 2009 9:49 AM

Maybe you are looking for

  • Missing Email Accounts in ~/Library/Mail

    I just got my iPhone an tried to sync with my Mail accounts but only a very old POP mail account (no longer in use) showed up on my iPhone. I checked on my computer and none of my current POP email accounts from Mail show up in ~/Library/Mail folder.

  • Error starting oim managed server

    Hi, I am getting the following error when trying to start oim managed server using the command startmanagedweblogic.cmd oim_server1 <Jul 15, 2012 8:36:54 PM CDT> <Critical> <WebLogicServer> <BEA-000386> <Server s ubsystem failed. Reason: weblogic.sec

  • Team viewer

    i recently started working online and my boss asked me to install Team viewer. i installed as he said, and told him my user id and password as i had no idea regarding the team viewer scams. I logged into the site using his id and password and did the

  • Entries in  BSID for customerA is more than for Customer B.

    Hi SDNers, In case of CustomerA, no of entries fetched from BSID is 246709 . Because of this a standard piece of  code takes a looong time to execute. In case of Customer B, no of entries fetched from BSID is just 512. Because of this less entries st

  • Premiere CS6 /Totalcode pluging, bug during export

    Hello, I try the demo version of total code for Premiere 6.0.3 I am very disappointed, because in H264/AVC export , preset HDTV 1080i frame rate changed from 25i to 50p the value of Reference Frames (Advanced setting panel) is always ignored and set