I want to update the 'Inactive' for selected customer value where their status is active, I tried to do so but it does not update the 'Inactive' for the selected customer. Anyone having any idea what's wrong please let me know. Thanx!
#!/bin/bash
echo " --- Enter the Database name ---" #name of the database
read databasename
echo " --- enter the table name --- " #name of the table
read table_name
sqlite3 $databasename.db $table_name;
sqlite3 $databasename.db "select * from $table_name WHERE cus_status = 'Active';"
echo "---Select the domain to make Inactive---"
read inactive_user
sqlite3 $databasename.db "UPDATE $table_name SET cus_status = 'Inactive' WHERE cus_name = $inactive_user $table_name";
sqlite3 $databasename.db "select * from $table_name";
$table_nameat the end of your SQL update query?