Immediate help required with this update statement
update holds set area = (select newarea from stagesteps)
where holds.stage= stagesteps.stagename and holds.step = stagesteps.STEPNAME and holds.area is not null
When I do this, it says stagesteps.stepame is an invalid name..
Any helps on this highly appreciated.. btw Advance thanx for your help.
update holds h
set area = (select ss.newarea
from stagesteps ss
where ss.stagename = h.stage
and ss.stepname = h.step)
where area is not null
and exists (select null
from ss.newarea
from stagesteps ss
where ss.stagename = h.stage
and ss.stepname = h.step);You can leave off the EXISTS clause if there will be a guaranteed matching row in stagesteps for each row in holds, or if you don't care if area is set to null if there is no match.
Similar Messages
-
Immediate help required with this job scheduling scenario
I have a job that needs to run a procedure hourly but not between 6:00 AM to 8:00 AM and 6:00 PM to 8:00 PM.
Can anyone help me with how to schedule this job.If you use a window the job would only execute if the window opens. If for some reason the window did not open then the job would not execute.
Windows should be used to specify which resource plan should be active for the time interval.
In this case you are better off using FREQ=DAILY; BYHOUR=; and specify the hours. -
Help with this update statement..
Hi everyone,
I am trying to update a column in a table .I need to update that column
with a function that takes patient_nbr and type_x column values as a parameter.
That table has almost "300,000" records. It is taking long time to complete
almost 60 min to 90 min.
Is it usual to take that much time to update that many records?
I dont know why it is taking this much time.Please help with this update statement.
select get_partner_id(SUBSTR(patient_nbr,1,9),type_x) partner_id from test_load;
(it is just taking 20 - 30 sec)
I am sure that it is not the problem with my function.
I tried the following update and merge statements .Please correct me if i am wrong
in the syntax and give me some suggestions how can i make the update statement fast.
update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
merge into test_load a
using (select patient_nbr,type_x from test_load) b
on (a.patient_nbr = b.patient_nbr)
when matched
then
update
set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
there is a index on patient_nbr column
and the statistics are gathered on this table.Hi Justin,
As requested here are the explain plans for my update statements.Please correct if i am doing anything wrong.
update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
"PLAN_TABLE_OUTPUT"
"Plan hash value: 3793814442"
"| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |"
"| 0 | UPDATE STATEMENT | | 274K| 4552K| 1488 (1)| 00:00:18 |"
"| 1 | UPDATE | TEST_LOAD | | | | |"
"| 2 | TABLE ACCESS FULL| TEST_LOAD | 274K| 4552K| 1488 (1)| 00:00:18 |"
merge into test_load a
using (select patient_nbr,type_x from test_load) b
on (a.patient_nbr = b.patient_nbr)
when matched
then
update
set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
"PLAN_TABLE_OUTPUT"
"Plan hash value: 1188928691"
"| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |"
"| 0 | MERGE STATEMENT | | 274K| 3213K| | 6660 (1)| 00:01:20 |"
"| 1 | MERGE | TEST_LOAD | | | | | |"
"| 2 | VIEW | | | | | | |"
"|* 3 | HASH JOIN | | 274K| 43M| 7232K| 6660 (1)| 00:01:20 |"
"| 4 | TABLE ACCESS FULL| TEST_LOAD | 274K| 4017K| | 1482 (1)| 00:00:18 |"
"| 5 | TABLE ACCESS FULL| TEST_LOAD | 274K| 40M| | 1496 (2)| 00:00:18 |"
"Predicate Information (identified by operation id):"
" 3 - access("A"."patient_nbr"="patient_nbr")"Please give some suggestions..
what's the best approach for doing the updates for huge tables?
Thanks -
Immediate help required with decode statement in scheduling jobs
Hi
Iam trying to change a job that runs my procedure using dbms_job.. Here is the output I got.
Can someone help me why this is giving me errors.
<code>
SQL> exec dbms_job.next_date(395,decode(sign(substr(to_char(sysdate,'dd/mm/yy hh24:mi'),10,2)-17),-1,'trunc(sysdate) +18.5/24',1,'trunc(sysdate)+1+6.5/24'));
BEGIN dbms_job.next_date(395,decode(sign(substr(to_char(sysdate,'dd/mm/yy hh24:mi'),10,2)-17),-1,'trunc(sysdate) +18.5/24',1,'trunc(sysdate)+1+6.5/24')); END;
ERROR at line 1:
ORA-06550: line 1, column 30:
PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL
statement only
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
</code>
Thanks in advanceA possible solution:
declare
v_next_varchar varchar2(30);
v_next_date date;
begin
select decode(sign(substr(to_char(sysdate,'dd/mm/yy hh24:mi'),10,2)-17),
-1,'trunc(sysdate) +18.5/24',
1,'trunc(sysdate) +1+6.5/24'
into v_next_varchar
from dual;
execute immediate 'select ' || v_next_varchar || ' from dual ' into v_next_date;
dbms_job.next_date(22, v_next_date);
commit;
end;Bye, Aron -
HELP! With parsing Update statement
I am stuck and need help! The teacher has not gone over parsing with us and it is not on his scheduled topics list. But, I am a person that likes to scope out and learn new things. For our final project, we have to allow updates, delete and inserts into the 5 main tables of the Premiere Products database. I have done everything except for the updates. I can achieve the updates of the entities by pretty much hardcoding them and that is okay by the teacher, but I want to learn about parsing because Barbara from this site mentioned this to me.
This is what I was able to write and I am getting errors:
CREATE OR REPLACE PROCEDURE updatecust_proc (
v_cust_num IN customera.cust_num%TYPE,
v_attributetoupdate VARCHAR2 ,
v_updatedvalue VARCHAR2 )
AS
e_invalidcustnum_error EXCEPTION;
BEGIN
v_isvalidcustnum := iscust(v_cust_num);
IF (v_isvalidcustnum = FALSE) THEN
RAISE e_invalidcustnum_error;
END IF;
PARSE(
'UPDATE customer
SET' | | v_attributetoupdate | | '=' | | v_updatedvalue | |
'WHERE cust_num =' | | v_cust_num
END;
EXCEPTION
WHEN e_invalidcustnum_error THEN
DBMS_OUTPUT.PUT_LINE('Cannot be updated. Invalid customer number');
END;
Any help would be useful. I went to the Oracle help site but their examples are a little too complicated for me to understand, plus, I am not using any C code.
Thanks in advance!
BobI will try putting in spaces to the areas that you mentioned to me. Thanks!
I will try to explain the function just in case some other poeple don't understand what I am trying to do.
This procedure is supposed to update the CUSTOMER entity. This entity has 7 attributes and I don't want to write out 7 UPDATE statements to changes a value. Instead, I want the name of the attribute to be passed to the proceudre so that the UPDATE statement can know which attribute to use. Barbara mentioned something about parsing and I attempted to try it out, but I am getting errors. Can someone help me with the procedure. BTW, function iscust() returns TRUE if the customer number is valid, otherwise, it returns false.
Thanks,
Bob -
What is wrong with this update statement
Hi all,
I am trying to create a simple update program that allows user to enter table name, key fields and one field to update and its value.
But report goes into dump at update statement?
Here is the code:
REPORT ZTABLE_UPDATE.
parameters: tabname(18).
PARAMETERS: key1(15),"use at where condition
key1val(20),
key2(15),"use at where condition
key2val(20),
field2(15)."field to be updated
PARAMETERS: yenideg1(20),
yenideg2(20).
CONDENSE: tabname, field2,
yenideg1, yenideg2,
key1val, key2val,
key1, key2.
data: wa like tabname.
*update (tabname) SET field2 = yenideg1*
*WHERE key1 like key1val and key2 like key2val.*if sy-subrc eq 0.
SELECT SINGLE * FROM (tabname) INTO wa
WHERE key1 like key1val
and key2 like key2val.
WRITE / wa. "to test whether replacement is ok.
endif.
Thanks in advance.
DenizHi:
follows is ok:
DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
ifc TYPE lvc_t_fcat,
xfc TYPE lvc_s_fcat.
DATA: it_clrs_fields LIKE TABLE OF dfies WITH HEADER LINE.
DATA: cond(72) TYPE c,
itab LIKE TABLE OF cond,
itab2 LIKE TABLE OF cond.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>,
<fs>.
PARAMETERS: tabname TYPE ddobjname OBLIGATORY.
PARAMETERS: key1(15) OBLIGATORY,"use at where condition
key1val(20) OBLIGATORY,
key2(15),"use at where condition
key2val(20),
field2(15)."field to be updated
PARAMETERS: yenideg1(20),
yenideg2(20).
***START
CONDENSE: tabname, field2,
yenideg1, yenideg2,
key1val, key2val,
key1, key2.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = tabname
TABLES
dfies_tab = it_clrs_fields[]
FIXED_VALUES =
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3
LOOP AT it_clrs_fields .
MOVE-CORRESPONDING it_clrs_fields TO xfc.
APPEND xfc TO ifc.
CLEAR: xfc.
ENDLOOP.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
CLEAR COND.
CONCATENATE key1 ' = ''' key1val '''' 'AND' INTO cond.
APPEND cond TO itab.
CLEAR COND.
CONCATENATE key2 ' = ''' key2val '''' INTO cond.
APPEND cond TO itab.
SELECT *
INTO <dyn_wa>
FROM (tabname)
WHERE (itab).
ENDSELECT.
IF sy-subrc <> 0.
WRITE / 'no this data in dbtab'.
EXIT.
ENDIF.
CLEAR COND.
CONCATENATE field2 ' = ''' yenideg1 '''' INTO cond.
UPDATE (tabname) SET (cond)
WHERE (itab).
IF sy-subrc EQ 0.
SELECT SINGLE * FROM (tabname) INTO <dyn_wa>
WHERE (itab).
WRITE / <dyn_wa>. "to test whether replacement is ok.
ENDIF.
you alse can use:
FM: VIEW_MAINTENANCE_CALL can used to do table maintenance.
note:
1.to do Table Maintenance Generator.
2.be authorized to to use tansaction sm30.
好运,
启明星 -
I can't find the 2G, 3G and LTE options after updating to iOS8.1, can anyone help me with this? I'm using iPhone5s
I have check on my service provider about the correct APN settings, but unfortunately doesnt work still..
-
Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon
See these previous discussions help.
App Store Updates (but only Updates)...: Apple Support Communities
Apps suddenly don't update: Apple Support Communities -
(The iPhone "Named" cannot be restored at this time because the iPhone software update server could not be contacted or is temporarily unavailable.)
can anyone help me with this issue, every time i try to restore it will come up like this error message.Restore the iPhone when connected to iTunes by cable.
Still the same TS1275?
Is your iPhone jailbroken?
Or
Has your computer ever been used to jailbrake or downgrade (Tinyumbrella) any iPhone? -
I have updated to the latest version of iPhoto. But now iPhoto will not let me amend the preset text in the text boxes.
the text is highlighted for a nano second but it will not stay highlighted so that I can add my own text.
can anyone help me with this issue.
Many thanksYou might try using the add-on 'NoSquint' which allows numerous zoom options specific to each page you visit & keeps your settings - https://addons.mozilla.org/en-US/firefox/addon/nosquint/
If you want to go back to 3.6x, you will find it here:
http://www.mozilla.com/en-US/firefox/all-older.html
In most cases you can simply "upgrade" (meaning downgrade) directly from the installation. It would be a good idea to save your passwords & bookmarks just to be on the safe side. -
Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying “attempt to access invalid address” then “application not responding” Suggestions how to access would be much appreciated. Tks. Stuart
What is the size of your hard disk? PSE 4 is a very old program and I suspect it is not able to access the entire hard disk on your machine. Just a thought here.
-
Mail on my Mac computer does not update when I update my mail on my iPhone and iPad. Can anyone help me with this? Is there a setting that I need to check?
All that you had to do was to sign into the old account in order to update those apps. What I mean is that you just needed to sign into that account in the store settings like I described and that should have worked. You didnt need to enter the credit card information again - you justed needed to use the old ID and password.
Anyway, I think the good news is that if everything else is OK with the new account, just download iBooks with the new ID - it's a free app so its not like you have to pay for it again. I'm not sure what the other App is that you are talking about - but if it is the Apple Store App - that is free as well.
Try this anyway, when you try to update iBooks, just use the old password if the old ID still pops up.
Did you try signing into the store settings with your new ID and see what happens with the updates then? -
I understand there is a way to use my Super Drive with my PC. However, it requires a System OS Disk. Which I never received. Can you help me with this?
Rick6812 wrote:
I'm using Windows 8.1.
I do not know what you mean by a Windows 8.1. Please clarify.
The Apple superdrive is designed to be used with the following Macs.
It will not work with any other Mac unless you perform this modification;
http://www.tuaw.com/2012/04/02/use-the-macbook-air-superdrive-with-any-almost-ma c/
Are you trying to get it to work with a PC?
Ciao. -
I have recently fully updated my mac to 10.8.2 and i am trying to install a small facebook application but every time i come to chose the disk it says ' OS X facebook developer preview can not be installed on this disk. This volume of this disk does not meet the requirements for this update' any ideas on how to get round this?
thanksThat may be the new Mountain Lion "sandbox" protective software kicking in, possibly, because ML "thinks" that App doesn't meet ML's new strict security requirements. A common phenomena. If you feel the 3rd party App is really OK, you can override this feature and install the new App by holding down the Command key when you click to install the new App. That's one possibility for the error message appearing. If not, another possibility is that that Developer Preview software package requires some previous piece of software be installed prior to downloading this Preview. You would have to check the Facebbok websiste's Developer Forums for help if this is the case.
Hope this helps -
Please help me with this statement
Hi gurus, glad to be back!
Please help me with this XML processing statement. The XMl I get is like this,
<EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit"
effectiveDate="1859-01-01">
<Text>26</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>221.291.4</Text>
</AssociatedValue>
I need to get the number value from <Text>26</Text>, the attribute description and the text value of <Text>221.291.4</Text> inside one of those AssociatedValue node. The following is what I have, though I get the 26, I do not get the description and I get the Misdemeanor, Petty Misdemeanor concatenated with the text value of <Text>221.291.4</Text>. The output I get is this,
26
MisdemeanorPetty Misdemeanor221.291.4MisdemeanorPe
4
MisdemeanorPetty Misdemeanor221.291.4MisdemeanorPe
My Code:
declare
v_xml sys.xmltype;
v_sid number;
v_SText varchar2(50);
begin
v_xml := sys.xmltype('<SimpleTypeCompanion>
<EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit" effectiveDate="1859-01-01">
<Text>26</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>221.291.4</Text>
</AssociatedValue>
</EnumerationValue>
<EnumerationValue description="Police Communication Equipment-Possession, Use-First Offense-M" effectiveDate="1859-01-01">
<Text>4</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>299C.37.1(b)</Text>
</AssociatedValue>
</EnumerationValue>
</SimpleTypeCompanion>');
---dbms_output.put_line(v_xml.getStringVal());
declare
cursor c_statutes is
select ms.* from
xmltable('for $s in /SimpleTypeCompanion/EnumerationValue/Text
let $sa := /SimpleTypeCompanion/EnumerationValue/AssociatedValue
let $sd := /SimpleTypeCompanion/EnumerationValue/@description
where $sa/@type = "StatuteOrdinanceRuleCite"
return
<MyStatutes>
<TextID>{$s}</TextID>
<SDesc>{$sd/@description}</SDesc>
<StatuteNumber>{$sa/Text}</StatuteNumber>
</MyStatutes>'
passing v_xml
columns
myTextID number path '/MyStatutes/TextID',
mySDesc varchar2(150) path '/MyStatutes/SDesc',
myStatute varchar2(50) path '/MyStatutes/StatuteNumber'
) ms;
begin
for v_s in c_statutes loop
dbms_output.put_line(v_s.myTextID);
dbms_output.put_line(v_s.MySDesc);
dbms_output.put_line(v_s.myStatute);
end loop;
end;
end;
Please show me the correct way to get the result I want.
Thanks a lot!
BenSQL> var xmltext varchar2(4000)
SQL> --
SQL> begin
2 :xmltext :=
3 '<SimpleTypeCompanion>
4 <EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit" effectiveDate="1859-01-01">
5 <Text>26</Text>
6 <AssociatedValue type="SeverityLevelText" code="MSD">
7 <Text>Misdemeanor</Text>
8 </AssociatedValue>
9 <AssociatedValue type="SeverityLevelText" code="PMD">
10 <Text>Petty Misdemeanor</Text>
11 </AssociatedValue>
12 <AssociatedValue type="StatuteOrdinanceRuleCite">
13 <Text>221.291.4</Text>
14 </AssociatedValue>
15 </EnumerationValue>
16 <EnumerationValue description="Police Communication Equipment-Possession, Use-First Offense-M" effectiveDate="1859-01-01">
17 <Text>4</Text>
18 <AssociatedValue type="SeverityLevelText" code="MSD">
19 <Text>Misdemeanor</Text>
20 </AssociatedValue>
21 <AssociatedValue type="SeverityLevelText" code="PMD">
22 <Text>Petty Misdemeanor</Text>
23 </AssociatedValue>
24 <AssociatedValue type="StatuteOrdinanceRuleCite">
25 <Text>299C.37.1(b)</Text>
26 </AssociatedValue>
27 </EnumerationValue>
28 </SimpleTypeCompanion>';
29 end;
30 /
PL/SQL procedure successfully completed.
SQL> set lines 150
SQL> --
SQL> select ms.*
2 from xmltable
3 (
4 '/SimpleTypeCompanion/EnumerationValue'
5 passing xmltype(:xmltext)
6 columns
7 DESCRIPTION varchar2(32) path '@description',
8 STATUTE_ID number(2) path 'Text/text()',
9 STATUTE_RULE_CITE varchar2(16) path 'AssociatedValue[@type="StatuteOrdinanceRuleCite"]/Text/text()',
10 MSD_TEXT varchar2(10) path 'AssociatedValue[@code="MSD"]/Text/text()',
11 PMD_TEXT varchar2(10) path 'AssociatedValue[@code="PMD"]/Text/text()'
12 ) ms
13 /
DESCRIPTION STATUTE_ID STATUTE_RULE_CIT MSD_TEXT PMD_TEXT
Motor Carriers-Operate w/o Certi 26 221.291.4 Misdemeano Petty Misd
Police Communication Equipment-P 4 299C.37.1(b) Misdemeano Petty Misd
SQL>
SQL>
Maybe you are looking for
-
ABAP Program back ground scheduling issue.
Hi experts, I am trying to execute a ABAP program in a process chain but the job log shows me the following message "Object XXXXXXX of class RE and language PT not exist" XXXXX is the ABAP program name. Even i tryed to excute the ABAP program itself
-
Is this possible in CS4? Sharing video links?
I have used CS4 for a while but nothing very complicated so not sure if this is even possible. What I want to do is build a DVD with several episodes all using the same intro & ending + have a play all button; Like this Start - Episode 1 - Ending Sta
-
Merge Fields with Content Controls
Hello everybody, we are using word templates to generate quotations in print form. This process worked fine using the old Technology (custom XML). Because a newer Version of Microsoft Office is now being used, the technology has been updated to the n
-
Backup Storage - Aperture Vault versus Time Machine versus daily SuperDuper
What value does dumping the Aperture library to an Aperture Vault give in addition to running Time Machine to one drive and a daily SuperDuper copy to a second drive with irregular SuperDuper copies to an external drive that can be removed from the m
-
Fix for crash caused by conflict with Joesoft Hear software
Here's information about a fix for the crash in After Effects & Premiere Pro CS5 caused by a conflict with the Joesoft Hear audio enhancer: http://bit.ly/hyqEZ4