日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

Oracle SQL脚本学习记录一

發布時間:2023/12/15 数据库 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Oracle SQL脚本学习记录一 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

set?serveroutput?on declare v_age?number; begin v_age:=12; v_age:=v_age/0; exception when?ZERO_DIVIDE?then dbms_output.put_line(‘divde?by?zero’); end; declare v_name?varchar2(10); begin v_name:=’wmsjhappy’; DBMS_OUTPUT.PUT_LINE(v_name); end; / declare? begin? select?*?from?tb_personresumes; end; / ——————————————————————————————————————- create?table?protest?(name?varchar2(10),pass?varchar2(10)); insert?into?protest?values?(‘wmsjhappy’,’20070701′); select?*?from?protest; commit; CREATE?or?replace?procedure?sp_proUserInfo(sApName?varchar2,sApPass?varchar2)?is begin update?protest?set?name=sapname,pass=sappass; end; commit; call?sp_proUserInfo(‘diwaycom’,'radius’); exec?sp_proUserInfo(‘diway’,'radius’); select?*?from?protest; commit; select?*?from?protest; DECLARE CURSOR?c1?IS SELECT?prod_id,?cust_id,?time_id,?amount_sold? FROM?sales WHERE?amount_sold?>?100; c1_rec?c1%rowtype; l_cust_first_name?customers.cust_first_name%TYPE; l_cust_lasT_name?customers.cust_last_name%TYPE; BEGIN FOR?c1_rec?IN?c1 LOOP –?Query?customer?details SELECT?cust_first_name,?cust_last_name INTO?l_cust_first_name,?l_cust_last_name FROM?customers WHERE?cust_id=c1_rec.cust_id; – –?Insert?in?to?target?table – INSERT?INTO?top_sales_customers?( prod_id,?cust_id,?time_id,?cust_first_name,?cust_last_name,amount_sold ) VALUES ( c1_rec.prod_id, c1_rec.cust_id, c1_rec.time_id, l_cust_first_name, l_cust_last_name, c1_rec.amount_sold ); END?LOOP; COMMIT; END; create?table?protest(name?varchar2(10),pass?varchar2(10)); set?serveroutput?on; declare?cursor?get_date?isselect?name,pass?from?protest; beginfor?i?in?get_dateloopDBMS_OUTPUT.PUT_LINE(‘name:?‘||i.name||’???pass:?‘||i.pass);end?loop; end; / L>?declare????????????????????????????????????????????????????????????????????????????????????????cursor?t?is????????????????????????????????????????????????????????????????????????????????????select?susername?from?tbl_usersagentgoogle;????????????????????????????????????????????????????tname?t%rowtype;???????????????????????????????????????????????????????????????????????????????begin??????????????????????????????????????????????????????????????????????????????????????????????for?tname?in?t?????????????????????????????????????????????????????????????????????????????????loop???????????????????????????????????????????????????????????????????????????????????????????select?susername?into?tname?from?tbl_usersagentgoogle;?????????????????????????????????????????end?loop;??????????????????????????????????????????????????????????????????????????????????end;??????????????????????????????????????????????????????????????????????????????????????????/


轉載于:https://my.oschina.net/wmsjhappy/blog/272551

總結

以上是生活随笔為你收集整理的Oracle SQL脚本学习记录一的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。