在PL / SQL脚本中创建新记录

时间:2017-11-03 08:12:02

标签: plsql oracle-sqldeveloper

我的数据库中有两个表。我想检查表1中的条件。如果它成为真,那​​么我必须在Table2中生成两个记录。 我正在使用OracleSQLDeveloper,我想为它编写一个PL / SQL脚本。我能做到这一点的最佳方式是什么?

2 个答案:

答案 0 :(得分:1)

在学习完教程并尝试学习PL / SQL的基础之后,它应该看起来像这样:

max.cpp: In instantiation of 'const int max0<32>::value':
max.cpp:17:51:   recursively required from 'const int max1<16>::value'
max.cpp:17:51:   required from 'const int max1<15>::value'
max.cpp:28:28:   required from here
max.cpp:4:52: warning: integer overflow in expression [-Woverflow]
     static const int value = max0<bits - 1>::value * 2 + 1;
                              ~~~~~~~~~~~~~~~~~~~~~~^~~
max.cpp:4:22: error: overflow in constant expression [-fpermissive]
     static const int value = max0<bits - 1>::value * 2 + 1;
                      ^~~~~
max.cpp:4:22: error: overflow in constant expression [-fpermissive]
max.cpp:4:22: error: overflow in constant expression [-fpermissive]
max.cpp: In instantiation of 'const int max0<914>::value':
max.cpp:17:51:   recursively required from 'const int max1<16>::value'
max.cpp:17:51:   required from 'const int max1<15>::value'
max.cpp:28:28:   required from here
max.cpp:4:52: fatal error: template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum)
     static const int value = max0<bits - 1>::value * 2 + 1;
                              ~~~~~~~~~~~~~~~~~~~~~~^~~
compilation terminated.

希望这有帮助

答案 1 :(得分:1)

按照J. Chomel的建议,在PL / SQL中进行,可读性很好。但是你也可以在纯SQL中实现它,如果出于某种原因这是必要的:

'layouts.menu'

显然,类似的东西不具有可读性。