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的更多相关文章

  1. Init wms goodlocation data

    insert goodlocation: CREATE PROCEDURE [dbo].[sp_insert_goodlocation] -- Add the parameters for the s ...

  2. .NET并行计算和并发4-Thread-Relative Static Fields and Data Slots

    Thread Local Storage: Thread-Relative Static Fields and Data Slots 文章摘自msdn library官方文档 可以使用托管线程本地存储 ...

  3. C++ essentials 之 static 关键字

    extraction from The C++ Programming Language, 4th. edition, Bjarne Stroustrup If no initializer is s ...

  4. 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 ...

  5. 代码中函数、变量、常量 / bss段、data段、text段 /sct文件、.map文件的关系[实例分析arm代码(mdk)]

    函数代码://demo.c #include<stdio.h> #include<stdlib.h> , global2 = , global3 = ; void functi ...

  6. Spring data mongodb 聚合,投射,内嵌数组文档分页.

    尽量别直接用 DBObject  ,Spring data mongodb 的api 本来就没什么多大用处,如果还直接用 DBObject 那么还需要自己去解析结果,说动做个对象映射,累不累 Spri ...

  7. 【很变态】PHP类实例化对象竟然可以访问类的“静态(static)方法”!!!

    之前发现一个PHP的变态问题:PHP中静态(static)调用非静态方法详解 这次看了下 ThinkPHP 的源码 function.inc.php ,里面有个函数: /** * 取得对象实例 支持调 ...

  8. [Spring Data MongoDB]学习笔记--MongoTemplate查询操作

    查询操作主要用到两个类:Query, Criteria 所有的find方法都需要一个query的object. 1. 直接通过json来查找,不过这种方式在代码中是不推荐的. BasicQuery q ...

  9. [Spring Data MongoDB]学习笔记--MongoTemplate插入修改操作

    插入操作: 直接给个例子 import static org.springframework.data.mongodb.core.query.Criteria.where; import static ...

随机推荐

  1. linux网关下drcom web自动登陆脚本

    /etc/init.d/drcomd: #!/bin/sh # # The environment is cleared before executing this script # so the p ...

  2. CENTOS 7 安装 TINYPROXY 代理服务器

    https://www.cnblogs.com/new_2050/p/7658508.html

  3. setInterval动态时间处理

  4. HTTP/1.1 请求方法

      HTTP(Hypertext Transfer Protocol,超文本传输协议)是一种用于分布式.协作式和超媒体信息系统的 应用层协议.HTTP 是万维网的数据通信的基础.默认端口为 80.   ...

  5. 绑定bindchange事件的微信小程序swiper闪烁,抖动问题解决,(将微信小程序切换到后台一段时间,再打开微信小程序,会出现疯狂循环轮播,造成抖动现象)

    微信小程序开发文档-组件-swiper后面追加的新闻如上图所示: 如果在bindchange事件给swiper的current属性对应的值{{current}}赋值,就会造成抖动现象. bindcha ...

  6. 论文阅读笔记四十一:Very Deep Convolutional Networks For Large-Scale Image Recongnition(VGG ICLR2015)

    论文原址:https://arxiv.org/abs/1409.1556 代码原址:https://github.com/machrisaa/tensorflow-vgg 摘要 本文主要分析卷积网络的 ...

  7. JAVA 动态代理原理和实现

    在 Java 中动态代理和代理都很常见,几乎是所有主流框架都用到过的知识.在面试中也是经常被提到的话题,于是便总结了本文. Java动态代理的基本原理为:被代理对象需要实现某个接口(这是前提),代理对 ...

  8. python数据类型一:字符串

    Python 字符串 字符串是 Python 中最常用的数据类型.我们可以使用引号('或")来创建字符串. 创建字符串很简单,只要为变量分配一个值即可.例如: var1 = 'Hello W ...

  9. spark MLlib DataType ML中的数据类型

    package ML.DataType; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaRDD; im ...

  10. DcotrineFixtureBundle学习

    根据官方文档对Fixture进行学习 首先使用 composer require --dev doctrine/doctrine-fixtures-bundle 来导入扩展 之后注意,如果symfon ...