第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如果這些參數(shù)要作為表提示,則需要使用?

如果這些參數(shù)要作為表提示,則需要使用?

一只甜甜圈 2023-04-22 18:14:13
Sql Server 存儲(chǔ)過(guò)程報(bào)錯(cuò) 為不是函數(shù)的對(duì)象 'account' 提供了參數(shù)。create procedure bank_pro @ids varchar(10)asdeclare @bid varchar(10),@bname varchar(20),@baddr varchar(30),@bcity varchar(30),@sums money,@counts int,@SQL varchar(500)declare @curs cursor--select @sums = sum(a_balance) from account where a_bank_num = @ids;--select @counts=count(a_bank_num) from account where a_bank_num=@idsset @curs=cursor scroll dynamicforselect b.b_id,b.b_name,b.b_address,b.b_city,sum(a.a_balance),count(a.a_id)from bank b left join account a on b.b_id=a.a_bank_num where b.b_id = @idsgroup by b.b_id,b.b_name,b.b_address,b.b_cityopen @cursfetch next from @curs into @bid,@bname,@baddr,@bcity,@sums,@countswhile(@@fetch_status=0)beginprint '編號(hào) '+'名稱(chēng) '+'地址 '+'城市 '+'總金額 '+'賬戶數(shù) 'print @bid+@bname+@baddr+@bcity+convert(varchar(20),@sums)+' '+convert(varchar(20),@counts)fetch next from @curs into @bid,@bname,@baddr,@bcity,@sums,@countsif(@sums<1000000)begin set @SQL='insert into account() values(''1010'',''天天'',''60000'',''2012-11-23'','''+@ids+''')'print('該銀行總金額少于一百萬(wàn)') print(@SQL+'已執(zhí)行')exec(@SQL)endif(@counts=0)-- else if(@counts=0)beginprint('該銀行不存在用戶')set @SQL='delete from bank with b_id='''+@ids+''''print(@SQL+'已執(zhí)行')print('該銀行已被刪除')exec(@SQL)endend;
查看完整描述

1 回答

?
繁星淼淼

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超11個(gè)贊

declare curs cursor
for
select b.b_id,b.b_name,b.b_address,b.b_city,sum(a.a_balance),count(a.a_id)
from bank b left join account a on b.b_id=a.a_bank_num 
where b.b_id = @ids
group by b.b_id,b.b_name,b.b_address,b.b_city

open curs
fetch next from curs into @bid,@bname,@baddr,@bcity,@sums,@counts
while(@@fetch_status=0)
begin
print '編號(hào) '+'名稱(chēng) '+'地址 '+'城市 '+'總金額 '+'賬戶數(shù) '
print @bid+@bname+@baddr+@bcity+convert(varchar(20),@sums)+' '+convert(varchar(20),@counts)
fetch next from @curs into @bid,@bname,@baddr,@bcity,@sums,@counts
if(@sums<1000000)
begin 
set @SQL='insert into account() values(''1010'',''天天'',''60000'',''2012-11-23'','''+@ids+''')'
print('該銀行總金額少于一百萬(wàn)') 
print(@SQL+'已執(zhí)行')
exec(@SQL)
end
if(@counts=0)
-- else if(@counts=0)
begin
print('該銀行不存在用戶')
set @SQL='delete from bank with b_id='''+@ids+''''
print(@SQL+'已執(zhí)行')
print('該銀行已被刪除')
exec(@SQL)
end

CLOSE curs
DEALLOCATE curs

end

查看完整回答
反對(duì) 回復(fù) 2023-04-25
  • 1 回答
  • 0 關(guān)注
  • 231 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)