why when I execute a select it works and when I execute an update the script blocks?
0
votes
1
answer
147
views
when I try to execute a query of type update the script hangs and the sql console stays still.
This command executes all queries in the script:
res=$(mysql --defaults-file=conf_file --skip-column-names -e "$query")
In case I run the following select, it works without any problem and gives me the correct result
query="SELECT field FROM table WHERE id=1 and id_ext=1;"
but if I execute this update the sql console remains without going on as if I had not put the ; at the end
query="UPDATE field SET data=2 WHERE id=1 and id_ext=1;"
Asked by JJWRX
(1 rep)
Apr 1, 2022, 08:27 AM
Last activity: Apr 4, 2022, 09:20 AM
Last activity: Apr 4, 2022, 09:20 AM