aqSqMaker是ADOQuery类型
S_INFO是oracle中的序列,每次增1
我现在想在增1后如果位数不到9位就用0填充,然后在前面再加上'S‘组成编码,但是在aqSqMaker.Open();时出错,说是from之后的dual不存在??那应该怎么办?
程序如下:
    aqSqMaker.Close();
    aqSqMaker.SQL.Text := 'select ''''S'''' || lpad(to_char(S_INFO.nextval),9,''''0'''') as SI from dual;';
    aqSqMaker.Open();
    Application.MessageBox( PChar( aqSqMaker.FieldByName('SI').AsString ),'xxxxxx', MB_OK );//这里对吗?要不要强制转换成PChar?
    //这里如果要把得到的编码连同其他字段插入表T_Table1中的话,应该怎样做?
    aqSqMaker.Close();    
谢谢~~