+ Reply to Thread
Results 1 to 4 of 4

Thread: issue

  1. #1
    Join Date
    Oct 2003
    Posts
    312

    issue

    We have two tables. Table A and Table B. We have a “row level” trigger on Table A and are using the “NEW” values, we want to update Table B when certain criteria pulled from Table A are met. Triggers have problems issuing “COMMIT’s” so we’re utilizing the “PRAGMA AUTONOMOUS_TRANSACTION” command in our trigger declaration. Our update statement is still not committing though.



    We are positive that the procedure is getting to our UPDATE and that our WHERE clause is correct because we are inserting records into a message log throughout the procedure. In addition we also populated a variable with the COUNT from a select on the WHERE clause and inserted that into the message log as well. Everything is as would be expected.



    However our UPDATE is still not committing. (We have COMMIT’s in several places of the code including directly after our update).



    Any thoughts?

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    What is the sign that the update is not commiting?
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Oct 2003
    Posts
    312
    Ok, after creating a test procedure and attempting some hard codes we found that the problem was that the UPDATE statement isn’t reading our “FuelPercent” variable correctly and isn’t performing the update. We’re setting the FuelPercent to the Fuel Percent parameter but for some reason the system’s not regarding that as valid. The update works if we replace the FuelPercent variable with pFuelPercent. Why won’t it take the variable? Any ideas?

    FuelPercent := pFuelPercent;

    UPDATE GMSOWNR.CTB_SA_FUEL CF
    SET CF.FUELPERCENT = FuelPercent
    WHERE UPPER(RTRIM(LTRIM(CF.PIPELINE))) = UPPER(RTRIM(LTRIM(pPipeline)))
    AND UPPER(RTRIM(LTRIM(CF.PRODMONTH))) = UPPER(RTRIM(LTRIM(pProdMonth)))
    AND UPPER(RTRIM(LTRIM(CF.PRODYEAR))) = UPPER(RTRIM(LTRIM(pProdYear)))
    AND UPPER(RTRIM(LTRIM(CF.POINTOFVIEW))) = UPPER(RTRIM(LTRIM(pFuelType)))
    AND UPPER(RTRIM(LTRIM(CF.FUELRANK))) = UPPER(RTRIM(LTRIM(FuelCase)));

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,094
    Originally posted by learning_bee
    Ok, after creating a test procedure and attempting some hard codes we found that the problem was that the UPDATE statement isn’t reading our “FuelPercent” variable correctly and isn’t performing the update. We’re setting the FuelPercent to the Fuel Percent parameter but for some reason the system’s not regarding that as valid. The update works if we replace the FuelPercent variable with pFuelPercent. Why won’t it take the variable? Any ideas?

    FuelPercent := pFuelPercent;

    UPDATE GMSOWNR.CTB_SA_FUEL CF
    SET CF.FUELPERCENT = FuelPercent
    WHERE UPPER(RTRIM(LTRIM(CF.PIPELINE))) = UPPER(RTRIM(LTRIM(pPipeline)))
    AND UPPER(RTRIM(LTRIM(CF.PRODMONTH))) = UPPER(RTRIM(LTRIM(pProdMonth)))
    AND UPPER(RTRIM(LTRIM(CF.PRODYEAR))) = UPPER(RTRIM(LTRIM(pProdYear)))
    AND UPPER(RTRIM(LTRIM(CF.POINTOFVIEW))) = UPPER(RTRIM(LTRIM(pFuelType)))
    AND UPPER(RTRIM(LTRIM(CF.FUELRANK))) = UPPER(RTRIM(LTRIM(FuelCase)));
    This is highly confusing because you're using a variable "FuelPercent" but you have that field in your table. I am guessing that Oracle is updating the cf.fuelpercent with cf.fuelpercent and not using your variable. Try using "lFuelPercent".
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Click Here to Expand Forum to Full Width