Update lines
I have a question, and here is the data for this:
Table1:
NUM name address date_value
1 xxx addr1 date1
1 xxx addr1 date1
1 yyy addr2 date2
1 yyy addr2 date2
1 zzz addr3 date3
1 zzz addr3 date3
I need to update this table
I need to put the num 1, 1 A and 1 B respectively for xxx, yyy, and zzz names
So it should be
NUM name address date_value
1 xxx addr1 date1
1 xxx addr1 date1
-1A yyy addr2 date2
-1A yyy addr2 date2
1-B zzz addr3 date3
1-B zzz addr3 date3
How is that possible?
Thank you
Infact you can use this:
update table1 a set a.num = (a.num || (select decode(suffix,1,NULL,('-'||CHR(suffix+63))) from (select num ,name ,RANK() OVER (PARTITION BY num order by name) suffix from table1 group by num,name) b where a.num = b.num and a.name = b.name));
This will update according to your requirement.
1
1-A
1-B
Please let me know if you have any questions.
See you soon
AJ
Tags: Database
Similar Questions
-
Updated line deleted Adobe all my drawings
The last updated line of Adobe (Version 1.0.1) deleted my work. He even deleted the work of the sample that was there when I started the application. Why is this and how do I get it back? Why my work is not registered in the cloud?
It's ridiculous, disturbing and very disappointing.
Hello Roscografik,
We submitted version 1.0.2 to the App Store to resolve the bug that caused drawings should be deleted. When you use 1.0.2 you drawings must be restored.
-
Update line in the column-based database
Hello
I am trying to find a way to update a row that has a SQL database based on two columns. If the command and the match number sensor order number and sales sensor that already exists in the database, I want to update the column of reading of the sensor. If not exists then I want that it creates a new line. How would I go to do this?
Thank you
Chris
You can use the tools of DB Query.vi Execute. Here is an example of a MS Access 2010 database where a column value is updated in all rows satisfying the WHERE conditions.
Ben64
-
update line using sinlge selection
Hello
I have the situation where I get results for the region of the table using option of single selection for each line...
That the results of the line I am updating records for few records of entity attributes from the form VO, but there are two primary keys for the table are not part of the form.
In doing so, I get errors like:
java.sql.SQLException: ORA-01400: cannot insert NULL into ("DCDHR". "" "" DCDHR_ERGR_UPD '. "" EMPLOYEE_ID')
Table a. employe_id, case_number are mandatory columns
Here is the code:
Co:
tstgupdVOImpl evo = am.gettstgupdVO1 ();
If ("radiochk".equals (pageContext.getParameter (EVENT_PARAM)))
{
String rowRef = (String) pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Line OARow = (OARow) am.findRowByRef (rowRef);
tstgsearchVORowImpl lineRow = (tstgsearchVORowImpl) am.findRowByRef (rowRef);
If (lineRow! = null)
{
If ((row.getAttribute("CaseNumber").toString ())! = null)
{
String CaseNum = row.getAttribute("CaseNumber").toString ();
throw new OAException ("is" + perIdValue, OAException.INFORMATION PersonId selected);
If (CaseNum! = null)
{
[Serializable] parameters = {CaseNum};
am.invokeMethod ("initAttachmentDetails", parameters);
}
}
}
}
If (pageContext.getParameter ("Update")! = null) {}
If (evo. Last()! = null)
{
am.getOADBTransaction () .commit ();
OAException message = new OAException ("saved... files", OAException.CONFIRMATION);
pageContext.putDialogMessage (message);
}
}
Am:
{} public void initAttachmentDetails (String CaseNum)
If (CaseNum! = null) {}
System.out.println ("number of cases obtained and transmitted to AM is:" + CaseNum);
tstgupdVOImpl vo = gettstgupdVO1 ();
{if(vo!=null)}
vo.exeattachmentQuery (CaseNum); the definition of this method will be written in VOimpl.java of VO attached to the area of the table
}
}
}
public void exeattachmentQuery (String CaseNum)
{
System.out.println ("-exeattachmentQuery in VoImple is called");
If (CaseNum! = null) {}
System.out.println ("number of cases referred is NOT NULL");
setWhereClause("CASE_NUMBER=:1");
setWhereClauseParams (null); Always reset
setWhereClauseParam (0, CaseNum);
executeQuery();
System.out.println ("the request is:" + getQuery());
}
}
Please help because I'm stuck.
Thank you
MK
or you can also try
Dim empID = this.getCurrentRow ().getAttribute("EmployeeId").toString ();
See you soon
AJ
-
Update line programmatically with Composite primary keys
Hi all
I use JDeveloper 11.1.2.4.0,I want to update the program with two primary keys PK1_ID and PK2_ID line
When I have a primary key I can do it by:
/////////////////////////////////////////////////////
Key = new key (new Object() {empid});
Employees1ViewImpl vo = (Employees1ViewImpl) this.getEmployees1View1 ();
Locate the line using key reference in the View object.
Line k = vo.getRow (key);
using this method, we can set the new FirstName
k.setAttribute ("FirstName", "Vero");
this.getDBTransaction () .commit ();
///////////////////////////////
Is it possible to use the same code with more of primary key?
Kind regards
The key class contains an array of attributes that identify the line you're looking for. In your case, the key has two attributes
Key = new key (new Object() {pkId1, pkId2});
the rest of the method works as what.
Timo
-
Hi all
I use JDeveloper 11.1.2.4.0,I want to update the line by program, but I know not where to write the code in managed bean or to object class or class object
and how to write?
Kind regards
Write the update method of the Application Module Impl class, as shown here:
http://Nitesh-Java.blogspot.com/2013/10/update-attribute-value-in-view-object.html
You can:
1 make the method in the app module which takes the parameters (IE, the values for your attributes).
2 export this customer for the App module interface method:
Oracle ADF - tips and Techniques: model ADF - Beginner: AMImpl expose methods like client interface
3. Add the
method to the pageDef and call support bean: Immerse yourself in Oracle: ADF: call the PageDefinition method programmatically
-
Update lines as a whole within a group of similar records.
Hello gurus
I want to update the records in my table in a set of similar batch numbers. See details as follows:
Suppose that my table is to have according to the structure with the following lines:
Table name: Test
Columns: 1) Level_number number (5)
(2) Batch_number number (5)
The table data looks as follows
Level_Number Batch_number 1 1 1 2 2 3 3 3 3 3 3 3 4 5 Now, I want to update the batch number column, based on the number of the level
The level number is to start form 100 for example.
The lot number will be the same for the same level number.
When to change the level number, the lot number should increase by 1 and continue up to the next level.
The condition is that if any number of level is to have as much for more than 5 lines then it should increase the number of lots after every 5 rows with the new lot number.
The output should look as follows
Level_Number Batch_number 1 100 1 100 1 100 2 101 2 101 3 102 3 102 3 102 3 102 3 102 3 103 3 103 4 104 5 105 Could you please help me to write the correct loop for this.
Thank you.
Hello
My mistake; I should have used CEIL instead of TRUNC.
DENSE_RANK always returns numbers starting with 1. If you want numbers that begin with 100 (that is, more than 99) then add 99, like this:
WITH got_luster AS
(
SELECT level_no
CEIL (ROW_NUMBER () OVER (PARTITION BY level_no
ORDER BY NULL
)
/ 5
) LIKE the chandelier
OF the test
)
SELECT level_no
DENSE_RANK () OVER (ORDER BY level_no
chandelier
) + 99 AS batch_number
OF got_luster
ORDER BY level_no
batch_number
;
Output:
LEVEL_NO BATCH_NUMBER
---------- ------------
1 100
1 100
2 101
2 101
2 101
2 101
2 101
2 102
2 102
2 102
2 102
2 102
2 103
3 104
-
update line and reset the value of the column
I have table (CORS_MTR) with 3 columns...
SEQ ID of the EPR the ID of the child / / desc 100 22 1 one 101 22 2 two new entry as 1 number , that means change the flow of child #
102 22 3 three When I enter the new line in number of children 1 instead of 2 and then the values of the column (child id, desc) another need to be reset as...
SEQ ID of the EPR the ID of the child / / desc 100 22 2 two 101 22 1 one 102 22 3 three 103 22 4 four SEQ PRT_ID CHILD_ID DESC_ 100 22 1 one 101 22 2 two 102 22 3 three declare
number of p_seq: = 103;
number of p_prt_id: = 22;
number of p_child_id: = 1;
p_desc varchar2 (25): = 'a ';
Start
Update cors_mtr
set seq = case when child_id = p_child_id
then seq + 1
other seq - 1
end
where prt_id = p_prt_id
and child_id (p_child_id, p_child_id + 1);
insert into cors_mtr (seq, prt_id)
values(p_seq,p_prt_id);
Update cors_mtr
Set child_id = (select max (child_id) + 1 of the cors_mtr).
desc_ = (select to_char (to_date (max (child_id) + 1, 'J'), 'jsp') of cors_mtr)
where child_id is null.
end;
SEQ PRT_ID CHILD_ID DESC_ 100 22 2 two 101 22 1 one 102 22 3 three 103 22 4 four Concerning
Etbin
-
Example of API: update line, selling price
Hello
Context: EBS 11.5.10. Level price (No. Advance Pricing)
I would be grateful if someone could send an example of the API used to update customer unit sale price of command line.
Currently, we use oe_order_pub.process_line, the problem seems that no adjustment is generated by the API (as it does to manually update the price of the line).
Thanks for your help
Concerning
AntoineYou can do it through
oe_order_pub.process_order
API. The following parameters are useful when you pass the info to fit for a sales order.
l_adj_rec.list_header_id := 8988; -- Modifier id l_adj_rec.list_line_id := 16596; -- Modifier line id l_adj_rec.automatic_flag := 'N'; l_adj_rec.list_line_type_code := 'DIS'; -- Change this if it is a surcharge, pass 'SUR' l_adj_rec.arithmetic_operator := 'AMT'; -- Percentage or amount l_adj_rec.operand := 10; --How much? l_adj_rec.operation := oe_globals.g_opr_create; l_adj_rec.line_index := 1; l_adj_rec.update_allowed := 'Y'; l_adj_rec.applied_flag := 'Y'; -- Rhis is required to change the price of the line l_adj_rec.change_reason_code := 'MANUAL'; l_adj_rec.change_reason_text := 'Manually applied adjustments';
Also at the level of the line, the following parameter should be checked.
p_line_tbl (1) .calculate_price_flag: = 'P '.Check out the following MOS notes:
How to use the OE_ORDER_PUB. PROCESS_ORDER Api for manual adjustment or application of freight? [959783.1 ID]
Can use an oe_order_pub.process_order API to create a new order line with a different price than the sale price list? [1072272.1 ID]
Pricing of the API to check if a modifier line qualifies for a sales order line id [ID 1220034.1]
Processing order API - how Scripts [ID 1265721.1]
FAQ on the command import [ID 1275116.1]
Process of PLC control in the management of orders [ID 746787.1]
Order API - errors / problems [ID 1266249.1]For details, please see the following threads:
https://KR.forums.Oracle.com/forums/thread.jspa?threadID=684887
https://KR.forums.Oracle.com/forums/thread.jspa?threadID=1122898See you soon,.
ND
Use the buttons "useful" or "correct" to award points to the answers / mark the thread as answered, if your question is answered. -
updated line and insert them into another table with trigger.
Hi guys I have a table that looks like this.
I'm going to insert the col1 and col2 values, but I need to get the value of column 3 of table 2 and then insert the complete record in table 3. I love doing that with a trigger. I get an error message and I can't for the life of me figuere out what im doing wrong.CREATE TABLE TEST ( "COL1" VARCHAR2(20 BYTE), "COL2" VARCHAR2(20 BYTE), "COL3" VARCHAR2(20 BYTE) )
So here is my nonfunctional trigger.
Here are the two table
HERE IS THE CODE OF THE TRIGGERCREATE TABLE TESTTABLE ( "COLUMN1" NUMBER(15,0), "COLUMN2" NUMBER(15,0) ) Insert into TESTTABLE (COLUMN1,COLUMN2) values (1,5);
I get an error of trigger mutation that I tried the other iterations of the above but I'm not getting anywhere. I have dumb down my problem at these 3 table.CREATE OR REPLACE TRIGGER TRIGGER1 AFTER INSERT ON TEST FOR EACH ROW BEGIN update TEST SET COL3 = (SELECT COLUMN2 FROM TEST, TESTTABLE WHERE COLUMN1 = :new.COL1); END
Can someone point me in the right direction.You'll have to do some reading, but it comes down to process the data on education instead of line level.
You may even be not at all a trigger.
See:
http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936 -
Update lines with the info from the other rows in the same Table.
I'm trying to update the lines with the information of the same table. The table is loaded with information from a report that runs and there must be a new entry every month, but I would like to bring some of the info from the last month. This statement below works but updates all rows in the new load table and in my test case, I only did a few game only like 5 files need to get updates. It is an example of what I'm trying to do. If I add this (C2. COL_INVC_ID = C1. COL_INVC_ID) until the last "* where *" statement get an invalid identifier for 'C2 '. COL_INVC_ID ". So what I'm doing wrong here? How can I update only the lines where also in recent months run?
Thanks in advance for any help!
------------
Update OpenIssues OI1
Together (OI1. NUM, OI1. Status, OI1. Code, OI1. LastModifiedDate) =
(Select ios2. NUM, ios2. Status, ios2. Code, ios2. LastModifiedDate
Of OpenIssues ios2
Where OI2.num = OI1.num and ios2. TableLoadDate = TO_DATE (January 31, 2012 00:00:00 ',' ' the HH24: MI: SS DD/MM/YYYY)
)
Where and OI1. TableLoadDate = TO_DATE (February 29, 2012 00:00:00 ',' ' the HH24: MI: SS DD/MM/YYYY)
------------
SQLMeAs Frank suggested merger is much effective here, go...
create table temp as( select 1 eno, 1 amt , sysdate load_date from dual union all select 1 eno, 2 amt , add_months(sysdate,1) load_date from dual union all select 2 eno, 1 amt , sysdate load_date from dual union all select 2 eno, 2 amt , add_months(sysdate,1) load_date from dual ); merge into temp t using (select eno, amt, load_date from temp where trunc(Load_Date) = TO_DATE('05/30/2012', 'MM/DD/YYYY')) s on ((s.eno = t.eno) and trunc(t.Load_Date) = TO_DATE('06/30/2012', 'MM/DD/YYYY')) when matched then update set t.amt = s.amt; commit; select * from temp;
-
Updated lines and default values.
This is my last thread for a while. My final problem with my apex application is related to the update of lines.
I have a tabular presentation to display several rows for a table and want to add a hidden 'updated_by' and 'last_updated' column. I put their default values such as user name and sysdate that work well for new records, but how each line to add these to existing records?
I use 4.02 on 11g.Hi Craig,.
Have you considered using a trigger on the table instead of setting these values from the app? A few advantages are: less logical in the app, especially if these inserts/changes can come from several pages, and once the trigger is implemented it will define values independently from changes and insertions (your form, another form, a non-ApEx client app, etc.).
CREATE OR REPLACE TRIGGER biu_mytable BEFORE INSERT OR UPDATE ON mytable REFERENCING NEW AS new OLD AS old FOR EACH ROW BEGIN :new.updated_by := NVL(v('APP_USER'), USER); :new.last_updated := SYSDATE; END biu_mytable;
Any insert or update triggers the shutter, define two columns. The NVL call handles the case when a customer non-ApEx brings the insert or update. If APP_USER has a value (ApEx logged-in user), the trigger uses it; Otherwise, it uses the database user ID.
Hope this helps,
JohnIf you find this information useful, please indicate the 'useful' or 'correct' post so that others benefit. *
-
ORA-00936: lack of Interface STEP expression for update flag lines
Hello world!
We have an interface that retrieves data of essbase and the load into a table target Oracle.
We use the Modules (KM) following Knowledge:
LKM Hyperion Essbase DATA SQL
IKM SQL incremental update
When we run the interface, at the stage of 'flag to update lines', we get the following error
Stage: 'make update'
Error: ORA-00936: lack of expression
This is definition message tab:
ODI-1228: Exportar Presupuesto General (integration) task fails on ORACLE ODI_STAGE connection target.
Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: lack of expression
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)
This is CODE tab:
Update HYP_INT. I _TRG_PRESUPUESTO_ESS_GENERAL $
Set IND_UPDATE = 'U '.
When there is)
Select 'X '.
of HYP_INT. TRG_PRESUPUESTO_ESS_GENERAL T
where
)
We do not know why query created the interface has some missing statements when the sql is created. Do you think that a lack or settings or just something worng or a bug?
The ODI client version is ODI_11.1.1.7.0_GENERIC_130128.1205
You give us any suggestions to fix this?
Any suggestions would be very helpful!
Thank you
Ivan Lemus
Since you're using IKM of SQL incremental update, you must mark a logical key on the fields of your target.
This key allows the comparison for insert and update.
-
Why SESSION 1 can see the line update?
Question:--- SESSION 1 SQL> select * from test; ID NAME ----- -------- 1 A 2 B 3 C SQL> update test set name = 'D' where id = 1; 1 rows updated SQL> SQL> rem uncommitted this transaction SQL> SQL> select * from test; ID NAME ----- -------- 1 D 2 B 3 C ---- SESSION 2 SQL> SQL> select * from test; ID NAME ----- -------- 1 A 2 B 3 C SQL> SQL>
Why SESSION 1 can see the line update? If the transaction had not been validated. before you see the updated row, which the database to submit to win the line?
I know that SESSION 2 can not see the update line, since it occurs compatible read.Lonion wrote:
--- SESSION 1 SQL> select * from test; ID NAME ----- -------- 1 A 2 B 3 C SQL> update test set name = 'D' where id = 1; 1 rows updated SQL> SQL> rem uncommitted this transaction SQL> SQL> select * from test; ID NAME ----- -------- 1 D 2 B 3 C ---- SESSION 2 SQL> SQL> select * from test; ID NAME ----- -------- 1 A 2 B 3 C SQL> SQL>
Question:
Why SESSION 1 can see the line update? If the transaction had not been validated. before you see the updated row, which the database to submit to win the line?SESSION 1 can see the data that changed since the SESSION 1 fact change.
I know that SESSION 2 can not see the update line, since it occurs compatible read.
-
Insert/update of the lines in tabular form from one table to another table
Hello
I'm having a tabular presentation for a table (equip_test) with 2 columns (equip_id, equip_name). I create a new
Button (submit_alt) in this tabular form. I need to insert or update lines that are changed in this table to form
another table (equip_staging) when you press the submit_alt button. How can I do this? How can I identify which lines are
Insert or update? The process of the page I am trying since this button is
But it does not work. Help, pleasebegin FOR i in 1..APEX_APPLICATION.G_F01.count LOOP insert into equip_staging values(APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F03(i)); END LOOP; end;
Thank you
TJUnchecking (does not) the column is a problem. Use this SQL instead (which is included in my examples):
SELECT empno, empno || apex_item.hidden (33, wwv_flow_item.md5 (ename, sal, job)) empno_display, ename, sal, job FROM emp
and join this column hidden from your display column. In this way, it should work. When you feel there is no data found message in the treatment in a table, it will mean that the id does not exist.
Denes Kubicek
------------------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------------------
Maybe you are looking for
-
Pavilion dv8t-1000 CTO: 64-bit compatibility win 10
After upgrade to Windows 7 to win 10 HP Advisor issues a message at the start that it has stopped working. cannot be started manually. Why this is happening and how to fix it if possible.
-
My iPad is no longer able to print wireless
My HP Photosmart 5514 worked very well now, it will not print except HP ePrint email! I can no longer print directly from Photos or Pages. All of my connections are good. Why won't it print? I use iPhone Personal Hotspot as a router between my iPad a
-
Security updates fail (KB2655992 KB2691442 KB2698365 KB2719985)
I received four security updates this week and all fail to install: KB2655992 KB2691442 KB2698365 KB2719985 I am running Windows XP SP3
-
Failure message from the graphics card Dell Inspiron 580 s
Hello A week ago I was on my PC and I get a black screen, saying: my graphics card has failed and needs to restart the PC. So I did and it worked perfectly afterwards, so I don't think anything at the time. Yesterday, I got exactly the same problem o
-
BlackBerry Smartphones download programs
Hello Is there anyway that I can use my phone to download applications like poker? I downloaded a poker app to play for fun, and I can't find the file anywhere on my phone... It is a .exe file and said it saved on the card of support, but I can't se