Get all static wms goodlocation data
sql function and store process:
create function [dbo].[fun_splitin](@c varchar(),@split varchar())
returns @t table(col varchar())
as
begin
while(charindex(@split,@c)<>)
begin
insert @t(col)values (substring(@c,,charindex(@split,@c)-))
set @c=stuff(@c,,charindex(@split,@c),'')
end
insert @t(col)values(@c)
return
end
create procedure [dbo].[sp_getallstaticgoodlocationdata]
@platoon varchar()
as
begin
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[t_getstaticgoodlocationdata_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = )
drop table [dbo].[t_getstaticgoodlocationdata_temp]
create table [t_getstaticgoodlocationdata_temp](id numeric() identity(,) primary key , the_floor int,the_column1 int,the_column2 int,the_column3 int,the_column4 int,the_column5 int,the_column6 int,the_column7 int,the_column8 int,the_column9 int,the_column10 int,the_column11 int,the_column12 int
,the_column13 int,the_column14 int,the_column15 int,the_column16 int,the_column17 int,the_column18 int,the_column19 int,the_column20 int,the_column21 int,the_column22 int,the_column23 int,the_column24 int,the_column25 int,the_column26 int,the_column27 int,the_column28 int,the_column29 int,the_column30 int,
the_column31 int,the_column32 int,the_column33 int,the_column34 int,the_column35 int,the_column36 int,the_column37 int,the_column38 int
,the_column39 int,the_column40 int) DECLARE @the_platoon int
DECLARE cursor_name CURSOR FOR
select distinct F_Platoon from Sys_GoodLocation where F_Status= and F_Locked='N' and F_Platoon in ((select col from dbo.fun_splitin(@platoon,',')) )
OPEN cursor_name
FETCH NEXT FROM cursor_name INTO @the_platoon
WHILE @@FETCH_STATUS =
BEGIN
if @the_platoon<>
begin
insert into [dbo].[t_getstaticgoodlocationdata_temp](the_floor,the_column1,the_column2,the_column3,the_column4,the_column5,the_column6,the_column7,the_column8,the_column9,the_column10,the_column11,the_column12
,the_column13,the_column14,the_column15,the_column16,the_column17,the_column18,the_column19,the_column20,the_column21,the_column22,the_column23,the_column24,the_column25,the_column26,the_column27,the_column28,the_column29,the_column30,
the_column31,the_column32,the_column33,the_column34,the_column35,the_column36,the_column37) exec sp_getgoodlocationviaplatoon @the_platoon
end
FETCH NEXT FROM cursor_name INTO @the_platoon
END
CLOSE cursor_name
DEALLOCATE cursor_name select the_floor,convert(int,isnull(SUBSTRING(convert(varchar(),the_column1),,),)) as the_platoon,the_column1,the_column2,the_column3,the_column4,the_column5,the_column6,the_column7,the_column8,the_column9,the_column10,the_column11,the_column12
,the_column13,the_column14,the_column15,the_column16,the_column17,the_column18,the_column19,the_column20,the_column21,the_column22,the_column23,the_column24,the_column25,the_column26,the_column27,the_column28,the_column29,the_column30,
the_column31,the_column32,the_column33,the_column34,the_column35,the_column36,the_column37 from [dbo].[t_getstaticgoodlocationdata_temp]
end
call:
exec [dbo].[sp_getallstaticgoodlocationdata] '1,2,3,6'
result:
Get all static wms goodlocation data的更多相关文章
- Init wms goodlocation data
insert goodlocation: CREATE PROCEDURE [dbo].[sp_insert_goodlocation] -- Add the parameters for the s ...
- .NET并行计算和并发4-Thread-Relative Static Fields and Data Slots
Thread Local Storage: Thread-Relative Static Fields and Data Slots 文章摘自msdn library官方文档 可以使用托管线程本地存储 ...
- C++ essentials 之 static 关键字
extraction from The C++ Programming Language, 4th. edition, Bjarne Stroustrup If no initializer is s ...
- Competing in a data science contest without reading the data
Competing in a data science contest without reading the data Machine learning competitions have beco ...
- 代码中函数、变量、常量 / bss段、data段、text段 /sct文件、.map文件的关系[实例分析arm代码(mdk)]
函数代码://demo.c #include<stdio.h> #include<stdlib.h> , global2 = , global3 = ; void functi ...
- Spring data mongodb 聚合,投射,内嵌数组文档分页.
尽量别直接用 DBObject ,Spring data mongodb 的api 本来就没什么多大用处,如果还直接用 DBObject 那么还需要自己去解析结果,说动做个对象映射,累不累 Spri ...
- 【很变态】PHP类实例化对象竟然可以访问类的“静态(static)方法”!!!
之前发现一个PHP的变态问题:PHP中静态(static)调用非静态方法详解 这次看了下 ThinkPHP 的源码 function.inc.php ,里面有个函数: /** * 取得对象实例 支持调 ...
- [Spring Data MongoDB]学习笔记--MongoTemplate查询操作
查询操作主要用到两个类:Query, Criteria 所有的find方法都需要一个query的object. 1. 直接通过json来查找,不过这种方式在代码中是不推荐的. BasicQuery q ...
- [Spring Data MongoDB]学习笔记--MongoTemplate插入修改操作
插入操作: 直接给个例子 import static org.springframework.data.mongodb.core.query.Criteria.where; import static ...
随机推荐
- OpenCV掩模mask的原理和作用
一.什么是掩模mask OpenCV中很多函数都带有一个mask参数,mask被称为掩模.图像掩模一般用来对处理的图像(全部或者局部)进行遮挡,来控制图像处理的区域或处理过程. 二.掩模原理 掩模一般 ...
- js中循环对比(for循环,foreach,for in,for of ,map)
对空位的处理 for循环(不会忽略空位,标记undefined) var arr =[1,2,undefined,3,null,,7] for (let i=0;i<arr.length;i++ ...
- SSM(SpringMVC Spring Mybatis)框架整合搭建
1.新建一个web工程. 2.首先看一下整体的框架结构: 3.将ssm框架搭建所需要的jar包复制到lib目录下 3.需要配置各个配置文件. 1)配置web.xml文件: <?xml versi ...
- Redis数据类型List
Redis的List是通过Linked List(链表)来实现的String集合,所以插入数据的速度很快.但是缺点就是在数据量比较大的时候,访问某个数据的时间可能会很长,但针对这种情况,可以使用Sor ...
- 树莓派做coolpy服务器
安装前需要了解的 1. coolpy是一个基于NodeJS的物联网平台(官网http://icoolpy.com). 注:国内物联网平台有乐联网,yeelink等,但只有coolpy是开源的. 2. ...
- python运算符——算数运算符
加减乘除比较简单这里不多赘述了,print(2 +-*/ 3),唯一需要注意的就是整除运算,符号是“//”,整除运算取的是整数部分,而不是四舍五入哦! print(5 / 2) 这个运行的结果是 ...
- Mac 常用的快捷键
Mac 菜单和键盘通常对某些按键使用符号,其中包括以下修饰键: Command(或 Cmd)⌘ Shift ⇧ Option(或 Alt)⌥ Control(或 Ctrl)⌃ Caps Lock ⇪ ...
- 002 python准备做题的一些准备
在这里,刷刷题,然后,将比较有用的连接粘贴一下在这里.
- (三)ajax请求不同源之cors跨域
一.基本原理 CORS是一个W3C标准,全称是"跨域资源共享"(Cross-origin resource sharing)它允许浏览器向跨源服务器,发出 XMLHttpReque ...
- Java当中的IO一
1.IO操作的目标 什么是IO操作的目标? 输入: 从数据源当中读取数据 输出: 将数据写入到数据目的地当中 有数据进入到程序当中,这个过程就可以被叫做输入 流:即在数据源与程序之间建立的传输通道 2 ...