A Procedure doesn't update some rows in pre-prod while it does in dev box.

Hi All,
There are some data rows in a master table STG_CON in both environments(DEV and PRE_PROD). Making changes to any of these rows should be reflected in the CON table after the procedure is run, however it only seems to work reliably in DEV, but failes to update some rows in PRE-PROD.
Our oracle stored procedure: USP_APPLY_CON which we have to deploy over production, but before that, I am afraid, it should not fail to update some rows in CON table alike pre-prod.
Please suggest what could be problem, why all rows are getting updated in DEV but fails in PRE-PROD, though everything looks same.

Here is my procedure: USP_APPLY_CONTACT, which should insert the data from STG_CONTACT to CONTACT table, all required columns are present in CONTACT table. Please have a look over it, I don't guess there is any issue with procedure.
CREATE OR REPLACE PROCEDURE "COPILOTFIREPR2_ADMIN"."USP_APPLY_CONTACT" AS
-- This stored procedure is used to copy data from staging table to "contact" ta
ble.
-- Update if record exists, insert otherwise.
-- When error occurs, record get throw away.
BEGIN
DECLARE CURSOR cur IS
SELECT *
FROM stg_CONTACT;
rcdcnt NUMBER(10, 0) := 0;
errMsg varchar2(255);
BEGIN
FOR rec IN cur
LOOP
SELECT COUNT(*)
INTO rcdcnt
FROM CONTACT
WHERE CONTACTNO = rec.CONTACTNO;
BEGIN
IF rcdcnt = 0 THEN
INSERT INTO CONTACT (
ID, LOCATIONCODE, CONTRACTNO, CUSTOMERNO, CONTACTNO,
FIRSTNAME, LASTNAME, TITLE, ADDRESSID, DECISIONMAKER, PRCCONTACT, ACTIVE)
VALUES (CONTACT_ID_SEQ.NextVal, rec.LOCATIONCODE,
rec.CONTRACTNO,
rec.CUSTOMERNO,
rec.CONTACTNO,
rec.FIRSTNAME,
rec.LASTNAME,
rec.TITLE,
rec.ADDRESSID,
rec.DECISIONMAKER,
rec.PRCCONTACT,
rec.active);
ELSE
UPDATE CONTACT SET
ACTIVE=rec.active, FIRSTNAME=rec.FIRSTNAME, LASTNAME=rec.LASTNAME, TITLE=rec.TI
TLE, ADDRESSID=rec.ADDRESSID,
DECISIONMAKER=rec.DECISIONMAKER, PRCCONTACT=rec.PRCCONTACT, LOCATIONCODE=rec.LO
CATIONCODE,
CONTRACTNO=rec.CONTRACTNO, CUSTOMERNO=rec.CUSTOMERNO
WHERE CONTACTNO=rec.CONTACTNO;
END IF;
EXCEPTION
WHEN OTHERS THEN
errMsg := SQLERRM;
insert into errorlog("ID", "USERNAME", "APPDOMAIN", "MESSAGE", "FORMATTEDMESSAG
E", "EXCEPTIONTYPE", "SERVERNAME" )
values ( ERRORLOG_ID_SEQ.NEXTVAL, 'COPILOTFIRE_ADMIN.USP_APPLY_CONTACT', 2,
'KEY is '||to_char(rec.CONTACTNO), errMsg, '','');
END;
END LOOP;
END;

Similar Messages

  • I updated some security issues and suddenlly my gmail does not open. it shows 75% of the procees and does not go on

    I updated automatically some security issues in my computer (I don't remember which) and now my gmail will start opening until it reaches 75% and it will not go on opening.
    I can open it Internet explorer but not in Mozila fireworks

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Updating a row of a table using rowid

    Hi folks,
    I am trying to update some rows in a table using rowid of the corresponding rows.Sometimes this updates wrong rows. This is because ORACLE by itself makes some statistics on the particular table using "Analyze table..." statement and it changes the order of the rowids. But if I delete the statistics,the updation works fine. Is there any way to update the correct rows and also to keep the statistics created by ORACLE? P.s: I am using ORACLE thin Driver to connect to Oracle 8.1.6
    Thanks,
    Karthi.

    First make it clear: analyze table command never changes ROWIDs. Actually, the ROWID of a row never changes untill it's deleted from its table. So make sure if you are using the correct ROWID.
    Thnx

  • SQL Procedure doesn't work with "current of cursor" Oracle 11g

    hi all
    i have written a procedure which should update every row for a given column on a given table.
    here is the code:
    CREATE OR REPLACE PROCEDURE "xxx"."loop_update_autowert_x"
    startwert number,
    column_name VARCHAR2,
    table_name varchar2
    AS
    stmt varchar2(2000);
    stmt2 varchar2(2000);
    zaehler number;
    sum_gesamt number;
    TYPE obj_ref_type IS REF CURSOR;
    obj_cur obj_ref_type;
    begin
    stmt2:='select rownum , rowid from ' || table_name || ' for update';
    OPEN obj_cur FOR stmt2;
    dbms_output.enable(1000000);
    dbms_output.put_line ('Startwert ist: ' ||startwert);
    dbms_output.put_line ('Column Name ist: ' ||column_name);
    dbms_output.put_line ('Table Name ist: ' ||table_name);
    loop
    fetch obj_cur into zaehler , my_rowid;
    exit WHEN obj_cur%NOTFOUND;
    sum_gesamt:=zaehler + startwert;
    stmt:='update ' || table_name || ' set ' || column_name || ' = ' || sum_gesamt || ' WHERE current of obj_cur';
    dbms_output.put_line (stmt);
    execute immediate stmt;
    end loop;
    close obj_cur;
    end;
    the error i get is:
    Anmeldung bei der Datenbank Oracle Test2.
    ORA-03001: Funktion nicht implementiert
    ORA-06512: in "xxx.loop_update_autowert_x", Zeile 29
    ORA-06512: in Zeile 10
    Startwert ist: 5
    Column Name ist: a
    Table Name ist: T
    update T set a = 6 WHERE current of obj_cur
    Prozess beendet.
    Abmeldung von der Datenbank Oracle Test2.
    have anybody an idea what is wrong or is this construction with the clause "open cursor for statement" not possible with where current of cursor
    thx for helping
    best regards
    Hans-Peter

    Hello
    You're using rownum in your query so why not just use it in the update?
    CREATE OR REPLACE PROCEDURE "xxx"."loop_update_autowert_x" (
       startwert      NUMBER,
       column_name    VARCHAR2,
       table_name     VARCHAR2)
    AS
       stmt         VARCHAR2 (2000);
    BEGIN
       DBMS_OUTPUT.enable (1000000);
       DBMS_OUTPUT.put_line ('Startwert ist: ' || startwert);
       DBMS_OUTPUT.put_line ('Column Name ist: ' || column_name);
       DBMS_OUTPUT.put_line ('Table Name ist: ' || table_name);
          stmt :=
                'update '
             || table_name
             || ' set '
             || column_name
             || ' = ROWNUM + :startwert'
          DBMS_OUTPUT.put_line (stmt);
          EXECUTE IMMEDIATE stmt USING startwert;
    END;Wherever possible, I would suggest you try to avoid dynamic SQL as it hides dependencies and so can make maintenance more difficult.
    Also, it's not a great idea to splatter your code with DBMS_OUTPUT all over the place. It's better to wrap it in something so you have a bit of control over when it is used - something like log4plsql would be an example...
    HTH
    David

  • 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.

  • Zen V Plus Display Doesn't Update Total Number of Fi

    Hi everyone.
    I have the Zen V Plus 4 GB unit, and I'm using Vista Home Premium.
    I've encountered a problem I haven't been able to solve.
    I loaded ,036 audio files onto the unit, using the Media Explorer.
    That worked fine.
    I then disconnected the Zen V Plus from my computer, and listened to it for a few minutes.
    Then, I hooked it back up and added 55 more tracks to it.
    Here's the problem: The display should say of ,09 but it still says of ,036.
    The 55 new tracks are definitely loaded on the unit.
    Shouldn't the number on the display have increased when I added more files?
    Here's what I did after noticing the display didn't change:
    I went to the Creative web site and downloaded the MP3 Player Recovery Tool, which basically just updates the firmware.
    The firmware on the unit is now .5.03_0.05.09.
    Next, I formatted the Zen, hoping the firmware would resolve the issue.
    This time, I added only 00 tracks, then tried adding another 00.
    Media Explorer said there were 200 tracks on the unit, but the display showed only 00.
    So, my next step was to format and start all over again, using the Sync Manager.
    The same problem, again.
    Bottom line: Although I can incrementally add music files to the Zen, the display doesn't update.
    Is this a known problem? Does anyone have any suggestions on how to overcome it's
    (I mean, excluding formatting my computer and reinstalling Vista and the Creative software, which might be my next step.)
    Thank you! J. Danniel

    Thanks for the reply.
    I have a tagging program, but I neglected to mention is exclusi'vely use WMA format. That doesn't matter.
    There are no duplicate files, because I check that before uploading to the unit.
    I've figured out a few ways to solve this problem, though. One way is to create a playlist. The Zen displays the correct file count this way.
    Another way is to select files via album, artist, or genre, and THEN go back to All Tracks.
    Jd

  • CMP update multiple rows

    Hi,
    Is there a way to update multiple rows when using CMPs.
    For example I can update multiple rows by this method.
    while (condition)
    cmp = cmpHome.findByPrimaryKey(key);
    cmp.setValue(newValue);
    Rather than this method is there a way that I can update many rows just as normal sql update.
    thanks in advance,
    chamal.

    If you want to concatenate Acol column with sysdate for 605 and 608 ....i think you need to code less (of what you have posted)
    UPDATE TEST
    SET TEST.ACOL =  TEST.ACOL || ' ' ||sysdate
    where
    test.acol in (605,608);--I don't know why you want this , Just given the suggestion as per the requirement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to Update some column values in some rows in an advanced table

    Hi Gurus,
    Can any body help on this issue.
    I am having a results table which is showing all the queried parties data queried in a seeded page in OCO module.
    Lets assume the table contains 10 rows with the below columns
    Party Name, Registry ID, Address Country, Match Percentage, Certification Level, Certification Reason, Internal Indicator, Status .
    Certification Level, Certification Reason and Internal Indicator are the dropdowns.
    The user want to update some of these fields values for some rows randomly.
    After doing this if he click on Save button, Only thosed changed rows need to get update using a Custom Procedure.
    But here all the rows irrespective of the change getting updated.
    So  how to capture the modified rows.
    Appreciate any inputs..
    Thanks
    Palepu
    Edited by: Palepu on 9 Aug, 2012 4:25 PM

    Not sure if you got the answer. You need to capture the row which got changed using the below and get the column value using the getAttribute method. This works for single selection row, if it is multi selection then you will have to loop through all selected rows and find the VO attribute value.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Row currentRow = am.findRowByRef(rowReference);
    String param1= (String)currentRow.getAttribute("VOAttribute");
    Let me know if there are any issues.
    Thanks
    Shree

  • Value Field in COPA doesn't updated in Pricing Procedure

    Dear SAP Experts,
    I have a problem about Value Field in COPA.
    Why the Value Field in COPA that have been assigned to Transfer of Billing Document for Statistical Condition Type doesn't updated in Pricing Procedure (SD) when Billing Posting?
    Any suggestion will be appreciated.
    Thank You
    Regards,
    Kursteilnehmer

    HI
    in pricing procedure SD consultant are creating the pricing condition rules wher these keys are purley belongs to revenue keys .the conditions wich are taken consideration these are all belongs to finding profit margin.
    coming to CO-PA the main objective of copa is analysig the profitability of particular segment .wher as in  CO-PA the most happend flow from sd saide . so wat ever conditions are taking in pricing procedure its compulsary add co-pa valu fields .to take the reports.
    even though in FI-SD interface levele this pricing is taking greater place to flow the values with the help accounting keys.
    coming to stastical condistion co-pa is real cost object

  • Adobe flash doesn't open some videos.  It did work prior to software update.  It has to do with settings - but what?          Has to do with setting.  Set to what?

    Adobe Flash doesn't open some videos.  It did work prior to software update.  It has to do with settings - but I don't know which or what?      

    Start here.
    http://kb2.adobe.com/cps/865/cpsid_86551.html#ostype=m,

  • Select for update that doesn't return any rows

    Are there any odd side-effects that may occur if a select for update that returns no results is never committed? I wouldn't think there are, but I'm not sure if there would be some kind of overhead or unforeseen consequences. This isn't a terribly important question, but it's come up in some coding I've done and I've not been able to find any documentation addressing it.

    A select for update only locks rows that meet the predicate specified in the where clause. So, if the query returns no rows, no rows are locked.
    session1> SELECT * FROM t;
            ID DESCR
             1 Un
             5 One
             2 THIS IS WA
    session1> SELECT * FROM t
      2  WHERE id = 11 FOR UPDATE;
    no rows selectedA second session can update rows in the table
    session2> UPDATE t
      2  SET descr = 'One'
      3  WHERE id = 1;
    1 row updated.John
    Edited by: John Spencer on Jan 7, 2009 1:36 PM
    I just realized that, although you can do updates on the table after the select fo update that returns no rows, you cannot do DDL operations liike a truncate. Unless the session that does the select for update either ends the transaction (i.e. commit or rollback) or ends the session DDL operations will fail.

  • How to update duplicate row from table

    Hi,
    how to update duplicate row from table?
    First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
    can you give me suggestion on it?
    Thanks in advance.
    your early response is appreciated...

    In order to find a duplicate row, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
    (or search this forum, your question has been asked before)
    In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
    If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase.

  • Forms9i, data block based on stored procedures, refresh on update ?

    Hi,
    I am using
    Forms [32 Bit] Version 9.0.2.9.0 (Production)
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
         With the Partitioning, OLAP and Oracle Data Mining options
         JServer Release 9.2.0.5.0 - Production
    Oracle Toolkit Version 9.0.4.0.23 (Production)
    PL/SQL Version 9.0.1.3.1 (Production)
    Oracle Procedure Builder V9.0.2.0.7 Build #1022 - Production
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Oracle Query Builder 9.0.2.0.0 - Production
    Oracle Virtual Graphics System Version 9.0.1.5.0 (Production)
    Oracle Tools GUI Utilities Version 9.0.4.0.9 (Production)
    Oracle Multimedia Version 9.0.4.0.9 (Production)
    Oracle Tools Integration Version 9.0.2.0.0 (Production)
    Oracle Tools Common Area Version 9.0.1.0.0
    Oracle CORE     9.0.1.2.0     ProductionI have a module based on stored procedures. I have defined query, lock and update procedure. All of them are working as they should, I mean that when looking at the input and output from these procedures I don't see anything blatantly wrong.
    Now, when I update a table field in the form and call the update stored procedure, this procedure takes the updated values in considerations, updates some more fields, and remove some records.
    It is working as it should, except for two details :
    1- I don't see the values updated by the procedure in the Form;
    2- even though some records were removed from the table by the procedure, I still see all my records.
    Is there a way to display the returned table?
    And, is there any documentation about data block based on stored procedures, what are the required signatures and limitations of those stored procedures, what a lock procedure is supposed to do (mine does 'null;' ...), how to map a collection type defined in Oracle to a Form data block ? Any link will be appreciated, I have found half a dozen page vaguely detailing this on Google, but nothing that can compare to a usual Oracle manual. Maybe I have missed something.
    Thank you for your help.
    adsm

    Yes, I was hoping to use these procedures to map the collection type returned to the database to the block data. I guess I was wrong. Except for the initial query and reading some other information from the database, I don't have to use these procedures as I do not write anything to it.
    Thank you for your help, I will go on from there.
    So, it means that I will have to iterate through my collection inside Forms and manipulate my data row by row. Or, is there a way to pass an Oracle collection type between the database and the Forms client and have it displayed without having to iterate through the rows and mapping each field?
    adsm

  • Issue using SQL stored procedure to insert/update

    With help I finally managed to execute the stored procedure to insert/ update the sql database with the below stored procedure
    ALTER PROCEDURE [dbo].[uspInsertorUpdate]
    @dp char(32),
    @dv char(32),
    @e_num char(12),
    @mail varchar(50),
    @emerg char(32),
    @opt1 char(16),
    @stat char(20),
    @e_id char(35),
    @e_tit varchar(64),
    @e_date datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    IF EXISTS (SELECT 1 FROM [dbo].[sampleemployee] WHERE e_id= @e_id)
    BEGIN
    UPDATE [dbo].[sampleemployee]
    SET dp = @dp,
    dv = @dv,
    e_num = @e_num,
    mail = @mail,
    emerg = @emerg,
    opt1 = @opt1,
    stat = @stat,
    e_tit = @e_tit,
    e_date = @e_date
    WHERE e_id = @e_id
    END
    ELSE
    BEGIN
    INSERT INTO [dbo].[sampleemployee]( dp, dv, e_num, mail, emerg, opt1, stat, e_id, e_tit, e_date)
    VALUES ( @dp, @dv, @e_num, @mail, @emerg, @opt1, @stat, @e_id, @e_tit, @e_date );
    END
    END;
    But the issue here is it just insert only one row and update that row only, even if there are some no.of rows need to be inserted . Not sure why

    Hi Sid_siv,
    To pass a table value to stored procedure, you can refer to the sample query below.
    create type FileDetailsType as table
    FileName varchar(50),
    CreatedDate varchar(50),
    Size decimal(18,0)
    create procedure InsertFileDetails
    @FileDetails FileDetailsType readonly
    as
    insert into
    FileDetails (FileName, CreatedDate, Size)
    select FileName, CreatedDate, Size
    from
    @FileDetails;
    Reference
    http://www.codeproject.com/Articles/22392/SQL-Server-Table-Valued-Parameters
    http://forum.codecall.net/topic/75547-sql-server-2008-passing-table-parameter-to-stored-procedure/
    Regards,
    Charlie Liao
    TechNet Community Support

  • /pls/apex/f HTTP-404 \nf: PROCEDURE DOESN'T EXIST\n

    Hi,
    I'm experiencing some troubles in migrating an apex application. This is my situation :
    Currently, I have an apex application version 2.1 running on Oracle XE 10.2.0.1 (on linux).
    The ultimate goal is to have an apex 3.0 application on oracle 10.2.0.3 using oracle HTTP Server (on aix). To achieve this, I'm trying to reinstall the full apex 2.1 into this new environment so only need to run the apexins.sql script when I want to update to 3.0.
    These are the steps I took :
    1. export/import users flows_files and flows_020100
    2. Installed oracle HTML DB in a seperate Oracle home from the companion CD
    3. Created dads.conf as follows
    Alias /i/ "/oracle/app/oracle/product/HTTP/Apache/Apache/images/"
    AddType text/xml xbl
    AddType text/x-component htc
    <Location /pls/apex>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString creyfsbup:1521:XEORAMON ServiceNameFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword <password>
    Allow from all
    </Location>
    4. Restarted HTTP daemons
    5. Navigated to http:\\creyfsbup:7779\pls\apex
    This results in HTTP-404. This is an excerpt from my Apache error log :
    [Thu Mar 22 14:40:11 2007] [error] [client 40.254.0.163] [ecid: 1174570811:172.25.154.161:4837422:0:93,0] mod_plsql: /pls/ape
    x/f HTTP-404 \nf: PROCEDURE DOESN'T EXIST\n
    Some observations :
    * All objects are valid
    * HTTP server (server:7779) is reachable
    Am I missing some privileges/synonyms?
    Is there something missing/wrong in my setup?
    All feedback is more then welcome.
    Best Regards,
    Rik De Vos

    Rik,
    You're not getting the SYS-owned package(s) that get installed with Application Express and you're not getting any of the grants to FLOWS_020100 and FLOW_FILES objects to PUBLIC (and maybe others). So I think your approach is not good.
    Besides that, I'm not sure that when you install 3.0 it will be able to recognized FLOWS_020100 and upgrade from 2.1 to 3.0, if that is your plan.
    Why don't you export your applications using the Application Export wizard and import them into one or more workspaces after you do a clean install of 3.0?
    Scott

Maybe you are looking for

  • Why can't I get Nokia Belle Refresh?

    Hi. I have an N8 that was locked to O2 but since I have now had it unlocked and am contracted to Talkmobile. My product code is 059C1B7 and am on software release 111.030.0609. Everytime I check for updates either via OTA or Nokia Suite I am told tha

  • Cannot Access Shared Services After Installing 11.1.2

    Installed and successfully configured Hyperion Foundation. Validation tool is telling me configuration of foundation, workspace etc was successful. However when I try to access Shared Services at http://server:28080/interop I get a 404 error, and whe

  • Using swing elements in JSP pages

    I am developing a web application using jsp pages. In this application i want to display some information in a seperate window. For this i created a class which extends JFrame. This class makes also use of the singleton principle. In the jsp i use th

  • Exit/badi for ck40n

    Hi All, I want an exit or badi for the transaction ck40n which will convert the rate according to the unit of measure while costing. Edited by: Bygine Benziger on Mar 13, 2009 7:17 AM

  • html:option tag with jbo:RowSetIterate

    Hi I am trying to build a list box using the following code. <html:select property="providerTypeId"> <html:option value=""> </html:option> <jbo:RowsetIterate datasource="PModule.ProviderTypeLuVO"> <html:option value="<jbo:ShowValue datasource='PModul