欧美vvv,亚洲第一成人在线,亚洲成人欧美日韩在线观看,日本猛少妇猛色XXXXX猛叫

新聞資訊

    1.獲取返回值

    程序代碼

    //存儲過程

    // MYSQL

    // @a int,

    // @b int

    //AS

    // @a + @b

    //GO

    conn = new (.[""].());

    conn.Open();

    = new ("MYSQL", conn);

    . = .;

    ..Add(new ("@a", .Int));

    .["@a"].Value = 10;

    ..Add(new ("@b", .Int));

    .["@b"].Value = 20;

    ..Add(new ("@", .Int));

    .["@"]. = .;

    .();

    .Write(.["@"].Value.());

    2.獲取輸出參數(shù)值

    程序代碼

    //存儲過程

    // MYSQL

    // @a int,

    // @b int,

    // @c int

    //AS

    // Set @c = @a + @b

    //GO

    conn = new (.[""].());

    conn.Open();

    = new ("MYSQL", conn);

    . = .;

    ..Add(new ("@a", .Int));

    .["@a"].Value = 20;

    ..Add(new ("@b", .Int));

    .["@b"].Value = 20;

    ..Add(new ("@c", .Int));

    .["@c"]. = .;

    .();

    .Write(.["@c"].Value.());

    ----------------------存儲過程共有三種返回值-------------------

    /*(一)、參數(shù)返回值@parm2;

    (二)、過程返回值 100;

    (三)、數(shù)據(jù)集返回值 * from where age = @parm1

    請問,如何得到三類返回值?

    */

    table (

    name (30),

    age ,

    key(name, age)

    )

    proc1

    @parm1 ,

    @parm2 (30)

    as

    @parm2 = ''

    * from where age = @parm1

    100

    --(一)、參數(shù)返回值@parm2;

    @re (30)

    exec proc1 1,@re out

    返回結(jié)果=@re

    --(二)、過程返回值 100;

    @re int,@parm2 (30)

    exec @re=proc1 1,@parm2 out

    返回結(jié)果=@re

    --(三)、數(shù)據(jù)集返回值 * from where age = @parm1

    --定義返回結(jié)果保存的臨時表(因為是返回記錄集,所以要用臨時表)

    --調(diào)用返回結(jié)果

    -- @re (30)

    -- #re exec proc1 1,@re out

    * into #re from ('',

    '=zhou;uid=sa;pwd=zhou;=pubs','SET OFF;SET ON @re (30) exec proc1 ''1'',@re out') as a

    --顯示結(jié)果

    * from #re

    --處理完成后刪除臨時表

    drop table #re

    --返回數(shù)據(jù)集方式一:

    /*補(bǔ)充*/

    N' * from pubs.dbo. where = @level',

    N'@level ',

    @level = 35

    或者多條件

    N' * from where = @ and =@ ',

    N'@ int,@ int',

    @ = 1,@=1

    --返回單個值:

    /* 補(bǔ)充 */

    @sql (200)

    @cnt int

    set @sql=N' @cnt=count(*) from '

    exec @sql,N'@cnt int ',@cnt

網(wǎng)站首頁   |    關(guān)于我們   |    公司新聞   |    產(chǎn)品方案   |    用戶案例   |    售后服務(wù)   |    合作伙伴   |    人才招聘   |   

友情鏈接: 餐飲加盟

地址:北京市海淀區(qū)    電話:010-     郵箱:@126.com

備案號:冀ICP備2024067069號-3 北京科技有限公司版權(quán)所有