Skip to main content
edited title
Link
user122618
user122618

Split MySQL query into executional partan [executional part] and MySQLa [MySQL command partpart]

deleted 4 characters in body
Source Link
user122618
user122618

Following

mysql -u root -ppassword -D database -s -N -e "SELECT id FROM myTable"

with special password and database is working fine.

I want to split the code into two parts:

  1. Executional part:

    mysqlE=mysql -u root -ppassword -D database -s -N -e

and

  1. MySQL command part:

    query="SELECT id FROM myTable"

to execute it with something similar like:

mysqlE query

How would youcan I do this?

Following

mysql -u root -ppassword -D database -s -N -e "SELECT id FROM myTable"

with special password and database is working fine.

I want to split the code into two parts:

  1. Executional part:

    mysqlE=mysql -u root -ppassword -D database -s -N -e

and

  1. MySQL command part:

    query="SELECT id FROM myTable"

to execute it with something similar like:

mysqlE query

How would you do this?

Following

mysql -u root -ppassword -D database -s -N -e "SELECT id FROM myTable"

with special password and database is working fine.

I want to split the code into two parts:

  1. Executional part:

    mysqlE=mysql -u root -ppassword -D database -s -N -e

and

  1. MySQL command part:

    query="SELECT id FROM myTable"

to execute it with something similar like:

mysqlE query

How can I do this?

Source Link
user122618
user122618

Split MySQL query into executional part and MySQL command part

Following

mysql -u root -ppassword -D database -s -N -e "SELECT id FROM myTable"

with special password and database is working fine.

I want to split the code into two parts:

  1. Executional part:

    mysqlE=mysql -u root -ppassword -D database -s -N -e

and

  1. MySQL command part:

    query="SELECT id FROM myTable"

to execute it with something similar like:

mysqlE query

How would you do this?