• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Update column with trigger

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anybody know why this dosent do as I intend it to?



 
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A very crude guess is that you're attempting to insert a whole column in your update.

But "It doesn't work" tells us nothing.

I know Oracle's error messages are awful, but at least they give us a starting point.
 
Marshal
Posts: 26387
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've made a Swedish-English translation of that SQL (using Google Translate), for those readers who may want to guess what you wanted but don't know Swedish:



Remember though that the SQL doesn't actually tell us what you intended it to do, only what it actually does. So it would help if you told us directly what you intended it to do.
 
Hugo Nilsson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it should update the balance and add the deposit. This code can be run and it says trigger created. But when i try to insert into amount then i get error:
ORA-04091: table SQL_ZIZHVESYDEVONPUGGMMFKTSPB.INSÄTTNING is mutating, trigger/function may not see it ORA-06512: at "SQL_ZIZHVESYDEVONPUGGMMFKTSPB.AIFER_INSÄTTNING", line 2
 
Hugo Nilsson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So i think i made some progress:



I deleted for each row and added that where clause. This lets me insert without error but it does not update the saldo on account
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic