Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat test.SQL
- SET @DB_DATABASE_NAME = 'test_db';
- SET @DB_TABLE_NUMBERS = 'name_number';
- DROP DATABASE IF EXISTS @DB_DATABASE_NAME;
- CREATE DATABASE IF NOT EXISTS @DB_DATABASE_NAME;
- USE @DB_DATABASE_NAME;
- CREATE TABLE IF NOT EXISTS @DB_TABLE_NUMBERS
- (
- `nn_id` INT PRIMARY KEY AUTO_INCREMENT,
- `nn_name` VARCHAR(64) CHARACTER SET utf8,
- `nn_number` VARCHAR(18) CHARACTER SET utf8
- );
- $ mysql -v -uroot -pXXX < test.SQL
- --------------
- SET @DB_DATABASE_NAME = 'test_db'
- --------------
- --------------
- SET @DB_TABLE_NUMBERS = 'name_number'
- --------------
- --------------
- DROP DATABASE IF EXISTS @DB_DATABASE_NAME
- --------------
- ERROR 1064 (42000) at line 4: You have an error IN your SQL syntax; CHECK the manual that corresponds TO your MariaDB server version FOR the RIGHT syntax TO USE near '@DB_DATABASE_NAME' at line 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement