問題タブ [update-all]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
mysql - 文字列連結による update_all
すべてのユーザーの「allowed_ips」フィールドを更新しようとしていますが、期待どおりに機能しません。
「allowed_ips」は、IP アドレスを含む文字列です。
私が欲しいのは:
ruby-on-rails - Active Record 値を指定し、update_all で where() から選択します
update_all で複数の行を更新したいのですが、where() から選択された 1 つの列で既存の値を使用する必要があります。 update_all で値を指定するにはどうすればよいですか? 次のようになります。
Record.where(:name => "mike", :game_id => 1).update_all(score: "ここでスコアを取り出し、いくつかの変更を加えてから保存したい")
どうもありがとう。
ruby-on-rails - update_all を使用して日付属性を更新する
支払いテーブルがあり、すべての date_of_payment フィールドを同時に、つまり同じ日付で更新できるようにしたいと考えています。
私の見解では、私は次のことを持っています
そして、私のコントローラーには次のものがあります。
私が得ているエラーは次のとおりです。
SQLite3::SQLException: そのような列はありません: {:order=>: UPDATE "payments" SET "{:order=>" = '--- - '':year, :month, :day'' - !ruby/hash :ActiveSupport::HashWithIndifferentAccess ! ''}(1i)'': ''2014'' ! ''}(2i)'': ''3'' ! ''}(3i)'': ''24'' '
このエラーの正確な内容について、少し混乱していることを告白しなければなりません。コントローラーのコードは間違っていますか? それともフォームがおかしいのでしょうか?私が言ったように、私はまだフォームを完全に理解していないので、どんな助けでも大歓迎です.
ruby - Rails 4 - この params ハッシュで Update_all を使用するには?
Row というモデルがあります。
私のrows_controllerからのいくつかの関連するメソッドは次のとおりです:
フォームから update_multiple メソッドに送信される row_params は次のようになります。
上記の update_multiple メソッドで送信された値を使用して、params に含まれるすべての行を更新したい
どうすればいいですか?よくわかりません
どうもありがとうございました。
ruby-on-rails - Postgre hstoreは既存のデータを削除せずにすべて更新します
私は Rails 4.1.5 と postgresql 9.3.5 で作業を開始したので、私の質問は、この状況で postgress で hstore を使用して update_all を使用する方法です (それが可能な場合): "1" => [1, 2, 3]したがって、「1」が存在する場合は配列に番号を追加し、存在しない場合は新しい hstore エントリを作成します。
これは私が試してきたことですが、うまくいきません。
ruby - ActiveRecord Update_all を変数値に
cur_val + 100 という特定の条件ですべてのレコードを更新する方法を探しています。
IDフィールドとスコアフィールドを持つテーブル Suggestions があり、特定の ID を持つすべてのエントリにスコア バンプを受け取るようにします。
それ、どうやったら出来るの?
php - CAKEPHP 2.0 updateALL, json_encoded data
I have another problem with one of my controller functions. I have written a function that updates some fields from my database. I am grabbing the content from a decoded json_file and after I grabbed the data I have encoding it again so I could store it in my database. I am getting some errors I do not understand.
My function
The error message I get:
Database Error
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[{"date":"2008-08-01","text":"This card has been returned to its original functi' at line 1
SQL Query: UPDATE
magicmm
.cards
ASCards
SETCards
.rulings
= [{"date":"2008-08-01","text":"This card has been returned to its original functionality. If it is enchanting an artifact that's already a creature, it won't change its power and toughness."},{"date":"2008-08-01","text":"A noncreature permanent that turns into a creature can attack, and its {T} abilities can be activated, only if its controller has continuously controlled that permanent since the beginning of his or her most recent turn. It doesn't matter how long the permanent has been a creature."}] WHEREmultiverseid
= 96
Notice: If you want to customize this error message, create app/View/Errors/pdo_error.ctp
Any help on solving this issue would be greatly appreciated :-).