用SQL脚本 生成INSERT SQL语句
配置表B 中的数据,可以从A表中查询到,在实际配置时,通过sql脚本生成B表的insert脚本,最多用到的是sql中连接符【||】,以及双引号【''''】
例1:电销系统中地区出单机构关系表配置数据生成sql
select
'insert into tbl_area_org_code (area_code,area_name,parent_area_code ,yc_area_code,dept_code,dept_name,area_short_name ,quan_pin,dept_flag, id)
values ( '''',' ||
''''||substr(t.dept_abbr,0,2) ||'''' || ','||
''''|| '' ||'''' || ','||
''''||substr(t.dept_code,0,2) ||'''' || ','||
''''||t.dept_code ||'''' || ','||
''''||t.dept_abbr ||'''' || ',' ||
''''||'简称' ||'''' || ',' ||
''''|| fn_getpy(t.dept_abbr) ||'''' || ',' ||
''''||'1' ||'''' || ',' ||
''''|| AREA_ORG_CODE_SEQUENCE2.NEXTVAL ||'''' ||
');'
from tbl_cs_organization t where t.dept_code in(
'33047702');
注意:脚本中用到一个中文转拼音函数,详见:http://blog.csdn.net/stevendbaguo/article/details/22047811
- Excel中用宏批量整理SQL脚本,生成ORACLE触发器语句
- 好用生成插入语句的SQL脚本
- sql语句生成sql脚本
- 将表数据生成Insert脚本 比较好用的生成插入语句的SQL脚本
- 得用SQL语句生成某个库下所有存储过程脚本,并每个存为一个文件
- 【实用SQL脚本】生成数据发布的INSERT语句 推荐
- 收藏:如何根据当前MDB中的表生成对应的JET SQL DDL “CREATE TABLE”语句/脚本?
- powerdesigner中去掉Oracle生成的SQL创建语句中的双引号后再次生成sql的脚本导入数据库中产生的异常问题
- 将表数据生成Insert脚本 比较好用的生成插入语句的SQL脚本
- 用Ruby写自动生成Sql语句脚本遇到的问题
- 从已有数据库生成脚本来获得生成数据表、视图、函数、存储过程以及触发器的SQL语句
- 根据基本表结构及其数据生成INSERT 语句的SQL脚本
- 用SQL语句生成某个库下所有存储过程脚本,并每个存为一个文件
- #Shell脚本 -- 批量生成测试用SQL语句
- python脚本随笔:实现生成插入表的sql语句
- [sqlserver脚本]查看指定SQL语句生成了哪些执行计划
- 把SQL数据库生成脚本插入的 SQL语句
- 用脚本生成授权语句,输入参数包括用户名、IP、数据库名、要求的权限列表,输出为授权sql
- 动态生成SQL查询条件定制表单及语句的脚本
- python脚本批量生成50000条插入数据的sql语句