SHELL 变量进阶
2015年1月27日
没有评论
1.${#var}
查看变量的长度
[test@Server1 shell]$ unset name
[test@Server1 shell]$ name=tom
[test@Server1 shell]$ echo ${name}
tom
如果变量为设[......]
分类: Linux Shell, 操作系统
1.${#var}
查看变量的长度
[test@Server1 shell]$ unset name
[test@Server1 shell]$ name=tom
[test@Server1 shell]$ echo ${name}
tom
如果变量为设[......]
1.对于DML或DDL语句中,占位符和绑定变量是按位置进行绑定的,即使占位符是重复的,绑定变量也要为每个占位符提供参数。
准备脚本:
16:49:51 SCOTT@ orcl>DROP TABLE demo; Table dropped. Elapse[......]
1.设置参数语法name=value
注意等号左右没有空格,否则会报错
[root@Server ~]# name =tom
bash: name: 未找到命令...
[root@Server ~]# name= tom
bash: to[......]
1.如果使用动态的SELECT语句且只返回一行,可以使用EXECUTE
IMMEDIATE INTO USING语法:
09:42:42 SCOTT@ orcl>declare 09:42:43 2 v_empid scott.EMP.EMPLOYEE_ID%TYPE[......]