我想通过指针写入数据库表中代码
就是类别为 01 ,那么 货物的编码为 010001,也就是

类别为cls
string cls,item,u,m
for j=1 to 99
    if  j<10 then
        m='0'+string(j)
    end if
for i=1 to 9999
    if i<10 then
       u='000'+string(i)
    elseif i>9 and i<100 then
       u='00'+string(i)
    elseif i>99 and i<1000 then
       u='0'+string(i)
    elseif i>999 then
       u=string(i)
    end if

    item=m+u
next

我要判断在同一类别加入以上代码,并且不能重复,我该如何写呀?