Skip to content

Provide ability to declare variables directly in .sql scripts (to be interpreted by ISQL and substituted in appropriate places) #8232

Open
@pavel-zotov

Description

@pavel-zotov
connect '192.168.23.45/3210:employee_1' user john password 'QweRty';
...
...
connect '192.168.19.23/3350:employee_2' user mike password 'AsdFgh';
...
...
connect '192.168.23.45/3210:employee_1' user john password 'QweRty';
...
...
connect '192.168.19.23/3350:employee_2' user mike password 'AsdFgh';

(we had specify connection string, user names and password two times; passwords are in open form)

What it could be instead:

declare $conn_1 varchar(512) =  '192.168.23.45/3210:employee_1';
declare $conn_2 varchar(512) =  '192.168.19.23/3350:employee_2';
declare $user_1 varchar(63) = 'john';
declare $user_2 varchar(63) = 'mike';
declare $pswf_1 varchar(128) = '/home/dba/.hidden/john.password.txt'; -- file with text: 'QweRty'
declare $pswf_2 varchar(128) = '/home/dba/.hidden/mike.password.txt'; -- file with text: 'AsdFgh'

connect '$conn_1' user $user_1 fetch password from '$pswf_1';
...
...
connect '$conn_2' user $user_2 fetch password from '$pswf_2';

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions