2012年9月13日 星期四

informix 序號欄位取值

.net 中,如何取得informix table 新增後serial column  的流水號,然後再傳給另一個table進行使用

--建立測試表
create table  bevtest
    ( col1 serial,
      col2 varchar(50) 
    );

begin work;

insert into bevtest values(0,'test');


--此行需緊接著insert into table 後執行
select dbinfo('sqlca.sqlerrd1') as sn from empty into temp tmpsn with no log;

insert into bevtest select 0,sn||' this is sn"  from tmpsn;

drop table tmpsn;

commit work;

沒有留言:

張貼留言

離線安裝SSMS 22 launched extracted application exiting with result code 0x138b

SSMS 22 安裝器下載頁面 https://learn.microsoft.com/zh-tw/ssms/install/install https://aka.ms/ssms/22/release/vs_SSMS.exe 將安裝檔下載到本機,檔案好大2.5G  https:...