mysql - Insert NULL value in db using Raw sql queries in rails -
i using raw sql queries in rails application. want insert null value in 1 rows, how active record using nil row when table.find_by_column(nil)
. tried '#{nil}' entering nothing db column blank ' ' want null.
you can try this.
sql = "insert table_name (r_id, r_name) values (1, null)" records_array = activerecord::base.connection.execute(sql)
Comments
Post a Comment