• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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: 23409
159
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: 26460
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
 
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic