Unable to use Accept Command in Oracle

时间秒杀一切 提交于 2019-12-20 07:08:45

问题


The command prompt doesn't allow me to key in values. How should I solve this problem?


回答1:


The SQL*Plus ACCEPT command accepts values from the user using SQL*Plus formats. To declare something as a CHAR(7) you would use a7 or to declare something as a NUMBER(4,0) you would use 9999.

SQL> accept stdnum char format 'a7' prompt 'Enter student number: '
Enter student number: abc
SQL> accept year number format '9999' prompt 'Enter year: '
Enter year: 2017

The documentation defines the syntax (I've shortened it slightly) as:

ACCEPT variable [data type] [FORMAT format] [DEFAULT default] [PROMPT text|NOPROMPT] [HIDE]


来源:https://stackoverflow.com/questions/21830701/unable-to-use-accept-command-in-oracle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!