Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created July 15, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnegi10/3f1a8031dbdb08c6df9a52634c3610a7 to your computer and use it in GitHub Desktop.
Save vnegi10/3f1a8031dbdb08c6df9a52634c3610a7 to your computer and use it in GitHub Desktop.
function delete_rows(db_name::String, table_name::String, price::Float64)
conn_db = connect_db(db_name)
try
DBInterface.execute(conn_db,
"DELETE FROM $table_name WHERE Price > $price")
catch
error("Unable to delete from $table_name")
finally
DBInterface.close!(conn_db)
end
return nothing
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment