Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    35

    Unanswered: help with logic problem

    i got a logic problem here.
    i need to read from a file line by line.
    loop
    begin
    utl_file.get_line(v_file_ptr, v_Line);
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    end loop;

    how do i change the code so that it check with the other record to c if there is duplicated data?
    for eg:
    record 1 will match with record 2,3,4,5
    record 2 will match with 3,4,5
    record 3 will match with 4,5
    so on...

    i was thinking of using 2 pointer. 1 will point to the actual record the other will loop and do the checking. possible?
    can 2 pointer point to the same file?

  2. #2
    Join Date
    Apr 2004
    Posts
    246
    why not sqlload the data, or use external tables, then "select distinct"
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  3. #3
    Join Date
    Nov 2004
    Posts
    35
    i am not very good at these..
    any example?
    i dunno how to create external tables... etc..

  4. #4
    Join Date
    Sep 2004
    Location
    London, UK
    Posts
    565
    Here's one I made earlier:
    Code:
    CREATE TABLE ext_connections
    ( location         VARCHAR2(10)
    , frame            VARCHAR2(10)
    , a_end_hlabel     VARCHAR2(255)
    , b_end_hlabel     VARCHAR2(255)
    )
    ORGANIZATION EXTERNAL
    (
      TYPE oracle_loader
      DEFAULT DIRECTORY south_data
      ACCESS PARAMETERS
      (
        RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
        BADFILE 'ext_connections.bad_xt'
        LOGFILE 'ext_connections.log_xt'
        READSIZE 1048576
        FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
        MISSING FIELD VALUES ARE NULL
        REJECT ROWS WITH ALL NULL fields
        ( location         CHAR(20)
        , frame            CHAR(20)
        , a_end_hlabel     CHAR(255)
        , b_end_hlabel     CHAR(255) )
      )
      LOCATION
      ( 'ext_connections.dat'
      , 'south_cmux.csv'
      , 'south_manual.csv'
      , 'south_pdmxe.csv'
      , 'south_tracy_manual.csv' )
    )
    REJECT LIMIT UNLIMITED;
    For more details see the docs:
    * Utilities: External tables
    * SQL Reference: CREATE TABLE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •