SQL 命令提示弹出框让用户输入用户名以将值添加到 alter user "username" 命令

SQL command to prompt a pop up box to have a user input a username to add the value to the alter user "username" command

我正在尝试编写一个脚本,可以 运行 从 oracle 数据库中解锁用户。我可以连接到 sqlserver,并手动 运行 命令,但我喜欢弹出一个输入框,询问用户名,然后将该值输入到 alter user username account unlock 中;命令。

使用替代变量(&variable_name

SQL> ALTER USER &user_name ACCOUNT UNLOCK;
Enter value for user_name: hr

old:ALTER USER &user_name ACCOUNT UNLOCK
new:ALTER USER hr ACCOUNT UNLOCK

User HR altered.