How to publish a data in the table from another table

Oracle forms6i

Hai All

I created a form in order to generate traffic. I had a problem that I can post that two data

I have two tables, a table is created dynamically the data in the tables are extracted from the text file, and they are divided and stored fields are

Bartime Bardate barcode

000011 0815 01/08/2010 - it came

000012 0816 01/08/2010

000013 0815 01/08/2010

000011 1130 08/01/2010 - he goes for a break

000011 1145 01/08/2010 - it comes once again in

000011 1650 01/08/2010

000012 1655 01/08/2010

000013 1645 08/01/2010 - it home

That I need to transfer this data to the database table, the table name is dail_att and the fields are
Code bars, timein, timeout, breakin, escape, day like I need like this

Barcode Timein Breakin Breakout Timeout Attend_date

000011 0815 1130 1145 1650 01/08/2010

I tried to use some service number and rank of count, but it does not work Pls I give good solutions

The encoding is


declare
The CNT number;
bar_code varchar2 (25);
date of bar_date;
in_time varchar2 (25);
out_time varchar2 (25);
intr_intime varchar2 (25);
intr_outtime varchar2 (25);

Cursor c1 is
SELECT count (*), barcode, bardate, bartime
-ROW_NUMBER() over (order by bartime) RN
of temp_attendance
Group of barcodes, bardate, bartime

order by bardate;
Start
To r1 c1 loop
-Select the barcode, bardate, bartime
-ROW_NUMBER() on the partition by barcodeorder by bartime: nurse
-of temp_attendance
-the Group of barcodes, bardate, bartime
-order by bardate;

If (cnt < = 1) then
Select the code bar, intimate, intrtimein, introuttime, outtime, attend_date in bar_code, in_time, intr_intime, intr_outtime, out_time, bar_date from dail_att where attend_date = r1.bardate - 1;

Update dail_att set outtime = r1.bartime where attend_date = r1.bardate and barcode is r1.barcode.;
elsif (cnt < = 2) then
insert into dail_att(barcode,attend_date,intime,outtime)
values (R1. Barcode, R1.bardate, min (R1. Bartime), Max (R1. Bartime));
-other
-update dail_att set outtime = r1.bartime where attend_date = r1.bardate and barcode is r1.barcode.;
end if;

End loop;
forms_ddl ('commit');
exception
while others then
forms_ddl ('rollback');
message(SQLERRM|| dbms_error_Text);
message(SQLERRM|| dbms_error_Text);
End;




Thanks and greetings

Srikkanth.M

You seem to always have the same problem, but give it different titles. It would be much easier that you would hold a thread open until its resolved. The last time you had this problem that I posted the following code, it didn't help you? (Replace x and y in each if or ELSIF with the calendar you want to watch)

CURSOR cr IS
  SELECT CODE,
         DATE,
         TIME
    FROM FROM TEMP_ATTENDANCE
   ORDER BY CODE, DATE, TIME;
BEGIN
  FOR rec IN cr LOOP
    IF rec.TIME BETWEEN x AND Y THEN
      -- Update record for last day
      ..
    ELSIF rec.TIME BETWEEN x AND Y THEN
      -- Update record
     ..
    ELSIF rec.TIME BETWEEN x AND Y THEN
      -- Update record
     ..
    ELSIF rec.TIME BETWEEN x AND Y THEN
      -- Update record
     ..
    ELSIF rec.TIME BETWEEN x AND Y THEN
      -- Update record
     ..
    ELSIF rec.TIME BETWEEN x AND Y THEN
      -- Update record
     ..
    END IF;
  END LOOP;
END;

Tags: Oracle Development

Similar Questions

  • How do find no data in the table

    Hi all

    I have 250 table in my diagram and when I query like this

    Select * from object where type_objet = 'TABLE' and owner = 'MATTELLI.
    order by object_name CSA


    Some tables have no data in it. How to find the tables that not have data or records

    Thanks and greetings
    Srikkanth.M

    Hi Srikkanth,

    First of all, if you are only interested in object TABLE type, so you should better use dba_tables instead of dba_objects.
    Then, assuming that your statistics are up to date, it would look like:

    SELECT *
      FROM all_tables
     WHERE owner = 'MATTELLI'
      AND num_rows > 0
     ORDER BY table_name ASC
    

    Otherwise, you can go with a subquery and a 'select count.

    HTH,
    Thierry

  • How can insert different types of data in the table?

    Hello
    How can I insert different types of data in the table, (e.g., numeric and string) in the same index of a table.

    example:
    index0 car 10 green

    car red 11 index1
    Index2 car Blue 12

    where green car red and blue car as string and 10, 11 and 12 in the numeric form.
    then I extracted 10, 11 and 12 a digital table

    and, the green car, red car, blue car in a string array

    Help!

    Use 'Analysis of the chain' as in the picture as an attachment.  This will extract the number and color that you can add tables later.

  • How to add data to the table using Manager POST for restful Apex application

    Hi all

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Hi jerry2134,

    jerry2134 wrote:

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Check out the following tutorials OBE, that explains the creation of GET and POST RESTful Web Services and how to use them in the APEX.

    Also what yo mean "looking forward on how to proceed? Do you want to or created for use/consume in your Oracle APEX application hosted RESTful web services?

    If Yes, in your Application, you must create a RESTful Web Service reference -> shared components. Then, create a form/report based on Web Service reference.

    Kind regards

    Kiran

  • How to find if the data in the table are distributed on multiple disks

    Hi all

    I have a question on parallel processing.

    Assume that the Oracle (11 g 2) database is installed on a 12 CPU hardware has 24 independent labels, then I guess it's that we can have a maximum of 12 DOP.

    But if the table on which I use the parallel market that spans only 4 discs then the above 4 parallelism will degrade the performance of the query.

    My question is how do I know if the data in the table are spread over the number of disk drives, so that we can properly apply valid parallel operations on the table.

    Appreciate your valuable contributions here.

    Thank you
    MK.

    Just think logically.
    What is a table in the database? A segment.
    What is a segment made up of? Scopes.
    What is recorded on a scale? The id_fichier of the data file.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • How to insert data into the table by using the expression builder in the assign activity

    How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
    Can someone help me please

    Hello

    I don't think that oraext:query-database() can insert data into the table.

    What are your needs?
    Can not you plan to use the DB adapter with the insert operation?

    Kind regards
    Neeraj Sehgal

  • How to write a simple select query to get the data of the table as an XML.

    How to write a simple select query to get the data of the table as an XML. In the query, I'm just adding items below which i need be there in the XML document
    select '<test_tag>'||EMP_NAME||'</test_tag>','<date>'||sysdate||'</date>' 
    from temp_table where id_num BETWEEN 1 AND 10;
    I have need to add the root tag as well in the beginning and the end of < root > < / root > this xml file. Please advice if this is possible with the select query
    without using XMLGEN, XMLQUERY or any other packages built and function?

    I need to URL escapes with the UTF-8 code points that we have already achieved using the utl_http package. Please help how to do that without using the utl_http package.

    What is wrong with him?

    At present, the only way I can think of to avoid a call to UTL_HTTP. SET_BODY_CHARSET is to write your own little wrapper.
    In this way, you can specify the Boolean parameter or omit it if you choose to use named parameters:

    SQL> create or replace function my_url_escape (url in varchar2)
      2  return varchar2
      3  deterministic
      4  is
      5  begin
      6   return utl_url.escape(url, false, 'AL32UTF8');
      7  end;
      8  /
    
    Function created
    
    SQL> select my_url_escape('http://some.uri.com/param?lang=fr&text=contrôle') from dual;
    
    MY_URL_ESCAPE('HTTP://SOME.URI
    --------------------------------------------------------------------------------
    http://some.uri.com/param?lang=fr&text=contr%C3%B4le
     
    
  • How insert/DML data in the table when the data in the related table changes

    Hello guys!

    I came across a problem that I need to get fixed. Because I don't know how to start and get it resolved I wanted to ask you for your expertise.

    The scenario is as follows:

    I have a table 'a' in my 10g database and a view "ab" which combined table 'a' with 'b' table in a view. However, the 'b' table is a table in another schema Manager database. and accessible (read only right) via a database link.

    Now here it is: whenever the data changes in table "b", for example 2 new sets of data is inserted, I need to insert automatically the 2 values of these 2 sets of data in my table "a". Same procedure for update and delete in table "b".

    The action that inserts data into the table 'a' must be initialized in my database, I have limited access to the other. Can I somehow use a trigger my reviews of "ab" to insert data into the table "a"? Or is it possible to use the "change notification procedure database" using the view as the reference?

    Desperately need help and example of all suspicion/code greatly appreciated. I am very new to Oracle and not very fond of PL/SQL routines. So please be so kind as to give me more details.

    Thanks in advance - I hope you have any ideas how I can get this problem resolved.

    Sebastian

    >

    ... it does not, since the DDL operations are not permitted on the remote databases (ORA-02021). I can't create the trigger on a view either. :-(
    So what ways are left to insert data into the table 'a' when the related table changes?

    Please, help if you have an idea!

    Yes,
    You can't perform the DDL (create the trigger...) on remote databases as you can see...
    Try to create this trigger in the local database that will make DML (insert into...) on the remote database.

        CREATE OR REPLACE TRIGGER local_forward_pt_after_insert
         AFTER INSERT
             ON N2K_INV_PT
             FOR EACH ROW
    
         BEGIN
             -- Insert records into table "a"
             INSERT INTO TBL_PUNKTDATEN@remote_database_sid
              ( INT_NUMMER,
                STR_GEBIET
                 )
             VALUES
              ( :new.INT_INV_PT_NR,
                :new.GEBIET );
         END;
    

    Thank you

    Good luck

  • How to add data to the table changed in sql developer at Apex and vice versa

    Hello

    I had tables of database with sql developer. But now, I have modified the database (new tables added + changed the data in the tables). However, in the Apex, I the old database. Is it possible to get the new Apex database with the data of the table changed so this database in both places (sql and apex developer) is exactly the same... Also the other way around.

    Thank you

    The database schema that contains the tables, is it associated with the workspace even you are searching through the APEX product t development?  Why I'm asking is, if they are the same schema, the tables that you MODIFIED should be appear in the sql for APEX workshop part.  Now reports and forms will NOT see the changes (unless you have actually added or updated definitions for column).

    Can you explain what exactly you were doing the SQL Developer to the tables in your schema?

    Thank you

    Tony Miller
    Los Alamos, NM

  • How to share data in the tables ' User_ * ' with another schema

    I want to share the data in the table WHERE USER_SEGMENTS with another schema. If I create a view and grant select on the view, when the other schema queries the view data are identical to themselves querying the SYS.user_segments table directly.
    create view sys_user_segments as select * from sys.user_segments;
    grant select on sys_user_segments to A;
    My guess is that the SYS.user_segments table is a view based on the current user.

    Is there a way to share such data without creating a copy of the table?

    Oracle: 10g

    Thank you

    If the ADMINISTRATOR is concerned about B access to DBA_SEGMENTS (or by creating DBA_SEGMENTS views that belongs to a user who has access on top and then grant access to this view of B), it seems pretty crazy allow that kind of database connection.

    If you create a database link belonged to B that connects to A, B is, in substance, given any privilege that has exercises. But it is done in a very, very dark which will no doubt be neglected in the future when someone gets a check. He'll be sitting here to wait that someone (accidentally or intentionally) Decides to exploit the security hole and do something that is causing a problem (by removing all data from a table, grabbing all the sensitive data in a table, etc.). Risks of this almost certainly far, far* far * outweigh the risks of even leaving B to obtain direct access to DBA_SEGMENTS.

    Justin

  • How to get a list of the tables more fragmented in Oracle?

    Is there a SQL on how to get a list of the tables more fragmented in the Oracle DBMS?

    Update the statistics on the table and try this, you should see very fragmented tables upstairs with high wasted_space.

    select table_name,round((blocks*8),2) "size (kb)" ,
                                round((num_rows*avg_row_len/1024),2) "actual_data (kb)",
                                (round((blocks*8),2) - round((num_rows*avg_row_len/1024),2)) "wasted_space (kb)"
    from dba_tables
    where (round((blocks*8),2) > round((num_rows*avg_row_len/1024),2))
    order by 4 desc
    

    I changed the query a little because the ORDER BY will not work if we concat | ' Ko ' with the column because this makes the output a character column data.
    And added a WHERE condition to see that these tables where the total size is greater than the actual size of data.

    Published by: zahid79 on July 23, 2010 13:40

  • problem with the storage of the data in the table

    Hello

    I'm having the problem on the storage of data in the table. My problem is that whenever he makes a loop, the table just keep replacing them rather save to the next index. At 0, the value is 123, and 1 is 234. But I saw that all the data capture all crush to 0 until the last data see the 0. How can I fix this problem?


  • Choose the date of the table

    Hello

    It comes to my table
    CREATE TABLE TEMP_LEAP
      (
        "DATE_FROM" DATE
      )
    Insertion of the data in it with the procedure which takes 2 parameters of date format:
    CREATE OR REPLACE
    PROCEDURE  "T_PROC" (p_dat_from date, p_dat_to date) IS
    BEGIN
    
    
    DECLARE
    
      day       number     := 0;
      st           NUMBER := 0;
    
    BEGIN
    
    day := p_dat_to+1 - p_dat_from; 
    
    for p in 1 .. day     
               
    loop   
                    
       insert into temp_leapp (date_from) values (p_dat_from+st);    
                    
        st := st+1;  
                  
    end loop;  
               
     commit; 
    END;
    END;
    Now lets fill in the data in the table:
    execute T_PROC(TO_DATE('01.01.2010','DD.MM.YYYY'),TO_DATE('17.08.2013','DD.MM.YYYY'));
    Data are now filled in the table.

    I want to do is do a select statement that will make the following output data:
    01.01.2010 - 31.12.2011
    01.01.2012 - 31.12.2012
    01.01.2013 - 17.08.2013
    I want is to get the leap year if there is a. I only need of days in the year, so don't mind the months.

    I need to check if there is a leap year in considering the p_dat_from and p_dat_to.

    If it isn't then you will get a single record of our instruction select and values will be made of: p_dat_from - p_dat_to.

    If there is a leap year in our period we will arrive after statements (example above).

    01.01.2010 - 31.12.2011 <-first date is p_dat_from and second is the last day before the leap year
    01.01.2012 - 31.12.2012 <-this is leap year. First date is the beginning of the leap year and the last date is the end of the leap year or p_date_to (if it ends in leap years).
    01.01.2013 - 17.08.2013 <- and this is the period after the leap years.

    It is a piece of code that I fell or with up to now:
    SELECT
    MIN(date_from),
    MAX(date_from)
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) = 0
    union
    
    SELECT 
    
    MIN(date_from) over (partition by to_char(date_from,'yyyy')),
    MAX(date_from) OVER (PARTITION BY to_char(date_from,'yyyy'))
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) <> 0
    
    ORDER BY 1,2;
    OK, that's all. I hope that its understandable that I do.
    If you have a questions please ask away.

    PS is there anything I need to do. You don't have to bother with the questions "what i February is after before etc." I don't love about it. All the other logic is already fixed all I need is what I wrote above.

    Thank you.

    Published by: BluShadow on March 14, 2013 08:24
    Fixed barcode labels

    Here's a way...

    SQL> create table temp_leap(date_from DATE)
      2  /
    
    Table created.
    
    SQL>
    SQL> insert into temp_leap
      2  select date '2010-01-01' + rownum - 1
      3  from dual
      4  connect by rownum <= (date '2013-08-17' - date '2010-01-01') + 1
      5  /
    
    1325 rows created.
    
    SQL>
    SQL> commit
      2  /
    
    Commit complete.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select min(date_from)||' - '||max(date_from)
      2  from
      3        (select date_from
      4              ,sum(leap_yr_switch) over (order by date_from) as leap_yr_switch_cnt
      5        from (
      6              select date_from
      7                    ,case when lag(leap_yr) over (order by date_from) != leap_yr then 1 else 0 end as leap_yr_switch
      8              from (
      9                    select date_from
     10                          ,case when mod(to_number(to_char(date_from,'YYYY')),400) = 0
     11                                 or (    mod(to_number(to_char(date_from,'YYYY')),4) = 0
     12                                     and mod(to_number(to_char(date_from,'YYYY')),100) != 0
     13                                    )
     14                           then 1 else 0 end as leap_yr
     15                    from temp_leap
     16                   )
     17             )
     18       )
     19  group by leap_yr_switch_cnt
     20* order by min(date_from)
    SQL> /
    
    MIN(DATE_FROM)||'-'||MAX(DATE_FROM)
    -------------------------------------------
    01-JAN-2010 00:00:00 - 31-DEC-2011 00:00:00
    01-JAN-2012 00:00:00 - 31-DEC-2012 00:00:00
    01-JAN-2013 00:00:00 - 17-AUG-2013 00:00:00
    

    Published by: BluShadow on March 14, 2013 08:51
    a slight correction in the calculation of the leap year, forgotten 100 years being does not leap.

  • What trigger to use to insert data into the table db forms

    Hello

    My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
    I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
    Is - shutter release key of the form-level validation?

    Please notify.

    Thank you
    Didi.

    You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.

    Hi didi.
    And this is my last post I'll sleep. ;)
    Take form level trigger named preform
    and write on it

    :SYSTEM.MESSAGE_LEVEL := 5;
    

    I hope this works...

    Hamid

    Mark correct/good to help others to get the right answers. *

  • Privileges - hide the data on the table, but allow the visualization of the table structure?

    I was wondering if there is a lien that would allow someone to be able to view a table exists, its column names, but hide the contents of the actual data in the table?

    I know he has a right to SELECT which, if not given it seems just totally hide the table

    Thanks in advance

    I was wondering if there is a lien that would allow someone to be able to view a table exists, its column names, but hide the contents of the actual data in the table?

    The solutions are:
    -grant SELECT on DBA_TAB_COLUMNS ;
    -a custom view SYS. CUSTOM_TAB_COLUMNS selects from DBA_TAB_COLUMNS, which is filtered for specific schemas/tables.
    -Fine grain access
    -Security label

    Published by: user11181920 on October 23, 2012 11:15

Maybe you are looking for