LookUp to the same table with multiple conditions

Hi,
I nead to do a lookup to the same table in the flow but with diffrent quieres, each query contains it's own 'where'.
Can I do it somehow in one look up or do I have to use a few ?
select a from table where a=1
select b from table where c=3
Thanks

Hi,
  Using multiple lookups will be a cleaner approach. If you are using multiple lookups on the same table consider using Cache transform. Refer the below link for details on Cache transform
Lookup and Cache Transforms in SQL Server Integration Services
Alternatively if you want to go ahead with single look up , you may have to modify the SQL statement in the Lookup accordingly to return the proper value. In you case it may be
select a,b from table where a=1 or c=3
Note : Consider the above as a pseudo code. This needs to be tested and applied based on your requirement.
Best Regards Sorna

Similar Messages

  • Web Analysis : populate the same table with multiple data sources

    Hi folks,
    I would like to know if it is possible to populate a table with multiple data sources.
    For instance, I'd like to create a table with 3 columns : Entity, Customer and AvgCostPerCust.
    Entity and Customer come from one Essbase, AvgCostPerCust comes from HFM.
    The objective is to get a calculated member which is Customer * AvgCostPerCust.
    Any ideas ?
    Once again, thanks for your help.

    I would like to have the following output:
    File 1 - Store 2 - Query A + Store 2 - Query B
    File 2 - Store 4 - Query A + Store 4 - Query B
    File 3 - Store 5 - Query A + Store 5 - Query B
    the bursting level should be give at
    File 1 - Store 2 - Query A + Store 2 - Query B
    so the tag in the xml has to be split by common to these three rows.
    since the data is coming from the diff query, and the data is not going to be under single tag.
    you cannot burst it using concatenated data source.
    But you can do it, using the datatemplate, and link the query and get the data for each file under a single query,
    select distinct store_name from all-stores
    select * from query1 where store name = :store_name === 1st query
    select * from query2 where store name = :store_name === 2nd query
    define the datastructure the way you wanted,
    the xml will contain something like this
    <stores>
    <store> </store> - for store 2
    <store> </store> - for store 3
    <store> </store> - for store 4
    <store> </store> - for store 5
    <stores>
    now you can burst it at store level.

  • Mapping to the same table through multiple references

    Hello,
    I'm trying to map aggregate fields (from my target) to mutlitple tables (back on my source), but am hung up because I need multiple references to the same table (basically a lookup values table) in my target. I believe that the problem lies in not being able to reference (in the mapping workbench at least) the same table more than once (such as through an alias, or otherwise defining multiple references) in the multi-tables tab. Is there a way around this, or some other approach to mapping it that I can take?
    Thank you,
    John

    Not exactly sure what you are trying to do, perhaps listing the object model and data model would help.
    If you are having trouble mapping the aggregate in the Mapping Workbench you may be able to workaround the problem through using a descriptor or project amendment method and defining the mapping through the code API.

  • Using the same library with multiple computers over a network Use Aperture

    Hi Everyone. I am researching some cataloguing/editing programs to recommend one to my boss, and I was wondering if it was possible to use the same library between multiple computers on a network. Does anyone know if this is possible? This may be what makes or breaks the decision on whether or not to go with Aperture as we need a program that can access a large database of photos on multiple computers.
    Thank you.

    Welcome to the forum.
    You can do it, but...
    It's not supported by Apple.
    Performance won't be great unless you're running a really fast network.
    If more than one person tries to access the Library at one time you're likely to end up with a corrupted database, and there's no code in Aperture to limit access to one person at a time.
    The Library must be stored on an HFS+ volume - don't even try putting it on a FAT32-formatted drive.
    If you want 'proper' multi-concurrent-user network-enabled cataloguing software you're looking into a whole different level of investment than the low price of Aperture - think more in terms of thousands or even tens of thousands of dollars.
    Ian

  • How do I sum across the same table in multiple sheets?

    So I'm trying to figure out an annoying problem.
    I have a largish (100's) amount of data with each collection being a table in a sheet, one sheet per data collection. This means I have 100's of sheets, each with the same table name and layout. Each sheet has several hundred data points in it.
    How do I do a sum across all of the same table in all the sheets?
    For example I want to do Sum('Data Sheet Number *'::'Table 1'::A1) to get a sum of everything in all the A1 cells of all the sheets named 'Data Sheet Number ' followed by anything (I'm using the star in the same way one would do it in a shell...)
    Thanks!
    Message was edited by: unusedusername
    Message was edited by: unusedusername

    To respond to WWJD: I was handed the data and I don't have any control over it's format...
    I found the answer in the forums though, so I guess I'm answering my own question
    http://discussions.apple.com/thread.jspa?messageID=6203991&#6203991
    The auto-filling INDIRECT reference worked very well for me.

  • Trigger in mutation - Update another rows in the same table with a trigger

    Hi ,
    I try to do a before update trigger on a table , but the trigger is in mutation. I understand why it do that but my question is :
    How can I update other rows in the same table when a UPDATE is made on my table??????
    Here is my trigger :
    CREATE OR REPLACE TRIGGER GDE_COMPS_BRU_5 BEFORE
    UPDATE OF DEPARTEMENT--, DISCIPLINE, DEG_DEMANDE, CE_ETAB
    ON GDEM.COMPOSITION_SUBV
    FOR EACH ROW
    Organisme : FQRNT-FQRSC
    Date de création : 14-07-2011
    Date de modification :
    Modifié par :
    Auteur : Johanne Plamondon
    Description : Ce déclencheur s'executera lors de la modification
    du responsable dans la table COMPOSITION_SUBV
    DECLARE
    V_OSUSER V$SESSION.OSUSER%TYPE;
    V_PROGRAM V$SESSION.PROGRAM%TYPE;
    V_TERMINAL V$SESSION.TERMINAL%TYPE;
    V_MACHINE V$SESSION.MACHINE%TYPE;
    V_MODULE V$SESSION.MODULE%TYPE;
    V_LOGON_TIME V$SESSION.LOGON_TIME%TYPE;
    V_AUDIT_ID NUMBER;
    vSEQ NUMBER;
    i NUMBER;
    vID DEMANDE.ID%TYPE;
    BEGIN
    begin
    SELECT OSUSER, PROGRAM, TERMINAL,MACHINE,MODULE, LOGON_TIME
    INTO V_OSUSER,V_PROGRAM,V_TERMINAL,V_MACHINE,
    V_MODULE,V_LOGON_TIME
    FROM V$SESSION
    WHERE TYPE = 'USER'
    AND USERNAME = USER
    AND LAST_CALL_ET IN (0,1)
    AND ROWNUM < 2;
    exception when others then null; end;
    IF NVL(:NEW.SC_PART,' ') = 'CHC' THEN
    SELECT COUNT(*)
    INTO i
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    IF i = 1 THEN
    SELECT ID
    INTO vID
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    UPDATE COMPOSITION_SUBV
    SET --CE_ETAB     = :NEW.CE_ETAB,
    --DISCIPLINE  = :NEW.DISCIPLINE,
    DEPARTEMENT = :NEW.DEPARTEMENT,
    --DEG_DEMANDE = :NEW.DEG_DEMANDE,
    DATE_MODIF = SYSDATE,
    USER_MODIF = V_OSUSER
    WHERE DEM_ID = vID
    AND PER_NIP = :NEW.PER_NIP
    AND ANNEE = :NEW.ANNEE;
    END IF;
    END IF;
    /*EXCEPTION
    WHEN OTHERS THEN
    NULL;*/
    END;

    A standard disclaimer, the mutating trigger error is telling you that you really, really, really don't want to be doing this. It generally indicates a major data model problem when you find yourself in a situation where the data in one row of a table depends on the data in another row of that same table. In the vast majority of cases, you're far better off fixing the data model than in working around the problem.
    If you are absolutely sure that you cannot fix the data model and must work around the problem, you'll need
    - A package with a collection (or global temporary table) to store the keys that are modified
    - A before statement trigger that initializes the collection
    - A row-level trigger that adds the keys that were updated to the collection
    - An after statement trigger that iterates over the data in the collection and updates whatever rows need to be updated.
    If you're on 11g, this can be simplified somewhat by using a compound trigger with separate before statement, row-level, and after statement sections.
    Obviously, though, this is a substantial increase in complexity over the single trigger you have here. That's one of the reasons that it's generally a bad idea to work around mutating table exceptions.
    Justin

  • Deleting data from another table with multiple conditions

    Hi frnds
    I need to delete some data from a table based on multiple condition I tried following sql but its deleteing some rows which is not meeting the criteria which is really dangerours. When i trying = operator it returns ORa- 01427 single -row subquery returns more than one row
    delete from GL_TXNS
    where TRN_DT in (Select trn_Dt from GL_MAT)
    and BR in (select ac_branch from GL_MAT)
    and CODE in (select CODE T from GL_MAT)
    and (lcy_amt in (select lcy_amt from GL_MAT) or
    fcy_amt in(select fcy_amt from GL_MAT)
    rgds
    ramya

    My answer is the same as Avinash's but I will explain a little bit more.
    ORa- 01427 single -row subquery returns more than one rowmeans that you have a subquery that Oracle is expecting one value from that is returning multiple values. In your case you need one value for the equijoin ("=") and you are getting more than one value back. The error happens even if all the values are the same - multiple values being returned will cause the error.
    The solution is to either allow multiple values to be returned (say, use the IN condition istead of "=") or only return one value if possible (say, forcing one value by using DISTINCT, GROUP BY, or a WHERE clause condition of ROWNUM=1) - but these workarounds must be checked carefully to make sure they work correctkly

  • SLT Replication for the same table from Multiple Source Systems

    Hello,
    With HANA 1.0 SP03, it is now possible to connect multiple source systems to the same SLT Replication server and from there on to the same schema in SAP HANA - does this mean same table as well? Or will it be different tables?
    My doubt:
    Consider i am replicating the information from KNA1 from 2 Source Systems - say SourceA and SourceB.
    If I have different records in SourceA.KNA1 and SourceB.KNA1, i believe the records will be added during the replication and as a result, the final table has 2 different records.
    Now, if the same record appears in the KNA1 tables from both the sources, the final table should hold only 1 record.
    Also, if the same Customer's record is posted in both the systems with different values, it should add the records.
    How does HANA have a check in this situation?
    Please throw some light on this.

    Hi Vishal,
    i suggest you to take a look to SAP HANA SPS03 Master Guide. There is a comparison table for the three replication technologies available (see page 25).
    For Multi-System Support, there are these values:
    - Trigger-Based Replication (SLT Replication): Multiple source systems to multiple SAP  HANA instances (one  source system can be connected to one SAP HANA schema only)
    So i think that in your case you should consider BO Data Services (losing real-time analytics capabilities of course).
    Regards
    Leopoldo Capasso

  • Selecting specific records out of the same table with PICS

    Post Author: nambi
    CA Forum: Formula
    I have a Database table in which we have information for our paint codes,
    This database when accessed through our will display the types of tests we do for the products we manufacture, we manually enter in these results through the software.  When I open up this same table in access I noticed that each test we do is displayed as new entry under the same product, therefore I have several entries for the same product code, and since we have several tests for each I am unable to specifically pull out the data I need.
    For example I need to create a data sheet for our customers displaying the bake time for these all our products the Product code (formkey) is listed multiple times but all I need is to record the Bake (TargetAlphaValue) time. Out of this table I will also need to report on the Gloss. If I use the record selection I am only able to display one type of test although I will need to specify other types as well.  This is the area I have the problem with,
    I have shown in a jpg what I am looking for, would anyone here know how to pull out only the TargetAlphaValue and associate it to the bake and formkey?  Then do the same with the Gloss test and pull up the TargetAlphaValue for that it would be of great help

    Can you be more precise , please :
    - which table stores the people identities ? (I call this one Identity)
    - which table gives the class where the student works in (I cal l this one Claa_attendees)
    - which table gives the instructor of a class (I call this one Class)
    If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
    Select Stud_iden.name, Instr_iden.name
    From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
    Where Class.clas_id = class_attendees.class_id
    and class.instructor_id = Instr_iden.people_id
    and class_attendees.student_id = Stud_iden.people_id
    Is this what you need to do ?

  • How can I share only the same music with multiple iTunes accounts

    Hello
    I hope someone can help. [I am using Windows Vista (Unfortunately J) and iTunes 10]
    I am trying to share the same music library with multiple iTunes accounts. Basically, I want to know if there is a way to automatically upload to other libraries when importing new music into my library, vice versa. [Better information below]
    Me, my sister and my dad all use iTunes (on different iTunes accounts), and before now we used to have are own music on our own windows user. Due to many duplicates and a loss of hard drive space I have brought an external hard drive and organised all the music.
    It was all going well - I first populated all the music onto my iTunes, exported the library, and then imported it on both the other users. However! Because this is only a copy of the library, when I try to import a new CD, it will not show up on there’s until I “Add File to Library”! Originally I thought about using the same library however we each have are own apps etc, that we don’t want to share.
    If you need anymore information please ask!
    Matt

    Hello roaminggnome
    Unfortunately the support is down at the moment, I will have a better look later. I did go though the Apple support previously, however I found nothing that worked.
    The first thread I came across was “Home Sharing” however no mater what I did, it did not appear in the iTunes sharing list (I did go though the “Show Sharing Networks” support as well)
    Secondly, I saw “Using A Single Library With Multiple Accounts On The Same PC” (Something like that) but all this did was let us share the same music location, if I was to rip extra music, it will not show in there library
    Matt

  • Can you have multiple users working off the same Mac pro at the same time with multiple monitors but doing different things?

    I'm buying desktops for a start up company and was wondering if I could purchase a single Mac Pro and run multiple monitors to allow multiple users to work on the computer at the same time. These users would be doing different tasks but I would hope to accomplish that on a single desktop. I know that screen sharing is possible but with only one user controlling both of the screens. Thanks in advance, sorry for my apple ignorance!

    A lot of companies are buying or leasing laptops to be used at the office by day, and carried home at night.
    Some companies are doing "Bring your own device". Bring a device to receive email -- computer/smartphone/tablet you already have, or have an allowance to buy one for your use.
    If Capital is short (and when is it not) leasing computers, to be turned in a few years, can be a huge savings because the cost is expensed as incurred. The alternative is laying out cash today, but not being able to expense the cost this year. Instead, the computer expense must be recovered over their useful life (often five years) through depreciation.

  • Query multiple values from tables with multiple conditions

    I'm trying to display the addresses from an employee record. There are two tables: employees and emp_addresses. There can be any number of addresses which is defined by the address type.
    What I want to do is get all the employees and all of the addresses for that employee in the same result.
    Addresses table:
    emp_id
    address1
    address2
    address3
    city
    state
    zip
    type (either H for 'home' or W for 'work')
    I would like the result set to be:
    emp_id | home_address1 | home_city | work_address1 | work_city
    Do I have to use a join? I'm not sure how to go about it.

    Hi,
    user9179751 wrote:
    I'm trying to display the addresses from an employee record. There are two tables: employees and emp_addresses. There can be any number of addresses which is defined by the address typeIf there can be any number of addresses, and you want to show all of them, then you probably need String Aggregation . See this page for different ways to do it:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    A related topic, that usually works better with a known number of columns, is Pivoting . See these links:
    SQL and PL/SQL FAQ
    There are ways to make pivoting work with a variable number of columns. See this thread:
    Re: Report count and sum from many rows into many columns
    What exactly are your requirements? Do you rally need separate columns for each address, or is it okay to have one big VARCHAR2 column that's formatted so it looks like separate columns? If you really need separate columns, do you know an upper limit to how many (e.g., there will never be more than 5)?
    What I want to do is get all the employees and all of the addresses for that employee in the same result.
    Addresses table:
    emp_id
    address1
    address2
    address3
    city
    state
    zip
    type (either H for 'home' or W for 'work')
    I would like the result set to be:
    emp_id | home_address1 | home_city | work_address1 | work_cityWhenever yo have a question, post CREATE TABLE and INSERT statements for some sample data, and the exact results you want from that data. Showing the column names for the sample data isn;t nearly as helpful as shoiwing some actual data (with column names). Showing the header line that goes over the results isn't nearly as helpful as showing the actual results (with the header line).
    Always say which version of Oracle you're using. Sting aggreagation and pivoting techiniques have changed significantly in every version since Oracle 7.
    Do I have to use a join? I'm not sure how to go about it.Using a join, you could get one more address for every join, but since there could be any number of addresses, you'd need any number of joins, and that means dynamic SQL. Join probably isn't the best approach in this case.

  • Selecting two different Names using the same table with same field

    Hello,
    I am trying to display several fields from different tables. Here are some of the fields that I need: The instructor needs to go after the social.
    WESL | ENGR-1101-SW1 | Hinojosa | Ashley | Social | Instructor |
    I am using a table where they have the social and I need to get both the student and the instructor. How do I select the instructor when the instructor's id is on a different table. example
    CLASS PERSON CLASS_ASSIGN
    student_id student_id: name facutly_id
    Here is the code that I have so far and it works.
    rem ----------------
    rem Filename: cer.sql
    rem Purpose: to get data from banner and put into flat file
    rem Date: August 17, 2006 4:51 P.M.
    rem Author: Robert Hernandez
    rem ---------------
    rem Notes: Need to add the Instructor - having problems
    rem using the same spriden_id.
    rem Also need to have admissions enter the grad date for
    rem several students: Procedure is working as is.
    declare
    l_output utl_file.file_type;
    grad_month varchar2(2);
    buffer varchar2(1000);
    cursor cursor1 is
    select ssrmeet_bldg_code,
    ssbsect_subj_code,
    ssbsect_crse_numb,
    ssbsect_seq_numb,
    spriden_last_name,
    spriden_first_name,
    spriden_id,
    scbcrse_title,
    ssbsect_term_code,
    sfrstcr_grde_code,
    sorhsch_graduation_date,
    decode(substr(sorhsch_graduation_date,4,3),'JAN','01',
    'FEB','02',
    'MAR','03',
    'APR','04',
    'MAY','05',
    'JUN','06',
    'JUL','07',
    'AUG','08',
    'SEP','09',
    'OCT','10',
    'NOV','11',
    'DEC','12') as grad_month,
    sorhsch_sbgi_code
    from ssbsect,ssrmeet,sfrstcr,spriden,scbcrse,sorhsch
    where rownum < 200
    and ssbsect_seq_numb like 'S%'
    and (ssrmeet_term_code = ssbsect_term_code
    and ssrmeet_crn = ssbsect_crn)
    and (ssbsect_crn = sfrstcr_crn
    and sfrstcr_pidm = spriden_pidm
    and length(spriden_id) = 9
    and substr(spriden_id,1,1) <> 'A')
    and (ssbsect_crse_numb = scbcrse_crse_numb
    and ssbsect_subj_code = scbcrse_subj_code)
    and spriden_pidm = sorhsch_pidm
    and sorhsch_graduation_date is null
    order by ssbsect_crse_numb;
    begin
    l_output := utl_file.fopen('CER','rbfpce.txt','W');
    for cur1_rec in cursor1 loop
    buffer:= cur1_rec.ssrmeet_bldg_code||'|'||
    cur1_rec.ssbsect_subj_code||'-'||
    cur1_rec.ssbsect_crse_numb||'-'||
    cur1_rec.ssbsect_seq_numb||'|'||
    cur1_rec.spriden_last_name||'|'||
    cur1_rec.spriden_first_name||'|'||
    substr(cur1_rec.spriden_id,1,3)||'-'||
    substr(cur1_rec.spriden_id,4,2)||'-'||
    substr(cur1_rec.spriden_id,6,4)||'|'||
    cur1_rec.scbcrse_title||'|'||
    cur1_rec.ssbsect_term_code||'|'||
    cur1_rec.sfrstcr_grde_code||'|'||
    '20'||SUBSTR(cur1_rec.sorhsch_graduation_date,8,2)||
    cur1_rec.grad_month||'|'||
    cur1_rec.sorhsch_sbgi_code;
    utl_file.put_line(l_output,buffer,false);
    end loop;
    utl_file.fclose(l_output);
    exception
    when no_data_found then
    utl_file.fclose(l_output);
    end;
    /

    Can you be more precise , please :
    - which table stores the people identities ? (I call this one Identity)
    - which table gives the class where the student works in (I cal l this one Claa_attendees)
    - which table gives the instructor of a class (I call this one Class)
    If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
    Select Stud_iden.name, Instr_iden.name
    From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
    Where Class.clas_id = class_attendees.class_id
    and class.instructor_id = Instr_iden.people_id
    and class_attendees.student_id = Stud_iden.people_id
    Is this what you need to do ?

  • Create values for analogous periods in the same table with DS

    Hi,
    in the course of a pilot we want to create additional columns with data for analogous periods.
    We have values for a month and need to create new columns for values for last month and last year in order to compare.
    Attached youu2019ll find a few sample rows resembling the basic concept of what we have
    Region     Country     Year     Month     Value
    Europe     Spain     2009     1     285
    Europe     Spain     2009     2     129
    Europe     Spain     2009     3     153
    Europe     Spain     2008     1     288
    Europe     Spain     2008     2     284
    Europe     Spain     2008     3     125
    Europe     France     2009     1     135
    Europe     France     2009     2     125
    Europe     France     2009     3     284
    Europe     France     2008     1     208
    Europe     France     2008     2     221
    Europe     France     2008     3     220
    In this case, new columns would be
    LastMonth (125 for Spain month 1 year 2009, since this is the value for month 3 year 2008)
    LastYear (288 for Spain month 1 year 2009, since this is the value for month 1 year 2008).
    Can you help on what function to use in the DS query transformation?
    thanks everybody, and enjoy!

    Hi David,
    Probably the easiest way of resolving this would be to add extra columns which show the projected date each row should be shown on e.g.
    Region     Country     Year     Month     Value     LM_Year     LM_Month     LY_Year     LY_Month
    Europe     France     2008     1     208     2008     2     2009     1
    Europe     France     2008     2     221     2008     3     2009     2
    Europe     France     2008     3     220     2008     4     2009     3
    Europe     France     2009     1     135     2009     2     2010     1
    Europe     France     2009     2     125     2009     3     2010     2
    Europe     France     2009     3     284     2009     4     2010     3
    This would be written to a staging table then used as a source with the original source file to produce the target table. I've illustrated an example of how this could be achieved below:
    Create two dataflows; DF 1 and 2.
    In DF 1 read source, add additional columns to show the date (year, month, etc) this should be projected as. This would need to be done for both the last month and last year. Load staging table.
    In DF 2 Read the source and outer join to the new staging table twice. Use the region, Country, Year, Month, to join and use the new additional projected date columns. Ensure the last month date fields are used on one staging table and last year date fields are used on the next staging table. The value from the two staging tables is then used in the last month and last year value.
    Load into target table.
    To calculate the projected date columns you would probably want to format the source fields into a date then add the required number of months. e.g. to_date('01' || month || year, 'DDMMYYYY') + 12
    Obviously this would need the stage table to be truncated before each load and you would need to assess your load strategy. When doing these calculated fields if you have any retrospective updates on the source then these would then need recalculating, therefore this assumes it's a complete reload each time.
    Edited by: Richard Saltern on Jul 16, 2010 2:01 PM
    Edited by: Richard Saltern on Jul 19, 2010 10:10 AM

  • Sql*loader - load data in table with multiple condition

    Hi,
    I have oracle 9i on Sun sloaris and i need to load data in one of oracle table using sql*loader with conditional column data.
    My table is like:
    Load_table
    col1 varchar2(10),
    col2 varchar2(10),
    col3 varchar2(10),
    Now i have to load data like:
    If col2 = US1 then col3 = 'AA'
    If col2 = US2 then col3 = 'BB'
    If col2 = US3 then col3 = 'CC'
    How can i load this data in table using sql*loader?
    Thanks,
    Pora

    Hi
    it is a half-solution.
    You have to:
    1. open file
    2. take a line
    3. split the line into values (using substring to)
    4. check condition (01 or 02)
    5. do a proper insertion
    Good Luck,
    Przemek
    DECLARE
    v_dir VARCHAR2(50) := 'd:/tmp/'; --directory where file is placed
    v_file VARCHAR2(50) := 'test.txt'; -- file name
    v_fhandle UTL_FILE.FILE_TYPE; ---file handler
    v_fline VARCHAR2(906); --file line
    v_check VARCHAR2(50);
    BEGIN
    v_fhandle := UTL_FILE.FOPEN(v_dir, v_file, 'R'); --open file for read only
    LOOP -- in the loop
    UTL_FILE.GET_LINE( v_fhandle , v_fline); -- get line by line from file
    if (substr(v_fline,17,2) = '01') then --check the value
    INSERT INTO ... -- Time_in
    else
    INSERT INTO ... -- Time_out
    end if;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN UTL_FILE.FCLOSE( v_fhandle );
    END;

Maybe you are looking for