How to compare date in different tables?
I have 2 tables with the same structure
create table (Atb)
col1 char (5),
col2 char (5),
COL3 char (5),
date of sign_date);
create table (Btb)
col1 char (5),
col2 char (5),
COL3 char (5),
date of vote_date);
the data in the Atb and Btb tables are the same for the 3 columns col1, col2 and col3. How can I compare the sign_date and the vote_date?
Thank you!
Thanks Frank. the answer solves my problem!
Tags: Database
Similar Questions
-
How to load data from different tables, but record to another table?
Hi all
I use the apex and I understand how it updates and saves the files normally.
In this case, I would need to load from a table, but save on another Board on the button "submit".
I am aware that it would be easy as forms where I could do a manual insert process. im making in tabular form and I don't really know how to handle this process.
Suppose that I am loading a set of questionnaires in the form of tables and have a yes / no selection.
If the questions would come from table A and I need to save it in table B.
in this case that I can't put just the value default by the tabular row for questions coz it would be dynamic and this example is on a small scale. I would need to load the table A and record in table B.
could someone guide me on this operation or provide tutorials any?
Maybe that's what you're after.
(1) create region report using SQL like this:
Select apex_item.hidden(1,rownum).
apex_item.display_and_save(2,question_column) in Question,
apex_item. Text(3,,4,4) as answer
from table_a
apex_item documentation of package found:
http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/apex_item.htm
The pidx (first number) in each apex_item parameter is used to identify this item in the same row of the report' / tabular form.
(2) create a submit in procedure a bit like that.
Start
because I 1.apex_application.g_f01.count loop - identifies the "apex_item.hidden(1,rownum)" at the top and gets a count of how many times it occurs
Insert into table_b (question, answer)
values (apex_application.g_f02 (i), apex_application.g_f03 (i));
end loop;
end;
-
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.
- Creation and use of RESTful Web application services Express 4.2
- Creation and use of RESTful Web application services Express 5.0
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 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 pleaseHello
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 export data from the table with the colouring of cells according to value.
Hi all
I use jdeveloper 11.1.1.6
I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?
You can find us apache POI-http://poi.apache.org/
See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html
-
I have a db access with a field called 'walkDate '.
Dates stored in this area are in the date format short j/yyyy.
I want to run a query to search for results where walkDate is the date of the valid form.
Dates of form are submitted in dd/mm/yyyy, but can't find my request date (I know that it exists).
If I simply query the db and do return the results of the walkDate field, it will return d/m/YYYY format 00:00:00.
Why - what is returns a date ODBC? and how can I compare dates? I compare the pieces separately?Fortunately for you, since walkDate is a date field and not a text field, access format is irrelevent.
Since the dates are also components, you must take those into account when comparing. One way to do that is,
Select somefields
of sometables
where walkDate > = #createodbcdate (form.date) #.
and walkDate< #createodbcdate(dateadd("d",="" 1,="">This is the general idea. You must do something to ensure that form.date is really a date of course.
-
How to publish data from a table using the form
Oracle forms6i
Hai All
I have download the data to the table of forms...
My table T1 columns are in, out, intrinsically, introut, empname, empno
and another table T2 consist of three columns is empno, date, time
In table T2 time fields consist of symbol I, o... I mean IN, O OUT
My Question is when an employee consist of 3 I - the three IN the time
0815 I, 1200 I, 1415 I and OUT 3 times O 1245, 1445 O, O 1715 and empno is 001
If there is no record for empno 001 then insert first 0815 I in table T1 in column IN time then
to update 1200 intrinsically and 1245 update to Introut and 1415 up-to-date addin and 1445 to update addout
Finally in 1715 to outtime
If it is possible to do without Hardcoding the moment Pls tell with some good example
Thanks in advance
Srikkanth.MThere now things are clear... whenever I have free I'll post the code u how to do this...
for now, a few tips can help u
-create the table to store operations travel so then u can't fix your code
-Create the cursor on the T1 line through all the records.
-Control what empno and action i.e. the current cursor (I or O) exists on the same date in T2 or not
-otherwise exists insert a new record check also the SHIFT is coming in time IF is between MAJ 0815 and 1645 and action is 'I' then insert record and column values accordingly
s ' there is, then update the record of the place where empno = cur.empno and attendance_date = mydate;
It may be useful
Baig,
[My Oracle Blog | http://baigsorcl.blogspot.com/] -
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 get into two different tables in two columns of a listbox of multi column
Hi all
I have two different tables of the values assume that table 1A (1,2,3,4,5) and another table B (3,4,5,6,7). I want to write these tables in a multicolumn listbox such as 1st column would be A array and 2nd column table B.
Thnx in advance
Saki,
I hope this helps to further
-
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.
My guess is that the SYS.user_segments table is a view based on the current user.create view sys_user_segments as select * from sys.user_segments; grant select on sys_user_segments to A;
Is there a way to share such data without creating a copy of the table?
Oracle: 10g
Thank youIf 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 copy data to a table row fixed to 1 of the 2 summary tables
You are looking for a solution copy specific data from a table of Inspection (which has a fixed/pre-determined number of lines) to 1 of the 2 summary table (has or B).
Think of it as a form of Inspection:
Each row in the table of Inspection with have a [Topic] inspected item field and and a drop-down menu to indicate the point whether or not inspected. If the user selects "Yes" for past, nothing happens. However, if the user selects "No" for not, an alert will be pop up asking if the topic should be added to the summary table A or B (perhaps through xfa.host.response).
Once the desired table is specified, the data of the subject field (from the current line of control) get dynamically add (new line) for the summary table shown. Note: the first field of each line of the or of analytical tables will have a topic area where will fill the data copied from the section (from the Inspection table).
That the inspection form is completed, the same process will occur as described above... for all the answers 'No', new lines should be added dynamically to the analytical table appropriate to the need (one for each "no" answer and auto-generated topic text).
Make sense?
Is this possible, or too complicated to achieve?
Thanks in advance!
Have a look here.
Kyle
-
Hello experts...
I'm new to this forum and Oracle coding complex.
I have a task in which I want to compare two tables with the same structure, same columns. My Oracle database is 11g Release 2. I want this column-by-column comparison and save the result in a separate table. (say result_table)
The structure of the table would be as follows:
SQL > desc emp;
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPNO NOT NULL NUMBER 4
ENAME VARCHAR2 (10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER (2)
SQL > emp_comp desc;
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPNO NOT NULL NUMBER 4
ENAME VARCHAR2 (10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER (2)
Both of the tables EMPNO is the primary key.
I want to compare these two tables based on the EMPNO (EMPNO even is both tables).
The result log table would be as follows:
SQL > create table result_table
2 (check_sr_no, number (5),)
table_name 3 varchar2 (30),
ROW_ID 4 varchar2 (20).
column_name 5 varchar2 (20).
6 column_data varchar2 (1000).
compared_by 7 varchar2 (10));
Table created.
SQL > alter table result_table
2 Add the constraint result_table_pk
3 primary key (check_sr_no);
Modified table.
The name of the table and the name of the column will not be hardcoded (based parameter by user)
I tried to use the dbms_comparison package, but do not find comparison of column to column.
I also used by using the query operator LESS. It's showing the difference in rank.
I also went to https://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:2151582681236
Your help will be very appreciated.
Thank you
DK
Tom Kyte has answered this question MANY times over the years. Here are links for its solution
https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:4934799800346640847
-
How to pass data to the tables according to the value of the first 4 digits of 7 strings of numbers
I want to sort incoming data, in several bays based only on the first 4 digits of each string.
For example, a hexadecimal string may be 41322033333533 which is A1 3353.
A1 is a sensor. particularly, and I want to send all data from the A1 to a table. I have 8 sensors data and want to send the data to separate the bays of sensor. My sensor names are A1, A2, A3, T1, T2, T3, W1
I will use a structure of the matter, for loop and a comparison of '=' for the data. However, I want to only compare the first 4 digits of the string and I can't find an operator for this. Any advice on how to proceed would be appreciated.
With a thread like this
-
How to insert data into the table of plain text stored as a CLOB in another table
Hi people,
Maybe it's an easy question for someone who is more frequently used files and CLOB.
I have a table that stores text files in the CLOB column. Files text includes some basic data that I want to load in the other - a text line = a new insert for me. Is there a "trick" how to do it effectively?
Here is my model:
Table OS_IMPORT_DOCS, stores the complete files as CLOB
Sample data from OS_IMPORT_DOCSSQL> desc OS_IMPORT_DOCS Name Type Nullable Default Comments ------------- -------------- -------- ------- -------- OBJECT_ID NUMBER DATUM_ZMENY DATE sysdate FILE_PATH VARCHAR2(4000) Y FILE_NAME VARCHAR2(4000) Y FILE_SIZE NUMBER Y LAST_MODIFIED DATE Y DOCUMENT CLOB Y STATUS VARCHAR2(15) Y 'NEW'
Example of file CLOB - stored text data (select d.document from os_import_docs d where d.object_id = 1815042 ;)SQL> select * 2 from os_import_docs d 3 order by d.last_modified desc 4 ; OBJECT_ID DATUM_ZMENY FILE_PATH FILE_NAME FILE_SIZE LAST_MODIFIED DOCUMENT STATUS ---------- ----------- ------------------------------ --------------- ---------- ------------- ----------- --------------- 1815043 13.8.2012 1 d:\data\C120813.DAT C120813.DAT 16800 13.8.2012 16: <<CLOB>> NEW 1815042 13.8.2012 1 d:\data\C120812.DAT C120812.DAT 3600 12.8.2012 22: <<CLOB>> NEW 1815041 13.8.2012 1 d:\data\C120811.DAT C120811.DAT 1800 11.8.2012 13: <<CLOB>> NEW
Above the example text includes "columns" in plain text:061053120820120000AGT000002Osoby 0000000042301000000017210632 062322120820120000AGT000002Osoby 0000000012301000000017197566 063526120820120001AGT000002Osoby 0000000012301000000017197566 064234120820120001AGT000002Osoby 0000000103301000000162218777
timestamp - 1-14, SSMIHH24DDMMYYYY position format
flag - post 15-18
company code - position 19-27
etc...
How can I query data stored within the OS_IMPORT_DOCS. The DOCUMENT column, divide it into columns and insert into another table?
I have to read this method of 'online' file?
Thank you very much
TomasFor the first three columns:
SQL> create type TRecord is object ( 2 ts timestamp 3 , flag varchar2(4) 4 , company_code varchar2(9) 5 ); 6 / Type created SQL> SQL> create type TRecordTable is table of TRecord; 2 / Type created SQL> SQL> create or replace function parse_clob (p_doc in clob) 2 return TRecordTable pipelined 3 is 4 lf number; 5 eol varchar2(2) := chr(10); 6 eollen number := length(eol); 7 line varchar2(32767); 8 offs number := 1; 9 begin 10 loop 11 lf := dbms_lob.instr(p_doc, eol, offs); 12 if lf != 0 then 13 line := dbms_lob.substr(p_doc, lf - offs + 1 - eollen, offs); 14 offs := lf + eollen; 15 else 16 line := dbms_lob.substr(p_doc, dbms_lob.getlength(p_doc) - offs + 1, offs); 17 end if; 18 pipe row ( 19 TRecord( 20 to_timestamp(substr(line, 1, 14), 'HH24MISSDDMMYYYY') 21 , substr(line, 15, 4) 22 , substr(line, 19, 9) 23 ) 24 ); 25 exit when lf = 0; 26 end loop; 27 end; 28 / Function created SQL> SQL> select t.* 2 from os_import_docs d 3 , table(parse_clob(d.document)) t 4 where d.object_id = 1815042; TS FLAG COMPANY_CODE -------------------------------------- ---- ------------ 12/08/12 06:10:53,000000 0000 AGT000002 12/08/12 06:23:22,000000 0000 AGT000002 12/08/12 06:35:26,000000 0001 AGT000002 12/08/12 06:42:34,000000 0001 AGT000002
Maybe you are looking for
-
Impossible to activate the unlock Mac with Apple Watch
I am running Sierra on a MacBook Pro 15 "retina early 2013 I have the first edition of Apple Watch, running Watch OS3 and iPhone iOS running 6-10. Everything is OK, except that I don't have the option to activate Mac unlock with watch in security set
-
Satellite M70-122 - what version of Windows XP do need me?
I want to download Windows XP Home Edition. What version should I need (OEM, retail) that have passed activation? At the back of the laptop in bed of certificate: Windows XP family 672 Russiansand the product keyXXXXX-XXXXX-XXXXX-XXXXX-XX320
-
I tried for the 9/8 to update these items. I received a different suggestion of microsoft systems "mssupport" of people. Nothing worked I had a similar problem on 8/25 and I see on the forum that Microsoft went back and corrected updates. I think tha
-
XP on a new build - want to just encode faster video to dv - avi, mpeg2 and mpeg4.
Hello, I am planning to build a new computer with a gigabyte MB z68 chipset. I don't want to use windows 7 due to a lot of old program that I really like. Will there be problems with the chipset drivers, and God knows what other drivers. I am now
-
Can I connect to the WiFi of someone else to print wireless from my iPhone?
I have a printer HP Photosmart 5525