SQLPlus 中存储过程的正确语法是什么?
在 sqlplus 中编写存储过程的正确语法是什么?令人惊讶的是,互联网在这一点上毫无帮助,因为 SQL 教程似乎没有指定他们的环境,或者他们给出的示例有点令人困惑。我认为解决这个问题的最简单方法是,我将发布两个命令(我需要执行的几个命令中的一个),如果有人可以将它们编写为存储过程,我相信我可以计算出其余的命令我自己出去。
命令1: 代码:
SELECT COUNT(username)
FROM "ValidClients"
WHERE username = [username goes here];
命令 2: 代码:
INSERT into "ValidClients"
/*zero is overridden by a sequence trigger*/
VALUES (0, [username], [password]);
如您所见,这确实是基本的东西,我只是习惯了 Microsoft SQL Server,所以 SQLPlus 语法让我有点困惑。提前致谢。
What's the proper syntax for writing stored procedures in sqlplus? The internet is surprisingly unhelpful on this point since SQL tutorials don't seem to specify their environment, or the example they give is a little confusing. I think the simplest way to figure this is that I'll post two commands (out of several I need to make), and if someone can write what they'd look like as stored procedures, I'm sure I can figure the rest out on my own.
Command 1:
code:
SELECT COUNT(username)
FROM "ValidClients"
WHERE username = [username goes here];
Command 2:
code:
INSERT into "ValidClients"
/*zero is overridden by a sequence trigger*/
VALUES (0, [username], [password]);
As you can see, it's really basic stuff, I'm just used to Microsoft SQL Server and so SQLPlus syntax is tripping me up a little. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是来自 Google 的示例:
整个教程看起来不错。
Here's an example from Google:
The entire tuturial looks kindof nice.