本文介绍了无法在Oracle中使用Accept Command的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命令提示符不允许我键入值.我应该如何解决这个问题?

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

推荐答案

SQL * Plus ACCEPT命令使用SQL * Plus格式接受来自用户的值.要将某些内容声明为CHAR(7),请使用a7或将某些内容声明为NUMBER(4,0),请使用9999.

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]

这篇关于无法在Oracle中使用Accept Command的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 17:39