代码拉取完成,页面将自动刷新
/* *
* @ 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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。