Problem with merge statement
CREATE TABLE "XCR_DAILY_JOB_STATUS"
( "CAMPAIGN_ID" VARCHAR2(50 BYTE),
"REPORTING_DATE" DATE,
"REPORT_TYPE" CHAR(10 BYTE),
"STATUS" NUMBER(1,0) DEFAULT 0,
"CREATED_DTTM" DATE DEFAULT sysdate,
"UPDATED_DTTM" DATE
);
create or replace
FUNCTION fn_update_job_status (
p_campaign_id VARCHAR,
p_process_date DATE,
p_report_type VARCHAR,
p_process_status NUMBER
)
RETURN NUMBER
IS
PRAGMA AUTONOMOUS_TRANSACTION;
v_campaign_id VARCHAR (50) := TRIM (p_campaign_id);
v_process_date DATE := p_process_date;
v_process_status PLS_INTEGER := p_process_status;
v_report_type VARCHAR (32) := upper(trim(p_report_type));
v_err_num PLS_INTEGER := 0;
v_error_message VARCHAR2 (4000);
BEGIN
dbms_output.put_line(v_campaign_id || v_process_date || v_report_type || v_process_status);
MERGE INTO xcr_daily_job_status a
USING (SELECT v_campaign_id AS campaign_id,
v_process_date AS reporting_date,
v_report_type AS report_type, v_process_status AS status
FROM DUAL) b
ON ( upper(a.campaign_id) = upper(b.campaign_id)
AND a.reporting_date = b.reporting_date
AND a.report_type = b.report_type)
WHEN MATCHED THEN
UPDATE
SET a.status = b.status,
a.updated_dttm = SYSDATE
WHEN NOT MATCHED THEN
INSERT (a.campaign_id, a.reporting_date, a.report_type, a.status,
a.created_dttm)
VALUES (b.campaign_id, b.reporting_date, b.report_type, b.status,
SYSDATE);
COMMIT;
RETURN v_process_status;
EXCEPTION
WHEN OTHERS
THEN
v_err_num := SQLCODE;
v_error_message := SUBSTR (SQLERRM, 1, 4000);
DBMS_OUTPUT.put_line ('Error code ' || v_err_num || ': '
|| v_error_message
);
ROLLBACK;
RETURN v_err_num;
END;
When I train this time twoselect fn_update_job_status('cmp12105', to_date('17-JAN-2013','DD-MON-YYYY'), 'AUDIENCE', 1) from dual;
Instead of update of the old line, it will create the new line: (.)What could be the problem?
Published by: Mr. lonely on 14 March 2013 15:05
Is why REPORT_TYPE is of type CHAR (10 BYTES) in the table and v_report_type is of type VARCHAR (32) in proc, and then you do not need TRIM.
I suggest to use VARCHAR2 to both with the same length.
And also fix the date in proc comparison, AND trunc (a.reporting_date) = trunc (b.reporting_date)
Solve these and your problem will be solved, I tried and its working fine now.
Kind regards
Ankit Rouault
http://oraclenbeyond.blogspot.in
Tags: Database
Similar Questions
-
Problem with the State showed up in BB10
Hello
After the upgrade of my DevAlpha to the latest version, 10.0.9.1675, I have problems with 2-State buttons.
Example code:
#myBtn{ background-image: url(btn/myBtn.png); background-repeat: no-repeat; background-position: 0px 0px; } #myBtn:hover{ background-position: 0px -124px; }
So, when I click the button it stay frozen until steady-state, does not return to the default position. All my apps of ww are affected by this problem.
Anyone can attempt to reproduce this problem?
If so, what is the solution?
This is sort of the standard: hover behaviour I noticed in mobile browsers. Since then no cursor, hover is only simulated.
The simplest solution (and the one I use in my projects) is to use: active instead of: hover.
#myBtn:active{ background-position: 0px -124px; }
-
problem compiling with MERGE statement
What is the problem with this merge statement?
When I compile I get the message
met symbol IN when one of the following expected
*:= . (@ %; < a SQL > *)
MERGE INTO PF_REP_TEMP HAS
WITH THE HELP OF PF_REP_SKS B
WE (a. pf_userid = "FINP' AND B.pfbatch = 'F99' and B.pfstfno = A.pf_staffno
and B.pfcc = "7" and B.pftransmy = A.mmyy and B.slno = A.s_no)
When matched then
game update
a.pfwdrlm = b.pfwdrlm,
a.PFRC = b.PFRC;
Help, please
(version of the form is 10g, 11g database version)How to perform a merge into forms button pressed trigger command
-
Problem with MERGE INTO setting
Oracle Hello community,
Server: 11.1.0.7
My MERGE statement is very slow. I cut again and made a single update and a single insert statement, and it is much faster, the cause of a suspicion / * + rule * / use. When I try to use the same trick for the MERGE statement, it won't work, it still takes much too long. Before I post my Merge statement, is the problem with advice and FUSION?
IkrischerThanks for all the entries that you have provided.
What intrigues me is the fact that your cardinalities are always 1.
(Unfortunately I have no available DB 11.1)When I run the routine, all the tables are empty and all tables are analysed.
Can you describe your routine more in detail?
What measures are being processed?
Is it a kind of ETL process? At what point in your process are you collecting statistics and how?
Are you really using the command "scan table", or are you using "dbms_stats.gather_table_stats? -
Problem with diagram State Toolkit 1.0 - LV 8.2 upgrade to 2014
I'm in transition a large amount of code from Labview 8.2 to 2014, and I'm having a problem with state diagrams have been added using the state diagram Toolkit V1.0.
The figure below shows the question, Labview knows the loop and its components are associated with a state diagram, but it option to change the schema, "change the state diagram," is not available. In Labview 8.2, which I am currently running on older machines, I would simply select "Change the state diagram" and another window of each State and arrows between States appears, allowing the mounting of the diagram.
I think I have to install the state diagram Toolkit V1.0 software, but it is no longer available on the Web site of NOR. There are new States transitions module I installed, but it is significantly different from the old Toolbox and does not support. Any recommendations?
Thank you very much
PhilGood news:
(1) SDE still works with SP1 LV2014.
(2) I have the installer and I'm ready to send it to you. Please send me a private message with your email address.
Be sure to support this idea.
-
Hello
I'm new in plsql, so I need your help. I am rewriting the existing plpgsql function plsql function, but I have an error on line 15: PLS-00103: encountered the symbol "LOOP" when expecting one of the following values:
What is the problem with the LOOP statement?
FUNCTION to CREATE or REPLACE dothework (service_name text string_value)
RETURNS the text AS
BEGIN
DECLARE
result text;
varying (31) of tempId character;
tempFieldId bigint;
text of tempStringValue;
tempCount bigint;
BEGIN
result = ";
FOR IN tempId
SELECT ce.id FROM mfc.card_element this
WHERE the ce.name AS service_name
LOOP
tempCount = 0;
SELECT INTO tempFieldId mfc.card_field CF field_id
WHERE cf.field_name = 'NPAname ';
SELECT INTO tempCount count (*) FROM mfc.card_element_field_value cefv
WHERE the cefv.card_element_id AS a tempId AND field_id = tempFieldId;
IF tempCount = 1 THEN
UPDATE mfc.card_element_field_value
SET field_string_value = string_value
WHERE the card_element_id AS a tempId AND field_id = tempFieldId;
result: = result | tempId | 'UPDATE - YES,';
ELSIF tempCount = 0 THEN
INSERT INTO mfc.card_element_field_value (id, field_date_value, field_integer_value, field_string_value, card_element_id, field_id)
VALUES (HIBERNATE_SEQUENCE.nextval,
NULL,
NULL,
string_value,
tempId,
tempFieldId);
result: = result | tempId | "INSERT - YES, ';
ON THE OTHER
result: = result | tempId | "tempCount,";
END IF;
-END IF;
END LOOP;
RETURN result;
END;
END;
I did the same refatoring I program you unit and put comments to help to understand.
Let me know if it help you
FUNCTION to CREATE or REPLACE dothework (service_name in VARCHAR2
string_value IN VARCHAR2) RETURN VARCHAR2 AS
-Not necessary to define the new block here BEGIN-
-SAYS - you only need the instruction stated in this case if you
-believe that he can raise one exceptional and you want to manage block outsider
--
-You must set the buffer of varchar2
-32767 is the largest amount
RESULT VARCHAR2 (32767).
--
-You can dock this type for the column type, you will receive the data
tempfieldid card_field.field_id%TYPE;
-tempstringvalue VARCHAR2; -you do not use this variable
tempcount NUMBER;
BEGIN
-You don't need to initialize with NULL, in this case. PLSQL has done already for you
-THE RESULT: = ";
--
-It seems to me that this request can be outside of the loop
-Once the table is not the change and the predicate doenst change is
SELECT field_id
IN tempfieldid
Card_field FC
WHERE cf.field_name = 'NPAname ';
--
FOR tempid IN (SELECT ce.id
OF card_element this
WHERE the ce.name AS service_name) LOOP
-It is not necessary to initialize this variable to zero
-tempcount: = 0;
--
--
SELECT COUNT (*)
IN tempcount
OF card_element_field_value cefv
WHERE the cefv.card_element_id AS a tempid
AND field_id = tempfieldid;
--
IF tempcount = 1 THEN
UPDATE card_element_field_value
SET field_string_value = string_value
WHERE the card_element_id AS a tempid
AND field_id = tempfieldid;
RESULT: = RESULT | tempid | 'UPDATE - YES,';
ELSIF tempcount = 0 THEN
INSERT INTO card_element_field_value
(id
field_date_value
field_integer_value
field_string_value
card_element_id
field_id)
VALUES
(hibernate_sequence.nextval
NULL
NULL
string_value
tempid
tempfieldid);
RESULT: = RESULT | tempid | "INSERT - YES, ';
ON THE OTHER
-I remove the tempCount on the "because I think you want to see the number of records
-you do business with
RESULT: = RESULT | tempid | ' ' || tempCount | ', ';
END IF;
END LOOP;
RETURN RESULT;
-END;
END;
Best regards
-
Hello
I try to do the following in my report:
If an employee is a family name. (dot) or a name of. (dot), the report does not display a point. An employee name consists of the family name, first name and middle name, which should all be concatenated sets. An attempt to achieve this goal, I have the following statement in my report:
Decode (e.Surname, '.', (LTRIM (RTRIM ((INITCAP (e.FIRST_NAME))) |))) » '|| INITCAP (e.MIDDLE_NAME))),
e.FIRST_NAME, '.', (LTRIM (RTRIM ((INITCAP (e.Surname))) |)) » '|| INITCAP (e.MIDDLE_NAME))),
(LTRIM (RTRIM ((INITCAP (e.SURNAME))) | ',' |)) INITCAP (e.first_name) | » '|| INITCAP (e.MIDDLE_NAME))) as emp_name
E employee
Problem: The above statement only works for employees with the name of. (dot). It doesn't for the first names of dot. How to use the decode statement OR is there another way to do it without using the CASE statement?
It seems my decode statement does not work with 2 different fields (name, first name) tested within the decode statement. Thank you.LTRIM and RTRIM the comma too:
select rtrim(ltrim(rtrim(ltrim(', Somename ,',','),','))) Name from dual; NAME -------- Somename
-
Major audio problem with merged Clips
Try this once again, having a major problem since update works with merged clips. I merge all my video and audio clips into a project of prior work flow in first pro. I'll be shooting my images, tagged and synchronized in the project.
Because the first does not have more than 1 project open at the same time, I copied the files, closed before workflow project and opened my feature film project that I worked for. Copied clips merged bin, I click on a clip, video plays well, but there is no audio playback.
I try to import the project files of prior workflows by using the import project feature, keep that real merged clips (like the rest of my project is this way) still no sound. I cleaned my cache of media, reset preferences, even uninstalled first and redownloaded. Problem persists.
Can you help me understand what the question is whether I can go back to making progress on this feature of finishing project?
Here's my workflow and no problems so far. I do it this way because I found after all files in the project was originally crash constantly when I was working. I have a new I7' processor IMac with 24 GB of RAM. And since the first does not allow to open multiple projects at the same time (wish it would change. Avid and FCP both allowed several projects) that I have to do things this way.
Before workflow project file
Label all the video and Audio files to match the scene #' / takes
The value in points on all the video and audio in order to reflect the slate
Merge Clips
Functional project file
Import only Clips merged into Project. Import or copy/paste
Now, I did this workflow from the beginning about. Removing all the source video and all the audio clips of my work project remain while my bins containing my merged clips. Had no problem and edit has been smooth. Did a day pickup last week, followed the same steps as I did in the past, imported clips merged into my work project and clips have audio, set to none by default. Now, once I'm in the sequence I can manually set and this is, but I can't read the audio data in the source monitor, which is how to change, there is no reason, I should have to go back in the manner of the crappy editing with FCP copy and paste from a sequence.
Able to repro. Bug was noted.
-
I have problem with this code haven. It shows error illigical use of the else statement. I checked the syntax is at but I don't where is my problem
I have a drop drop list box. If the user selects objects in textfields txt_contract1 & txt_contract2 of named values has the new change.iam of java script. is it possible to programmetically edit from vb.net. IAM familiar with it.
DataRoot. Transmittal_pdf. DropDownList1::click - (JavaScript, client)
If
(xfa.event.newText == 'Strategic') { }
XFA. Form.DataRoot._Transmittal_pdf.
DataRoot._Transmittal_pdf. Table5.row2.txt_contract1. Value
= "Blueprint of strategic roads."
DataRoot._Transmittal_pdf. Table5.row2.txt_contract2. Value
= "These immediate plans."
}
on the other
{
DataRoot._Transmittal_pdf. Table5.row2.txt_contract1. Value
= "Held consultation projects;
DataRoot._Transmittal_pdf. Table5.row2.txt_contract2. Value
= "";
}
Hi Prasad,
'V' should be in the rawValue capital 'V' instead of small "v". So, it should be rather than rawvalue rawValue.
Thank you
Sidonie.
-
Problem with merging the accounts of Xbox games.
Dear Sir or Madam,
I am writing you about a problem I have with my accounts. I have one in windows live with PC games that I create in the second place, when I bought the XBOX. Possible is the merging of two account? I have this two accounts for a long time and I have a few games on them and I don't want two separate accounts. I am the holder of the account, so I can give you any details you need.
Yours faithfully,
Radek.Short answer: you can't do it. You basically have to decide which one you want to use and stop using it.
More information:
- Microsoft's answer to the combination of multiple accounts
- Microsoft link accounts
- Functionality of linked accounts Outlook.com Microsoft Drops
More help:
- The community is a good place to find answers to many of your questions how do and get advice from other users and members of the community. However, questions about your Microsoft account are not best dealt with in a public forum because of the personal information at issue. Click here to learn more about how to get help with your Microsoft account: where to get additional support for my account and information questions?
-
Hello! I want to create a button with text. The State of the button should be the title of the text and the pointed State will be a paragraph with a rectangle in the background and the title disappears.
I converted the title as button and I leave the paragraph text and draw the rectangle.
My problem is when my mouse went hover title, nothing happened and when I went to move the paragraph box and rectangle, they seemed.
Cannot choose the hover box? Can I create additional layers for rectangle and paragraph?
The first time I try to create this button, he had run, but when I replace a bad shot.
I'm working on the professional Flash CS6 and I use AS2. For example, I don't use THAT on my button, there is only 1 text converted to (title) button, 1 shape (rectangle) and 1 text (button).
Fight with a button make me sick, if nursing Flash can cure my illness there will be great
Good bye
Tom
If the invisible things in hover is the cause the invisible substance appears then looks that you have placed such things (text and background) under Hit of the button. The image clicked sets where the button interaction can occur. Make sure that you place only stationary flight controls in the frame over and no one else.
-
Hi all
I have a calculation in a report of Discoverer Desktop with 29 instructions BOX and still 2 case statements more to add. The problem is that my report freezes and fails to run due to the excessive number of case statements. I need to put the 31 statemnts cases in the report, how do I do this? Is there another way to do it without causing the report to freeze?
Below is part of my instructions box just to show you what I'm doing:
CASE WHEN Ex = 'MM' AND THEN of OTHER NULL result (', ')
CASES WHERE Ex = "PP" AND result IN (40,35,30,25) THEN NULL OTHERWISE
CASE WHEN Ex = he's ' AND result IN (' a ',' B', 'C', d ') THEN NULL OTHERWISE
-CASE WHEN Ex = 'IO' AND THEN of OTHER NULL result ('Distinction', 'Merit')
-CASE WHEN Ex IN ('ZZ', 'WW', 'SS', 'KK') AND ('PASS', 'P') THEN to ANOTHER NULL result...
The last statement should be BOX WHEN... THEN NULL OTHERWISE 1 END END END END...
Help, please. Thank you.Hello
You have reached the limit of characters in a calculation.Try to set into a single statement as follows:
CASE WHEN Ex = 'MM' AND THEN of OTHER NULL result (', ')
WHEN Ex = "PP" AND as a result (40,35,30,25) THEN NULL OTHERWISE
WHEN Ex = he's ' AND result IN (' a ',' B', 'C', d ') THEN NULL OTHERWISE
WHEN Ex = 'IO' AND THEN of OTHER NULL result ('Distinction', 'Merit')
WHEN Ex IN ('ZZ', 'WW', 'SS', 'KK') AND ('PASS', 'P') THEN to ANOTHER NULL result...The last statement should be BOX WHEN... THEN NULL OTHERWISE 1 END
Another option is to combine all the statements of NULL in a series of gold options like this:
BOX WHEN
(Ex = 'MM' AND the result in (', am')) OR
(Ex = "PP" AND result IN (40,35,30,25)) OR
(Ex = he's ' AND translated BY (' a ',' B', 'C', ')) OR
(Ex = 'IO' AND as a result ('Distinction', "according to merit")) OR
(Ex IN ("ZZ", "WW", "SS", "KK") AND result IN ('PASS', 'P')) THEN ANOTHER NULL...Best wishes
Michael -
Problem with the States and component in flex
I am trying to build this flex like this application
ExpertDiscoverySystem.mxml
<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = minHeight = "1280" '960' xmlns:component = 'rate' currentState 'SearchStart' = >
< s:layout >
< s:BasicLayout / >
< / s:layout >
< s: states >
< name s: State = "SearchName" / >
< name s: State = "SearchDomain" / >
< name s: State = 'SearchResult' / >
< name s: State = "SearchStart" / >
< / s: states >
< fx:Declarations >
<! - Place non-visual elements (e.g., services, items of value) here - >
< / fx:Declarations >
<!-< fx:Script >
<! [CDATA]
private void changeState (): void {}
this.currentState = 'SearchResult ';
searchpage.searchTerm.text = searchpage.getResult ();
}
[]] >
< / fx:Script >->
"" < XY = '0' mx:Image = '0' source = '... / image/background.jpg "includeIn ="SearchDomain, SearchName, SearchStart"/ >
<!-< s:TextInput '120,65' = x y = "507.8" width = "806" id = "searchText" includeIn = "SearchDomain, SearchName" / >
< s:Button "951" = x y = '508' label = "Find it!" id = "Search" includeIn = 'SearchDomain SearchName'-click = "" / >-->
< mx:LinkButton label = "Name" fontSize = "36" = "Verdana" includeIn = fontFamily click "SearchStart" = "currentState ="SearchName"" color = "#CE1717" enabled = "true" x = "383" y = "556" fontWeight = "bold" / >
< mx:LinkButton fontSize = fontFamily "36" = "Verdana" click = "currentState ="SearchDomain"" includeIn = "SearchStart" color = "#CC1C1C" label = "Domain" '656' = x y = "555" fontWeight = "bold" / > "
"< includeIn = 'SearchResult' x = '0' mx:Image = '0' source = '... /image/BackgroundSearch.jpg"/ >
< s:TextInput = 'SearchResult' x = "542.1" includeIn = "47.6" width = "576" / >
< s:Button = 'SearchResult' x = "1132" includeIn = '47.1' label = 'Search' id = 'Search2Button' / >
< includeIn: search for components = "SearchDomain" x = "250" y = "420" >
< / research components: >
< component includeIn: searchResult = 'SearchResult' id 'Advanced' = x = "29" y = "115" >
< / component: searchResult >
< includeIn: search for components = "SearchName" x = "250" y = "420" >
< / research components: >
< / s:Application >and the component
Search.MXML
<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:fx s:Group ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx" width = "800" height = "400" contentBackgroundAlpha = '0,0' xmlns:component = 'rate' >
< s:layout >
< s:BasicLayout / >
< / s:layout >
< fx:Declarations >
<! - Place non-visual elements (e.g., services, items of value) here - >
< component id: searchResult = searchedTerm = "{"Advanced"searchTextInput.text}" >
< / component: searchResult >
< / fx:Declarations >
< fx:Script >
<! [CDATA]
private void changeState (): void {}
this.currentState = 'SearchResult ';
searchpage.searchTerm.text = searchpage.getResult ();
}
[]] >
< / fx:Script >
< s:TextInput width = "572" id = "searchTextInput" x = "49" y = "83" / >
< s:Button label = 'find it!' id = 'search"click =" changeState () ""652"= x y ="84"/ >"
< / s:Group >and searchResult.mxml
<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:fx s:Group ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx" width = "900" height = "800" >
< fx:Declarations >
<! - Place non-visual elements (e.g., services, items of value) here - >
< / fx:Declarations >
< fx:Script >
<! [CDATA]
[Bindable]
public var searchedTerm:String;
public var searchCriteria:String;
public function getResult (): String
{
Return searchedTerm;
}
[]] >
< / fx:Script >
< s:Label x = '6' y = '13' text = "" you searched: "fontSize ="18"/ >"
< s:Label = "173" x = "13" fontSize = "18" id = "searchTerm" color = "#FF0000" / >
< / s:Group >The problems goes like this. I need to access my main of my search.mxml component mxml application state 'SearchResult', with my code view, it is impossible to access at all because the State 'SearchResult' was not include the search.mxml component
Is there anyway to access the State of my main application of my component?
Hello
Try to use FlexGlobals.topLevelApplication.currentState = 'SearchResult '; in your Search.mxml component.
Thank you
Jean Claude
-
Dear Sir.
My problem is with the merged Webhelp project. links to external topics are not active in the main project, although these links work fine in the HTML help output.
Thank you.Have you tried immediately to the notice to this link?
-
Hello
in my application, I would like something code you see in the code.
but this is not possible, because now I have two buttons with the id 1.
What is the best way to solve this problem? especially when you have a lot of buttons? I mean, I need the id when I want to withdraw the child...
Thank you!I think you need to rethink your statements. You try to add the same button in two States, which should not be necessary. You can base a State to another State, more specifically.
Also, you cannot use numbers as identifiers.
Maybe you are looking for
-
Satellite A350 - driver graphics card
Hello I have a question about the graphics card in my laptop I have radeon hd 3650 and I can not install new driver. When I download the driver from the ATI site they tell me that I have to find the drivers on the toshiba site, but I can't find them
-
2D Array element 1 duplicate an int and the other Date and time for the output to a file
Try to change the example labview Agilent 34401 acquire and graph - SW Triggered.vi to display the data in a file with a date/time stamp, display things in a file delimited by commas, it's very simple in PHP, C, C++, and I heard this thing of labview
-
Hi, I'm new here and hoping to get help with a problem to upgrade for my. HP Pavilion laptop dv61210sa. Original OS is Vista Home premium. All freshly installed wins 7 32-bit and updated all the drivers for hardware & software but have a minor proble
-
How to take that on my computer
I don't like this how can I take my computer and I can't open yahoo thanks
-
I did an upgrade of Win8 in my laptop with my hotmail account and everything went smoothly. But when I rebooted after one day, I was unable to connect with bad view password. After a lot of testing, I was able to find the keyboard on the screen, usin