mysql数据库函数

BEGIN

DECLARE diff, x INT;
SET diff =0;
SET x = 10072;
WHILE (x  < 40070 )  DO

insert into order_info( id, sale_area_id , type_dic , `code` , pay , real_pay , consignee , consignee_address , consignee_tel , consignee_poscode , status_dic , order_time , send_time , logistic_id , transport_cost , discount_cost , refund_cost , factorage_cost , other_cost , other_cost1 , other_cost2 , other_cost3 , other_cost4 , order_cost , cost_adjustment, profit , currency_dic , free_shipping_dic , customer_id , purchase_ip , curement_track_num , remark , orderby , create_time , modify_time , salesman_id , operator_id , verify_id , sys_org_id , pay_type_dic , pay_dic , purchase_dic ,
send_dic , parent_id , need_invoice_dic , has_create_dic , invoice_head , invoice_type_dic ,
dc_org_code , dc_user_code , dc_tenant_code , payment_person, order_source )
values( x,11 , 1 , ‘ds7878‘ , 27.0 , 27.0 , ‘Christy‘ , ‘北京市怀柔区‘ ,
15076585230 , 121210 , 1 , ‘2016-08-10 19:15:29‘ , ‘2016-08-10 19:15:50‘ , null, 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , null, null, null, null, 26.0 , 0.0 , 1.0 , 1 , null, 3 ,
null, null ,null  , null, ‘2016-08-10 19:15:50.76‘ , ‘2016-08-10 19:15:50‘ , 1 , 1 , null, 1 , null,
null, null, null, null, null, null, null, null, 01 , 0001 , null, null , 1 );

 insert into order_product( order_id , type_path , product_id , barcode , purchase_quantity , purchase_price , purchase_sum , remark , orderby ,
 var_group, price_id ) values( x , 1 , 46 , null, 1.0 , 15.0 , 15.0 , null, null, null , ‘131‘ );

insert into order_product( order_id , type_path , product_id , barcode , purchase_quantity , purchase_price , purchase_sum , remark , orderby , var_group, price_id )
values( x , 1 , 45 , null, 1.0 , 12.0 , 12.0 , null, null, null , ‘130‘ );

 insert into order_send( order_id , code , sys_logistic_id , transport_dic , tracking_number , transport_cost , send_type_dic ,
 send_linkman , send_poscode , send_tel , send_address , name , tel , country , city , email , address ,
 postcode , area , remark , create_time , modify_time , salesman_id , operator_id , verify_id , sys_org_id , dc_org_code ,
 dc_user_code , dc_tenant_code )
 values( x , ‘ds7878‘ , null, null, null ,
 null, null, ‘超级管理员‘ , null , ‘18911489015‘ ,
  null, null, null, null, null, null, null,
 null, null, null , ‘2016-08-10 19:15:50‘ ,
‘2016-08-10 19:15:50‘ , null, null, null,
null, null, null, null);

insert into order_opt( id , order_id , code , status_dic , customer_id , customer_name , operator_id , operator_name , operator_ip , operation , result , remark , create_time , sys_org_id )
values(  null, x, null, 1, 3, ‘Christy‘, null, ‘超级管理员‘, null, ‘新单‘, null, null, ‘2016-08-10 19:15:51.603‘, null);
SET x = x+1;

END WHILE;

  RETURN x;
END
时间: 2024-07-31 23:41:38

mysql数据库函数的相关文章

mysql数据库函数 concat 字段类型转化、字段拼接

select l.lid, GROUP_CONCAT(s.NAME) shopname, m.realname, u.NAME, m.phone, a.name, concat(l.progress,'') from loan l, bank b, merchant m, bank_user u, area a, shop s where l.bid=b.bid and l.mid=m.mid and l.uid=u.uid and b.aid=a.id and l.lid=s.lid GROU

mysql 数据库函数入门

原文地址:https://www.cnblogs.com/hwgok/p/10816922.html

mysql深入——数据库函数

MySQL深入---数据库函数 MySQL用户界面: 昨天下载了mysql的用户界面软件,然后用软件来练习编写数据库函数. 软件名称是Navicat for MySQL,资源我就不发了,大家可以去<下载吧>下载. 用户界面: 然后连接上了数据库,前几天我用dos编写的teacher表就可以在软件上看到了: 接下来就进入正题了: mysql深入--数据库函数的练习: 1.聚合函数 select avg(age) from teacher;/*求平均数:select avg(字段名)from表名*

ECMall的MySQL数据调用的简单方法

很多ecmall开发者会问,怎么使用Ecmall的mysql类库进行数据调用.从原理上来讲Ecmall的数据调用是以数据模块+模块类库的方式进行mysql数据调用的,所有数据模块都存储在includesmodels 目录下,这些调用对于初学者来讲是比较复杂的,例如商品的数据调用函数,不能用在店铺的数据调用上,每个数据表都有自己的函数自己的类库和少量的公共类库.因此初学者来讲,调用mysql数据很困难. 现在讲解一个简单的调用方法能满足95%以上的mysql数据调用请求.足够对ecmall进行二次

Discuz!X/数据库函数操作方法

Discuz!X/数据库函数操作方法  DB::table($tablename)获取正确带前缀的表名,转换数据库句柄, DB::delete($tablename, 条件,条数限制)删除表中的数据 DB::insert($tablename, 数据(数组),是否返回插入ID,是否是替换式,是否silent)插入数据操作 DB::update($tablename, 数据(数组)条件)更新操作 DB::fetch(查询后的资源)从结果集中取关联数组,注意如果结果中的两个或以上的列具有相同字段名,

redis缓存mysql数据

redis (Remote Dictionary Server)是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库.缓存和消息中间件.它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hash(哈希类型).Redis支持主从同步.数据可以从主服务器向任意数量的从服务器上同步,从服务器可以是关联其他从服务器的主服务器.这使得Redis可执行单层树复制. MySQL和Redis,自身都

java对MySql数据访问

终于解决了所有困难,通过java程序实现对MySql数据的访问,其中有许多困难,尤其对于一个新接触JDBC编码来说,每一次的错误都让人有些摸不着头脑,趁现在对一些产生的问题还记得,帮大家记录下来. 1.首先通过上篇对MySql环境的一些配置,?需要先学习一些MySql基本语法,在MySql中创建新的数据库:MySql语法:create database if not exists 数据库名;然后在其中加入你所需要存储的数据. 2.第二种方法:在.sql文本中添加MySql语法通过cmd命令提示符

使用Solr索引MySQL数据

环境搭建 1.到apache下载solr,地址:http://mirrors.hust.edu.cn/apache/lucene/solr/ 2.解压到某个目录 3.cd into D:\Solr\solr-4.10.3\example 4.Execute the server by “java -jar startup.jar”Solr会自动运行在自带的Jetty上 5.访问http://localhost:8983/solr/#/ 创建MySQL数据 DataBase Name: mybat

mysql数据导入到sqlite数据

在做程序时,sqlite数据很方便.用mysql数据导出到sqlite的步骤:(用csv文件过渡) -------------------------------  先导出到csv文件  ------------------------- 1.用navicat软件将mysql数据导出到txt文件. 2.注意选择“包含列标题”(字段名).“栏位定界符”(csv文件使用逗号). 3.把所有的txt文件转换为utf-8编码. 4.写一个rename.bat(ren *.txt *.csv),全部统一改