7 Star 18 Fork 4

浙江智臾科技有限公司/DolphinDBModules

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
infoDataScript.dos 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
jiajiaxu123 提交于 2022-09-02 17:06 . wq101alpha
/* *
* @ brief
* This script is to create database for info data.
* @ Author: DolphinDB
* @ Last modification time: 2022.09.01
* @ DolphinDB server version: 2.00.7
* @ FileName: prepare101.dos
*/
def createInfoDbTable(dbName, tbName){
if(existsDatabase(dbName)){
dropDatabase(dbName)
}
db = database(dbName, VALUE, 1 2 3)
t = table(1:0, `securityid`indclass`cap, [SYMBOL,SYMBOL,DOUBLE])
db.createTable(t, tbName)
}
def genInfo(dbName, tbName){
securityid ="sz"+lpad(string(000001..004000), 6, `0)
indclass = symbol(string(rand(`10`20`30`40`50, size(securityid))) + string(rand(`15`25`35, size(securityid))) + string(rand(`10`20`30, size(securityid))) + string(rand(`60`70`80, size(securityid))))
cap = randUniform(500000, 1000000000, size(securityid))
t = table(securityid, indclass, cap)
securityid = NULL
indclass = NULL
cap = NULL
db = loadTable(dbName, tbName)
db.append!(t)
}
dbName = "dfs://info"
tbName = "info_data"
createInfoDbTable(dbName, tbName)
genInfo(dbName, tbName)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dolphindb/DolphinDBModules.git
git@gitee.com:dolphindb/DolphinDBModules.git
dolphindb
DolphinDBModules
DolphinDBModules
master

搜索帮助

A270a887 8829481 3d7a4017 8829481