Update multiple fields using select query efficiently – 9i
I need to populate a table called prop_charact used for synching data to a legacy system.
Prop_charact has fields that are found in a few other tables (no one field is found in more than one table outside of prop_charact). I want to pull the data from the corresponding fields in the source tables and put it into prop_charact. I only want to populate prop_charact with records that have been updated, but want to pull all fields for those records (whether or not that field has been updated). I am getting the list of updated records from a transaction history table.
After getting that list, I was not sure what to do with it.
I put what I want to do in terms of strictly SQL. I am thinking there are more efficient (less system resources) ways of doing this, but I am not sure what to pursue. I can use PL/SQL, but please keep in mind I am limited to using version 9i. Anyone have any hints about what I should look into using instead of just thes particular SQL statements?
insert into eval.prop_charact (parcelno, propertyid)
select distinct p.parcelno, p.propertyid
from eval.transaction_history tr,
admin.properties p
where tr.propertyid = p.propertyid
and trim(tr.tablename) in ('PROPERTIES', 'PROPERTYCHARACTERISTICS','EQID','NEWCHARACTERISTICS','DIMENSIONS', 'NON_RESIDENTIALS')
and trim(tr.fieldname) in ('BLDGCODE', 'CATCODE', 'UNFINISHED', 'TOPOGRAPHY', 'GARAGETYPE', 'GARAGESPACES', 'OPENSPACES',
'VIEW', 'GENERALCONSTRUCTION', 'YEARBUILT', 'ESTIMATEDYEAR', 'TOTALROOMS', 'TOTALBEDROOMS',
'BASEMENTTYPE', 'NUMBEROFFIREPLACES', 'HEAT', 'CENTRALAIR','CONDITION','SITE_TYPE','TOTALDWELLINGAREA',
'PLOTFRONT','PLOTDEPTH','PLOTSQFT','SHAPE','STORIES','FULLBATHROOMS','PARTBATHROOMS','MULTIPLE_BLDGS')
and tr.trans_date >= to_date('01-01-2010', 'MM/DD/YYYY')
and tr.trans_date < sysdate
order by p.parcelno;
update
select p.BLDGCODE pBLDGCODE, epc.BLDGCODE epcBLDGCODE, p.CATCODE pCATCODE,epc.CATCODE epcCATCODE,
p.UNFINISHED pUNFINISHED, epc.UNFINISHED epcUNFINISHED,
pc.TOPOGRAPHY pcTOPOGRAPHY, epc.TOPOGRAPHY epcTOPOGRAPHY,
pc.GARAGETYPE pcGARAGETYPE, epc.GARAGETYPE epcGARAGETYPE,
pc.GARAGESPACES pcGARAGESPACES, epc.GARAGESPACES epcGARAGESPACES,
pc.OPENSPACES pcOPENSPACES, epc.OPENSPACES epcOPENSPACES, pc.VIEW_ pcVIEW_, epc.VIEW_ epcVIEW_,
pc.GENERALCONSTRUCTION pcGENERALCONSTRUCTION,
epc.GENERALCONSTRUCTION epcGENERALCONSTRUCTION,
pc.YEARBUILT pcYEARBUILT, epc.YEARBUILT epcYEARBUILT,
pc.ESTIMATEDYEAR pcESTIMATEDYEAR, epc.ESTIMATEDYEAR epcESTIMATEDYEAR,
pc.TOTALROOMS pcTOTALROOMS, epc.TOTALROOMS epcTOTALROOMS,
pc.TOTALBEDROOMS pcTOTALBEDROOMS, epc.TOTALBEDROOMS epcTOTALBEDROOMS,
pc.BASEMENTTYPE pcBASEMENTTYPE, epc.BASEMENTTYPE epcBASEMENTTYPE,
pc.NUMBEROFFIREPLACES pcNUMBEROFFIREPLACES, epc.NUMBEROFFIREPLACES epcNUMBEROFFIREPLACES,
pc.HEAT pcHEAT, epc.HEAT epcHEAT, pc.CENTRALAIR pcCENTRALAIR, epc.CENTRALAIR epcCENTRALAIR,
e.CONDITION eCONDITION, epc.CONDITION epcCONDITION,
n.SITE_TYPE nSITE_TYPE, epc.SITE_TYPE epcSITE_TYPE,
d.TOTALDWELLINGAREA dTOTALDWELLINGAREA, epc.TOTALDWELLINGAREA epcTOTALDWELLINGAREA,
d.PLOTFRONT dPLOTFRONT, epc.PLOTFRONT epcPLOTFRONT,
d.PLOTDEPTH dPLOTDEPTH, epc.PLOTDEPTH epcPLOTDEPTH,
d.PLOTSQFT dPLOTSQFT, epc.PLOTSQFT epcPLOTSQFT,d.SHAPE dSHAPE, epc.SHAPE epcSHAPE,
pc.STORIES pcSTORIES, epc.STORIES epcSTORIES,
n.FULLBATHROOMS nFULLBATHROOMS,epc.FULLBATHROOMS epcFULLBATHROOMS,
n.PARTBATHROOMS nPARTBATHROOMS, epc.PARTBATHROOMS epcPARTBATHROOMS,
nr.MULTIPLE_BLDGS nrMULTIPLE_BLDGS, epc.MULTIPLE_BLDGS epcMULTIPLE_BLDGS
from eval.prop_charact epc, admin.properties p, admin.propertycharacteristics pc, admin.eqid e,
admin.dimensions d, eval.newcharacteristics n, EVAL.non_residentials nr
where epc.propertyid = p.propertyid and epc.propertyid = pc.propertyid and epc.propertyid = e.propertyid(+)
and epc.propertyid = d.propertyid(+) and epc.propertyid = n.propertyid(+) and epc.propertyid = nr.propertyid(+)
set epcBLDGCODE= pBLDGCODE, epcCATCODE= pCATCODE, epcUNFINISHED = pUNFINISHED,
epcTOPOGRAPHY = pcTOPOGRAPHY, epcGARAGETYPE = pcGARAGETYPE, epcGARAGESPACES = pcGARAGESPACES,
epcOPENSPACES = pcOPENSPACES, epcVIEW_ = pcVIEW_, epcGENERALCONSTRUCTION = pcGENERALCONSTRUCTION,
epcYEARBUILT = pcYEARBUILT, epcESTIMATEDYEAR = pcESTIMATEDYEAR, epcTOTALROOMS = pcTOTALROOMS,
epcTOTALBEDROOMS = pcTOTALBEDROOMS, epcBASEMENTTYPE = pcBASEMENTTYPE,
epcNUMBEROFFIREPLACES = pcNUMBEROFFIREPLACES, epcHEAT = pcHEAT, epcCENTRALAIR = pcCENTRALAIR,
epcCONDITION = eCONDITION, epcSITE_TYPE = nSITE_TYPE, epcTOTALDWELLINGAREA = dTOTALDWELLINGAREA,
epcPLOTFRONT = dPLOTFRONT, epcPLOTDEPTH = dPLOTDEPTH, epcPLOTSQFT = dPLOTSQFT,
epcSHAPE = dSHAPE, epcSTORIES = pcSTORIES, epcFULLBATHROOMS = nFULLBATHROOMS,
epcPARTBATHROOMS = nPARTBATHROOMS, epcMULTIPLE_BLDGS = nrMULTIPLE_BLDGS;
The following example may be of help.
SQL> create table mytable(col1 number(1),
2 col2 date);
Table created.
SQL> insert into mytable values(1,sysdate);
1 row created.
SQL> select * from mytable;
COL1 COL2
1 20-AUG-04
SQL> update mytable
2 set (col1,col2) = (select 2, sysdate-1 from dual);
1 row updated.
SQL> select * from mytable;
COL1 COL2
2 19-AUG-04
Similar Messages
-
Updating multiple fields using a single update statement.
Hi All,
I am a beginner to Oracle. I have used the following Hint in an update query that is executed in Oracle 10G. We recently updated the Oracle to version 11g and when executing the query getting the following Error: ORA-01779: cannot modify a column which maps to a non key-preserved table. PFB the query. Please suggest me some ways that I can do to avoid this error.
UPDATE /*+ bypass_ujvc */
(SELECT t1.STG_DEL_CONDITION, t2.condition
FROM stg_reports_membenft_latest T1 JOIN (select ods_ssn_grp,sys_id, first_value(STG_DEL_CONDITION) over(PARTITION BY ods_ssn_grp,sys_id
ORDER BY STG_DEL_CONDITION DESC) AS
condition from stg_reports_membenft_latest) T2
ON T1.ods_ssn_grp = T2.ods_ssn_grp AND T1.SYS_ID=T2.SYS_ID ) x
SET x.STG_DEL_CONDITION = x.condition;
Thanks and Regards,
Karthik Sivakumar.I used the below query and got the Result.
Thank You all
MERGE INTO stg_reports_membenft_latest x1
USING (SELECT distinct ods_ssn_grp,
sys_id,
First_value(STG_DEL_CONDITION) OVER(partition BY ods_ssn_grp,sys_id
ORDER BY STG_DEL_CONDITION DESC)
AS condition
FROM stg_reports_membenft_latest) x2
ON ( x1.ods_ssn_grp = x2.ods_ssn_grp
AND x1.SYS_ID = x2.sys_id )
WHEN matched THEN
UPDATE SET x1.STG_DEL_CONDITION=x2.condition; -
Multiple CHECKBOX Using Select Query in htmldb.item API
Hi,
I have a requirement where I need to create a Record using HTMLDB_APPLICATION.CHECKBOX ..but having multiple values(around 8) using the Select statement.
I tried the STATIC thing, but it shows only 2 values.
Is this possible ?
How ?
Thanks
Sandeephey sandeep--
i'm not sure at all what you're asking here. if this is still an issue for you, please restate it much more clearly.
thanks,
raj
ps-there is no htmldb_application.checkbox. -
Updating multiple fields ... need an advice.
Hello all,
I have a bit of a trouble with updating multiple fields in one table...
Lets say we have two tables. Table one is called t_employe for example:
create table t_employe (
year number,
line varchar2(1),
counter number,
value number)Lets set some random data into table:
insert all
into t_employe (year, line,counter, value)
values(2011,'3','2946','3344')
into t_employe (year, line,counter, value)
values(2011,'3','2947','4433')
into t_employe (year, line,counter, value)
values(2011,'3','2948','4455')
into t_employe (year, line,counter, value)
values(2011,'3','2949','5544')
select * from dualOk second table would be:
create table to_update (
year number,
line varchar2(1),
counter number,
date_pos_1 date,
value_pos_1 number,
date_pos_2 date,
value_pos_2 number,
date_pos_3 date,
value_pos_3 number,
date_pos_4 date,
value_pos_4 number,
date_pos_5 date,
value_pos_5 number)Data:
insert all
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2946',sysdate,'5434',null,null,null,null,null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2947',sysdate,'11',sysdate,'123',null,null,null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2948',sysdate,'33',sysdate,'44',sysdate,'8908',null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2949',sysdate,'1',sysdate,'2',sysdate,'343',sysdate,'78',null,null)
select * from dualOk now what i want to do is to update table to_update fields where value_pos is NULL. To explain it better imagine
collums are from left to right in that order value_pos_1, value_pos_2, value_pos_3 .... Now i would want to check for each row
if value_pos_1 is null ... if it is then update. Finist with this row and move to the next. If its not move to value_pos_2 in
same row and again check if its null. If it is ... update, if not, again move forward. Each cullum value_pos_X has a cullom date_pos_x
which has to be updated same as Value_pos_ cullums (if value_pos_X is null then coresponding date_pos_X will be null as well - thats
a fact in my table).
So is this doable by using only one update?
I manage to write a select statment using case clause which does those things perfectly only for value_pos_X fields. I wonder if i can use it in my
update statment?
select
case when a.value_pos_1 is null then b.value else
case when a.value_pos_2 is null then b.value else
case when a.value_pos_3 is null then b.value else
case when a.value_pos_4 is null then b.value else
case when a.value_pos_5 is null then b.value else to_number('99999','9999,99')
end
end
end
end
end as value
from to_update a,t_employe b
where a.year = b.year
and a.line= b.line
and a.counter = b.counter Any suggestions how to pull this one of?
Thank you!SQL> select *
2 from to_update
3 /
YEAR L COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
2011 3 2946 27-AUG-11 5434
2011 3 2947 27-AUG-11 11 27-AUG-11 123
2011 3 2948 27-AUG-11 33 27-AUG-11 44 27-AUG-11 8908
2011 3 2949 27-AUG-11 1 27-AUG-11 2 27-AUG-11 343 27-AUG-11 78
SQL> merge
2 into to_update a
3 using (
4 select a.rowid rid,
5 b.value
6 from to_update a,
7 t_employe b
8 where a.year = b.year
9 and a.line= b.line
10 and a.counter = b.counter
11 ) b
12 on (
13 a.rowid = b.rid
14 )
15 when matched then update set value_pos_1 = nvl2(value_pos_1,value_pos_1,b.value),
16 value_pos_2 = nvl2(value_pos_1,nvl2(value_pos_2,value_pos_2,b.value),value_pos_2),
17 value_pos_3 = nvl2(value_pos_1 + value_pos_2,nvl2(value_pos_3,value_pos_3,b.value),value_pos_3),
18 value_pos_4 = nvl2(value_pos_1 + value_pos_2 + value_pos_3,nvl2(value_pos_4,value_pos_4,b.value),value_pos_4),
19 value_pos_5 = nvl2(value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4,nvl2(value_pos_5,value_pos_5,b.value),value_pos_5)
20 /
4 rows merged.
SQL> select *
2 from to_update
3 /
YEAR L COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
2011 3 2946 27-AUG-11 5434 3344
2011 3 2947 27-AUG-11 11 27-AUG-11 123 4433
2011 3 2948 27-AUG-11 33 27-AUG-11 44 27-AUG-11 8908 4455
2011 3 2949 27-AUG-11 1 27-AUG-11 2 27-AUG-11 343 27-AUG-11 78 5544
SQL> Or yhis might be more readable:
merge
into to_update a
using (
select a.rowid rid,
b.value
from to_update a,
t_employe b
where a.year = b.year
and a.line= b.line
and a.counter = b.counter
) b
on (
a.rowid = b.rid
when matched then update set value_pos_1 = case when value_pos_1 is null then b.value else value_pos_1 end,
value_pos_2 = case when value_pos_1 is not null and value_pos_2 is null then b.value else value_pos_2 end,
value_pos_3 = case when value_pos_1 + value_pos_2 is not null and value_pos_3 is null then b.value else value_pos_3 end,
value_pos_4 = case when value_pos_1 + value_pos_2 + value_pos_3 is not null and value_pos_4 is null then b.value else value_pos_4 end,
value_pos_5 = case when value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4 is not null and value_pos_5 is null then b.value else value_pos_5 end
/SY. -
Need to update multiple records using store procedure
Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
for example my source is
emp_name sal
abhi 2000
arti 1500
priya 1700
i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
i have tried following code
create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
is
begin
open p_cursor for
select sal into p_sal from emp;
if sal<2000 then
update emp set sal= sal+200;
end i;f
end;
and i have called the procedure using following codes
set serveroutput on
declare
p_sal emp.sal%type;
v_cursor sys_refcursor;
begin
upt_sal(p_sal,v_cursor);
fetch v_cursor into p_sal;
dbms_output.put_line(p_sal);
end;
the program is executing but i should get o/p like this after updating
1700
1900
but i am getting first row only
2000
and record is not upsating...please help me with this
thanksHi Alberto,
thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
and i have similar kind of requirement where i need to deal with procedure which returns more than one row
my source is
empno ename salary
111,abhi,300
112,arti,200
111,naveen,600
here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
here i have written store procedure like this
create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
is
begin
open p_cursor for
select ename,salary into p_ename,p_salary from emp where empno=p_empno;
end;
and i have called this by using
declare
p_salary emp.salary%type;
p_ename emp.ename%type
v_cursor sys_refcursor;
begin
show_emp_det(111,p_ename,p_salary,v_cursor);
fetch v_cursor into p_ename,p_salary;
dbms_output.put_line(p_ename);
dbms_output.put_line(p_salary);
end;
here i should get
abhi,300
naveen,600
but i am getting first row only
abhi,300
but i want to fetch both rows...pls help me to find the solution -
To display 01 to 10 using select query
Hi all,
using select query...
In where clause...,
If u give 1 to 9 it should display 01 to 09 and
If u give 10 it should display as 10.
I want it in a single query .
Thanks & Regards,
Hariharan ST.Just need to build a where condition to the query posted by ascheffer -
Something Like this -
1 Select rn
2 From ( Select To_Char(ROWNUM, '09') rn
3 From Dual
4 Connect By rownum < 11
5 )
6 Where ( ( Trim(rn) < 10
7 And '&Param' = '1 to 9'
8 )
9 Or ( Trim(rn) = LPAD('&Param', 2, 0)
10 )
11* )
SQL> /
Enter value for param: 10
old 7: And '&Param' = '1 to 9'
new 7: And '10' = '1 to 9'
Enter value for param: 10
old 9: Or ( Trim(rn) = LPAD('&Param', 2, 0)
new 9: Or ( Trim(rn) = LPAD('10', 2, 0)
RN
10
SQL> /
Enter value for param: 7
old 7: And '&Param' = '1 to 9'
new 7: And '7' = '1 to 9'
Enter value for param: 7
old 9: Or ( Trim(rn) = LPAD('&Param', 2, 0)
new 9: Or ( Trim(rn) = LPAD('7', 2, 0)
RN
07
SQL> /
Enter value for param: 4
old 7: And '&Param' = '1 to 9'
new 7: And '4' = '1 to 9'
Enter value for param: 4
old 9: Or ( Trim(rn) = LPAD('&Param', 2, 0)
new 9: Or ( Trim(rn) = LPAD('4', 2, 0)
RN
04
SQL> /
Enter value for param: 1 to 9
old 7: And '&Param' = '1 to 9'
new 7: And '1 to 9' = '1 to 9'
Enter value for param: 1 to 9
old 9: Or ( Trim(rn) = LPAD('&Param', 2, 0)
new 9: Or ( Trim(rn) = LPAD('1 to 9', 2, 0)
RN
01
02
03
04
05
06
07
08
09
9 rows selected.Shailender Mehta -
Update Multiple Rows using Row Selector
Hi,
I want to update multiple rows using a tabular form with row selector, and an item in another region of the page, using an update expression and a button.
The syntax would be like this:
update MY_TABLE set UPDATABLE_COLUMN = :P10_NEW_VALUE where {row selector = true}
What is the syntax for the WHERE clause, anyone knows? In the manual there is no information at all for doing this.
PD. I added the row selector after creating the form, so I don't have any wizard-created MRU processes in the page.
HTMLDB version is 1.6
Thanks.Hi,
I want to update multiple rows using a tabular form with row selector, and an item in another region of the page, using an update expression and a button.
The syntax would be like this:
update MY_TABLE set UPDATABLE_COLUMN = :P10_NEW_VALUE where {row selector = true}
What is the syntax for the WHERE clause, anyone knows? In the manual there is no information at all for doing this.
PD. I added the row selector after creating the form, so I don't have any wizard-created MRU processes in the page.
HTMLDB version is 1.6
Thanks. -
Updating multiple tables using JDBC Adapter
Hi,
I am trying to insert/update multiple tables using one message via JDBC adapter. The following is the message being posted. However, only the first statement was executed. Anything wrong?
Thanks in advance!
Hart
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration"><DeliveryData><DelHeader action="UPDATE_INSERT"><table>DelHeader</table><access><DelNo>0080000230</DelNo><DelType>LF</DelType><XOverwrite>X</XOverwrite><ShipTo>0000000026</ShipTo><SoldTo>0000000026</SoldTo><Priority>00</Priority><DocDate>02/17/2007</DocDate><GText>CIF Test</GText><DelDate>02/20/2007</DelDate><PickDate>02/20/2007</PickDate><ShipPoint>NO02</ShipPoint><PackCount>00000</PackCount></access><key><DelNo>0080000230</DelNo></key></DelHeader>
<DelItem action="INSERT"><table>DelItem</table><access><DelNo>0080000230</DelNo><ItemNo>000010</ItemNo><GText>10# GRAN-GREAT VALUE</GText><Material>G04410G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BL</UOM></access><access><DelNo>0080000230</DelNo><ItemNo>000020</ItemNo><GText>25# GRAN- GREAT VALUE</GText><Material>G04025G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BG</UOM></access></DelItem></DeliveryData></ns0:DeliveryDBUpdate>Hi,
You need 2 STATEMENT level tags,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration">
<b><DeliveryData1></b>
<DelHeader action="UPDATE_INSERT">
<table>DelHeader</table>
<access>
<DelNo>0080000230</DelNo>
<DelType>LF</DelType>
<XOverwrite>X</XOverwrite>
<ShipTo>0000000026</ShipTo>
<SoldTo>0000000026</SoldTo>
<Priority>00</Priority>
<DocDate>02/17/2007</DocDate>
<GText>CIF est</GText>
<DelDate>02/20/2007</DelDate>
<PickDate>02/20/2007</PickDate>
<ShipPoint>NO02</ShipPoint>
<PackCount>00000</PackCount>
</access>
<key>
<DelNo>0080000230</DelNo>
</key>
</DelHeader>
<b><DeliveryData1></b>
<b><DeliveryData2></b>
<DelItem action="INSERT">
<table>DelItem</table>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000010</ItemNo>
<GText>10# GRAN-GREAT VALUE</GText>
<Material>G04410G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BL</UOM>
</access>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000020</ItemNo>
<GText>25# GRAN- GREAT VALUE</GText>
<Material>G04025G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BG</UOM>
</access>
</DelItem>
<b></DeliveryData2></b>
</ns0:DeliveryDBUpdate>
Try with such a strcuture and let us know if it works.
Regards
Bhavesh -
Multiple Value in additional fields using SAP Query
HI All,
I have a question related additional field in SAP Query. I tried to create report about PR and PO using SAP Query. Since one PR can be converted to multiple PO, I decided to create additional field
po_1
to display the value of PO that related to the PR. But I meet problem when I want to show several PO number in additional field
po_1
, I couldn't look the way to solve this problem. Can anybody help me? Just for info, I assign value to additional field
po_1
in record processing part.
Thanks....HI,
IN SQ02, IF table is already in JOIN, just click on the PLUS sign to expand the strcture.
All the field showing Plus sign in the strcture are selected in your query and with MINUS sing are no selected.
So you have to just click on the MINUS sign for the field you want to use through table field.
Generate the query and execute thriugh SQ01.
If you want to add some other field which is not a part of JOIN,
then click on EXTRAS Button shown in the MENU option.
Click on Create button and system will ask abt the additional field.
Regds,
Anil -
How to update multiple rows in one query using php
i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page
Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
In such a situation, you need four database tables as follows:
students (student_id, student_name, etc.)
courses (course_id, course_name, etc.)
students_courses (student_id, course_id)
attendance (student_id, course_id, dater)
A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one. -
Unable to update a field using the Data tab on a VIEW
When viewing data using a VIEW instead of going to the table directly, am unable to change the values in any of the fields
When I click on the list of VIEWs for a schema, then select a view that is based on a SELECT statement for a single table with a Primary key, and then click on the DATA tab to modify the value in one of the fields, SQL Developer does not allow me to change the value.
Went into SQL Plus, and was able to execute an UPDATE statement against the same row of that VIEW, and update that field ("UPDATE vw_mytable SET thisfield = 'YES' WHEN row_id_number = 1'").
Does SQL Developer not allow updating tables through a VIEW?
Will it allow updating in the future? Please say yes.
Oracle 10g DB and latest version of SQL Developer.Remember to add feature requests and vote on them on the SQL Developer Exchange!
<br>
<p>We have added updateable views to 1.1, but do remember, not all views are updateable - even in SQL*Plus.</p>
<br>
Sue -
Hi Team,
I have to select dynamic fields from database table GLT0.
This depends on period value given on screen.
If period is 01 then fields will be hsl01.
If period is 02 then fields will be hsl01 and hsl02.
If period is 03 then fields will be hsl01,hsl02 and hsl03 .
so on...till 12..
My code is throwing exception at select query.
"Error in module RSQL of the database interface."
My code :
*" Type declaration to store field name as per given period
TYPES : BEGIN OF y_fieldname ,
fieldname(10) TYPE c ,
END OF y_fieldname .
data t_fieldname TYPE STANDARD TABLE OF y_fieldname .
DO p_monat TIMES.
clear w_count .
MOVE sy-index TO w_count
IF sy-index LE c_9.
CONCATENATE c_hsl
c_0
w_count
INTO e_fieldname-fieldname.
APPEND e_fieldname TO t_fieldname.
ELSE.
CONCATENATE c_hsl
w_count
INTO e_fieldname-fieldname.
APPEND e_fieldname TO t_fieldname.
ENDIF.
ENDDO.
Get Local Currency Amounts
from table glt0 depending on period
SELECT (t_fieldname)
FROM glt0
INTO TABLE t_glto_with_saknr
FOR ALL ENTRIES IN t_bukrs
WHERE rldnr EQ c_00
AND rrcty EQ c_0
AND rvers EQ c_001
AND bukrs EQ t_bukrs-bukrs
AND ryear EQ p_gjahr
AND racct IN r_saknr.
Please guide me.
Thanking u in advance.
Sangeeta VermaHi Asik,
I m selecting all fields now as suggestd by u so in one record i have hsl01 to hsl12.
I have to calculate balance into e_glt0_bal-bal .This balance is summation of e_glt0_bal-hsl01 till e_glt0_bal-hsl12 (depending on monat).
I m using logic in process then
my code now :
data: w_monat_bal type string .
DO p_monat TIMES.
MOVE c_01 TO w_count .
CONCATENATE 'e_glt0_bal-hsl'
w_count
INTO w_monat_bal.
ASSIGN w_monat_bal TO <fs_monat_bal>.
e_glt0_bal-bal = e_glt0_bal-bal + <fs_monat_bal>.
w_count = w_count + c_01.
ENDDO.
But <fs_monat_bal> can not be added.
Giving exception :
Unable to interpret "e_glt0_bal-hsl01" as a number.
If I do <fs_monat_bal> type GLT0-hslvt instead to type any
Then assigning from w_monat_bal is not possible. -
Import Format script required to update multiple fields
Further to my previous post yesterday (Import Format script required to work across multiple fields I now need my import script to update multiple (two) fields at the same time, based on criteria set across multiple fields. So far, I can use DW.Utilities.fParseString to assess the values across multiple fields, but I now need to update not only the field in question, but also an additional field at the same time. For example:
Function TBService(strField, strRecord)
' How do I update a second field at the same time?
Dim strField2 As String
If Left(strField, 1) = "S" Then
If DW.Utilities.fParseString (strRecord, 3, 8, ",") = "B1110" Then
strField2 = "N101"
Else
strField2 = "Network N/A"
End If
TBService = strField
Else
TBService = "Service N/A"
End If
End Function
Is this even possible? Should I be looking at creating an event script which would work post-import? Or can this be done right here in the import script?All the logic you require can be encapsulated in the import script for the second field. You don't need to reference the second field in the first import script.
Edited by: SH on May 2, 2012 5:39 PM -
Update multiple UDF from one query generator
Hi All,
I have Form1 with multiple UDF1 which have been key in by users
And another Form2 with multiple UDF2 which exactly same with Form1 UDF1
Is there a way that I can copy multiple UDF at Form2UDF2 from Form1UDF1 instead of creating query for each individual UDF, where in query generator I can select more the one column but only first column will be insert to the single UDF.
ThanksHi Firos,
I mean I have 7UDF in the Payment Form where the information to this UDF are come from 7UDF in the invoice form which already created previously so I would like to copy those UDF from invoice to UDF in payment by using single query to capture all the UDF information by doing:
SELECT T0.[DocNum], T0.[UDF1], T0.[UDF2], T0.[UDF3], T0.[UDF4], T0.[UDF5], T0.[UDF6], T0.[UDF7]
FROM OINV T0 WHERE T0.[CardCode] = $[ORCT.CardCode]
From above query can I pass the result directly to UDF in Payment Form? or I need to create one query for each individual UDF.
Thanks -
Order mismatch in selected data using Select query
Hello Experts,
We are upgrading from 4.6C to ECC6. I came across a select query on a custom table, which gives different order of data from 4.6C to ECC6. Data (no. of records) is same in both the servers but order is different. Table doesn't have indexes in either 4.6C or ECC6. What would be the cause for order change?
Further, in 4,6C, ECC6 and data bases order of the data is totally different. Select query have some conditions in where clause with select options, but in both the cases (4.6C and ECC6) I am not passing any data from the selection screen so am getting entire data from the data base.
Thanks in advance
PhalaniFrom the SAP service market place I found that
1. Unless we use SORT or ORDER BY clause the order of the data is not in our control.
2. In 4.6C, two same select queries never give the result in the same order, if the primary key contains character fields.
Thanks for your help.
Phalani
Maybe you are looking for
-
App store on phone has switched to different region, how do I change it back?
Somehow when browsing the app store on my iPhone it's changed to US app store. My account is based in New Zealand and I can no longer download or update anything as it keeps telling me that I need to change the store to New Zealand but I don't know h
-
Is there a manuscript template for use with pages?
I'm attempting to recreate a manuscript i started with an older version of Word. Is there a template available for download to create and proof a full manuscript?
-
FM7.1 to FM10 : What are the advantages?
Hello, I have to use FrameMaker on Solaris, in a networked environment. Currently I am using 7.1 and want to move to 10. 7.1 already has serious issues with importing pdf files.(http://forums.adobe.com/thread/891661?tstart=30) You see I need to give
-
After effects installation error
Im trying to install after effects CS5, and i get this error. Exit Code: 7 -------------------------------------- Summary -------------------------------------- - 1 fatal error(s), 2 error(s), 28 warning(s) WARNING: Display requirements not met for {
-
How to make the car just like in the index of Flash cs5?
I am curious know how to make the car of the Flash cs5 index site ? Does it render from 3D model or we can create it from illustrator ?