I've started using Apex 4.2(new to Apex). I have built a form based on a table with a date column on it. The form allows update on all fields/columns of the base table. For the date field/column, the goal is to present the user with sysdate on load and update the date with sysdate if the record is changed any of the fields. How can I accomplish this?
How can we partition a table based on date if it does not have a date column.
Actually I have to compare two tables on daily basis and fetch few rows from those two tables and enter it to a third table.But both these tables does not have a date column.
I am confused if i need to alter those tables and add date column or if there is some way in which i can compare the data from the two tables for that particular day only and not the whole table data.
My requirment is to find out the period names and transactions which are in valid date formats and are less than sysdate and the non date formats are adjustments made by different users for their transactions
I want to load data from a file using sqlldr.I have a table commissions ( technician_id char(5) , tech_name char(30) , Comm_rcd_date DATE , Comm_Paid_date DATE , comm_amt number(10,2) )
my file is 00001,TIMOTHY TROENDLY,2011-03-04T01:45:12+0006,2011-03-04T01:45:12+0007,123.56 00002,KENNETH KLEMENZ,2011-03-04T01:45:12+0006,2011-03-04T01:45:12+0009,123.56 00003,SHUNDAR ARDERY,2011-03-04T01:45:12+0006,2011-03-04T01:45:12+0005,123.56 write a ctl file to load this data.
I have a partitioned table with ~50 million rows that was setup with a number(10) instead of a date column. All the data in the table is ALWATS in this format YYYYMMDD
CREATE TABLE T1.monthly ( SEQ_NUM NUMBER(10) NOT NULL, DAY_DK NUMBER(10) NOT NULL ) TABLESPACE USERS PCTUSED 0 PCTFREE 10 [code]........
When I use the exchange partition method the parition is able to move the data from "monthly" table to "mth" table.
desc t1.mth; ### my temorary table Name Null? Type ----------------------------------------- -------- ---------------------------- SEQ_NUM NUMBER(10) DAY_DK NUMBER(10)
Than when I try to alter my temp table "mth". I get an error table must be empty to change column types.
alter table n546830.mth modify (DAY_DK date);
Next I tried making my temporary table "mth" a date column. When I an the exchange partition command I get the following error:
alter table t1.monthly exchange partition DEC_2012 with table t1.mth without validation; alter table n546830.monthly exchange partition DEC_2012 with table n546830.mth without validation * ERROR at line 1: ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
Method I can use to convert a number(10) to date column and keep the information in a table. Note, I don't care about HH:MM:SS as I never had that information to begin with and would be happy to set that part of the date column to all zeroes "00:00:00"
As all of you know, In the Apex, when you create a form with report in the page, you are able to insert and edit data. But when you edit the data, the data will be modified in the same row. In other word, you loose the old data.
What I need to do is: I have revised_num field and production_date field. I want to create a form with report and insert and edit data as is in the apex and insert 0 to the revised num until production date is null. But when production date is not null, then from that point, I want to insert data to another row and modify revised num to 1. and I want the revised num be incremented by 1 each time the user modifies the data after the production date is not null.I don't know where I should start.
UPDATE event_request SET REQ_EVENT_DATE = TO_CHAR(REQ_EVENT_DATE - INTERVAL '1' HOUR, 'yyyy-mm-dd hh24:mi') WHERE eventID=123
Oracle returns this error:
ERROR at line 4:ORA-01861: literal does not match format string
where line 4 is REQ_EVENT_DATE = TO_CHAR(REQ_EVENT_DATE - INTERVAL '1' HOUR, 'yyyy-mm-dd hh24:mi').The REQ_EVENT_DATE field was originally populated with this stripped down query:
i have creatd view,in which i need to show the entry of year in column wise,though the data is in row /record wise.By iteration i can manipulate the year in decode function like " (DECODE(a.Year,(select distinct max(year)-1 from BI_BALANCE_SHEET), a.Balance))",but is there any way to chachge the alias name /column name,here is the query
select SUM(DECODE(a.Year,(select distinct max(year)-1 from BI_BALANCE_SHEET), a.Balance)) as year2010, SUM(DECODE(a.Year,(select distinct max(year)from BI_BALANCE_SHEET) , a.Balance))as Year2011 from DEMO a
By using the RETURNING clause i am getting the new updated value. I need the old value for some processing. Do i have to explicitly query it before the update stmt? Pls reply.
I need to update a column with tab delimited ie that column value should be tab delimited. Eg:- Url_name is the column and column values =[URL]. THe space between [URL] should be tab delimited. I wanted to use a update query to update this values with tab delimited.
Does "Update on a Partitioned Column" cause fragmentation ?
See example below :
Suppose I have a table as below that has approx 3 million rows and growing :
1) Table ABC : file_id number status_flag varchar2(1) file_Content clob date_created date
2) This table is list partitioned on Column "status_flag".
Column "status_flag" can take 3 values "A" or "B" or "C"
3) A file_id can transition from 1 "Status_flag" to another. [ A--> B , C--> B, B-->C, A --> C, etc ]
This means its possible to UPDATE the "status_flag " - the partitioned column.
Question : ------------- 1) Would the movement of rows from 1 partition to another cause fragmentation ? 2) Or Instead, should this be achieved by maintaining 3 tables - 1 each for every "status_Flag" as Table_A, Table_B, Table_C
This would mean that, if file_id 1, changes "status_flag" from 'A' to 'B' : -- The corresponding row from Table_A will be created in Table_B --- The same will be deleted from Table_A
This would still cause fragmentation ... with the overhead of Inserting a CLOB column from 1 table to another.
3) How to determine how much percent of the table is fragmented ?
my need is to perform merge - update when id column is matched, but one of others columns not.When id column is not matched then I perform insert.
It works fine for matched or not matched id column.
Commented code is my try to perform check for others columns, The code should not update when all columns match. It should update only when on of columns doesn't match (except id column of course, because it's key column).
begin merge into copy.table1 rr using ( select ID , DEALID , ESTIMATIONDATE , BOUNDOVERESTIMATDATE , ESTIMATIONTYPEID , MARKETAMOUNT , LIQUIDATINGAMOUNT , [code]....
I am encountering an error message while updating a xmltype column using dynamic sql statement. I am using dynamic sql here as the table is not placed in the same schema from where the plsql procedure is invoked. The schema name is passed to the procedure as an argument. I am using below pseudo code for this purpose.
Create procedure myproc(p_schemaname varchar2, p_id number) is p_clob clob; p_str varchar2(2000); begin
[code]...
This is throwing an error 'missing expression' at the line of 'exeute immediate'.
But it works if I run a static sql update by hard coding the schema name in the statement.
i have a table in my PD database which have more than 30,000 records .some records in a column say p_code is not tagged with code like '9876543'while other records are tagged in this column with code such as '19022345678'.
Now i want to update these records with tagging 1902 with each one .
I have to conditionally update a set of columns in a table. If the column status_code_stage_3 IS NULL THEN I have to update the column status_code_stage_2. The below query is giving error:-
Test Table create scripts CREATE TABLE test11( date_stage_3 date, reason_code_stage_3 varchar2(20), reason_code_stage_2 varchar2(20), opportunity_date date ) INSERT INTO test11 values(sysdate,'reason1',NULL,sysdate) INSERT INTO test11 values(sysdate,NULL,'reason2',sysdate)
[code]....
how to work out the update statement to use the conditional statement for columns.
i have to update a single column(x.c) in x table.here the condition is x.a is not null and x.b is not null x.d is null then update x.c=x.b for each row.
I have a scenario where I need to update field in report_input table.It has bind variables in it which will be prompted while running the query.I see that QUERY_VALUE field that need to be updated has length of VARCHAR2(3000).
desc report_input Name Null Type ----------------- -------- -------------- QUERY_NAME NOT NULL VARCHAR2(64) QUERY_VALUE NOT NULL VARCHAR2(3000) [code]....
I want update col1 whis is null to max(col1) ++ in a row, order by cr_date like 1,1,20110102 2,2,20110101 3,null,20110105 => 3,5,20110105 because this row is after 20110103 4,3,20110104 5,null,20110103 => 5,4,20110103 because this row is before 20110105
update test_table set col1 = (select max(col1) from test_table) + rownum where col1 is null;