如何从oracle10g pl / sql中的变量中取一个用户的数字 [英] how to take a number from user in a variable in oracle10g pl/sql
本文介绍了如何从oracle10g pl / sql中的变量中取一个用户的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我想从oracle10g中获取用户的输入pl / sql
我该怎么办
i从网站上获取此代码但它无法正常工作
please help i want to take input from user in oracle10g pl/sql
how can i take
i got this code from a website but it is not working
declare
x number;
begin
x := &enter_value;
dbms_output.put_line(x*2);
end;
推荐答案
代码是正确的,但请确保在DBMS OUTPUT选项卡中打开输出。
如果您有任何问题,请告诉我。
感谢和问候,
Rajasekhar Reddy Malasani
code is right,but make sure in DBMS OUTPUT tab turn output on.
Please let me know if you any problem.
Thanks & regards,
Rajasekhar Reddy Malasani
>
在oracle 10g中没有直接的用户输入方式。所有其他PL / SQL I / O都是通过与其他程序交互的API完成的。例如,DBMS_OUTPUT包具有诸如PUT_LINE之类的过程。要在PL / SQL之外查看结果,需要另一个程序(如SQL * Plus)来读取和显示传递给DBMS_OUTPUT的数据。
=> HTF和用于在网页上显示输出的HTP
=> DBMS_PIPE用于在PL / SQL和
操作系统命令之间来回传递信息
=>用于读写操作系统文件的UTL_FILE
=>用于与Web服务器通信的UTL_HTTP
=>用于与邮件服务器通信的UTL_SMTP
虽然其中一些API可以接受输入和输出,没有内置的语言工具可以直接从键盘接受数据。为此,您可以在SQL * Plus中使用PROMPT和
ACCEPT命令。
Hemant-SSAggrawal
There is no direct way to input from user in oracle 10g.All other PL/SQL I/O is done through APIs that interact with other programs. For example, the DBMS_OUTPUT package has procedures such as PUT_LINE. To see the result outside of PL/SQL requires another program, such as SQL*Plus, to read and display the data passed to DBMS_OUTPUT.
=>HTF and HTP for displaying output on a web page
=>DBMS_PIPE for passing information back and forth between PL/SQL and
operating-system commands
=>UTL_FILE for reading and writing operating-system files
=>UTL_HTTP for communicating with web servers
=>UTL_SMTP for communicating with mail servers
Although some of these APIs can accept input as well as output, there is no built-in language facility for accepting data directly from the keyboard. For that, you can use the PROMPT and
ACCEPT commands in SQL*Plus.
Hemant-S.S.Aggrawal
declare
a number(6);
begin
a:= :x;
dbms_output.put_line('Inputed Number is >> '|| a);
end;
/
这篇关于如何从oracle10g pl / sql中的变量中取一个用户的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文