pass value from shell to sql】的更多相关文章

echo 'please enter new userid need create' read new_usr echo 'please enter userid to model' read model_usr echo 'please enter SOEID for password' read new_pwd sqlplus ${ORA_USR}/${ORA_PASS}@${ORA_DB} @${CACSPARM}/TEST $new_usr $model_usr $new_pwd…
1. background in most cases, we want to execute sql script  in doris  routinely. using azkaban, to load data,etc.And we want to pass parameters to the sql script file. we can easily handle such situation in hive. 1.1 hive usage: using -hiveconf:  or…
https://www.cnblogs.com/tiankongjava/p/6106743.html 今天做个linux定时任务(每晚12点把表汇总). 顺便写个博客记录一下~~ 为什么用linux定时任务,而不是在项目加定时任务呢?原因就是防止因为各种原因项目崩溃..所以就用了更加稳定的linux定时任务(我是这么想的( ^_^ )). 起初我感觉很简单,以为顶多半小时就搞定了,,,结果从10点弄到12点半才搞定(主要是我英语太渣和数据库报错导致)... ︿( ̄︶ ̄)︿废话到此结束-----…
以下脚本功能是用shell脚本登录sqlplus连接oracle,将执行sql语句查询的结果赋值给shell脚本中的变量 #!/bin/bash echo "开始连接数据库..." sqlplus -S "name/password" << ! set pagesize 0 set verify off set feedback off set echo off col coun new_value v_coun select count(*) coun…
> mysql -uroot -p123456 > use db_test > source /root/temp.sql…
def generate_csv_source(data_file): #判断文件是否存在 if not os.path.exists(data_file): # 拉取hive表数据 cmd_sql = 'hive -e "set hive.cli.print.header=true; \ select * from dw.full_d_usr_channel_sum_v3 where ds<>\'\' \ and type in (\'super\',\'9k9\',\'taoba…
#!/bin/sh user="user" pass="pass" sqlplus -S $user/$pass select 1 from dual; exit;…
Resource from StackOverflow 使用存储过程,如何传递数组参数? 1.分割解析字符串,太麻烦 2.添加Sql Server 自定义类型 sp_addtype 问题需求:需要向SP 传递数组类型的参数 select * from Users where ID IN (1,2,3 ) Sql Server 数据类型 并没有数组,但是允许自定义类型,通过 sp_addtype 添加 一个自定义的数据类型,可以允许c# code 向sp传递 一个数组类型的参数 但是不能直接使用…
script sqlplus ${ORA_USR}/${ORA_PASS}@${ORA_DB} @${PARM}/TEST $new_usr $model_usr $new_pwd parm of sql define V_USERID = '&1'; define V_MODEL = '&2'; define V_PASSWD = '&3'; INSERT INTO XX( exit;…
shell的语法还是比较严格的(比如变量赋值,两边不能用等号) #!/bin/bash ids=$(mysql -h172. -uroot -p1qaz@WSX -N -e "select id from cook.m_teacher;") echo $ids…