R reactable - update a single row - r

Is it possible to update just a single row in reactable? In the documentation, there is the ability to update the data set:
https://glin.github.io/reactable/reference/updateReactable.html
However I just want to update a single row of a large table, not the entire data set.

Related

How do I populate an empty column in my sql database?

How do I populate an empty column in my sql database?
I have a list that I want in the last column of my database. If I use executemany it just adds rows on the bottom of my database. Is there a way to fill it from the top? The column is currently populated with NULL values.
Just to be clear. I want the first item in the list to be put in the first row and item n on the list to be put into row n.
Thanks in advance
*Always take backup of your database, just incase you want to revert it back to original state.
Each row in your database table should have a unique primary key. As you mentioned you have a list to be uploaded in the last column, I assume you have some kind of relationship that distinguishes which list item goes to which row in the last column of the table.
You an update a single row by simple update syntax as below:
UPDATE table_name
SET last_column = somevalue_from_list
WHERE id = unique_row_id;
If you want to update all the rows with the same value then
UPDATE table_name
SET last_column = one_value_for_all_rows;
Follow the below suggestion only when you are using phpmyadmin to manage your tables:
If you want to update each row with the unique value from the list then my suggestion will be to export your table in csv format, open in excel like software and add your last column values in last column of each row and then import the changed table back to the database.
Hope this help.

How to Update a Row in Smartsheet using a userdefined (primarykey) column?

Right now im using Smartsheet API 2.0 were i can update only using a RowID (basically a fixed row number) in a Smartsheet. Instead i need to update using a value from a column which i created.
To update a cell you'll need both the row id and the column id. If you want to set a cell values for all cells created after adding a column you'll need to loop over all existing rows and update each of them.
Concerning performance and best practise, while using update rows you can send a batch of rows.

Preventing newly added column to become last in order

Is it possible to add a new column to an existing Kusto table somewhere in the middle , I don't want it to become last column in the table. Right now when I am issuing .create-merge table command on an existing table and no matter which order I specify for the new column, it always ends up becoming last column in the table.
You are right and it is also written in the docs:
If the motivation to re-order the column is in query scenarios, you can create a function (view) with the same name of the table that re-order the columns as you like, this will allow existing queries to work uninterrupted and the column order to be adjusted.
If the motivation is the ingestion scenario where column order is significant (such as in CSV ingestion or update policy), the new column should be specified at the end, no way around it.

Multi row and column update using R in postgres database

Problem: I want to update values (in multiple rows and columns) of a table in a postgres database using R.
I know that the sql update statement can be something like this but I assume looping over a set of such queries is inefficient:
UPDATE table
SET col1 = value1, col2 = value2, ...
WHERE col1 = "some-value"
Question: Is there a function available to only update particular rows (and potentially only a subset of the columns) of the table (similar to dbWriteTable)? If not, can you think of an efficient way/sql query of updating multiple rows in postgres and how to hand over the R object to the sql query?
EDIT: Assuming I have a foreign key and I don't want to turn on the ON DELETE CASCADE option, how could I efficiently update values in multi rows and columns for the parent table (I only want to update parent table, not child table)?
First, I would read in the data that needs to be updated from SQL to R. Second, I would delete the data to be updated in SQL. Third, I would append the updated data from R to SQL.

Moving rows in sqlite database

I have a table that is actually a ranking list. I want to give user a chance to rearrange that top the way he wants, ergo, allow him to move the rows in that table. Should I create a separate column that would hold the place, or can it be done using embedded order in table?
The documentation says:
If a SELECT statement that returns more than one row does not have an ORDER BY clause, the order in which the rows are returned is undefined.
(This is true for all SQL databases.)
So you cannot rely on the order that the rows happen to be stored in; you have to use some value in some table column.

Resources