oracle returning into,oraclereturning

來源:互聯網
上載者:User

oracle returning into,oraclereturning

returning into 語句用於執行完語句後返回的值,具體返回執行之前或者之後的結果,如下所述:

delete語句的returning into語句返回的是delete之前的結果;
insert語句的returning into語句返回的是insert之後的結果。
update語句的returning into語句返回的是update之後的結果。
returning into 語句與return通用
insert into values語句支援returning語句,insert into select語句不支援。
merge語句不支援returning語句。

例:如下的語句都在儲存中,v_age為聲明的一個變數

<span style="font-size:18px;">insert into t_test values (1, 'zhangsan','27') returning age into v_age;update t_test set age = '28' returning age into v_age;delete t_test returning age into v_age;</span>


 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.