我的要求是——我需要从用户那里获取输入(将两个字段作为输入),然后我会将输入存储在一个符号中。但问题是——我无法在 SQL Query 中使用该符号。 .
$ start:
$ INQUIRE REF "Enter Emp_ID"
$ DEFINE/NOLOG Report_file 'REF'
$ if f$type (REF) .nes. "INTEGER"
$ then
$ call error_menu "Error: Integer value Expected"
$ wait 0:0:0.15
$ set term/width=132
$ goto START
$ endif
$ if f$length (REF) .lt. 5 .and. f$length (REF) .gt. 5
$ then
$ call error_menu "Error: emp_id Should be 5 digits"
$ wait 0:0:0.15
$ set term/width=132
$ goto START
$ INQUIRE FILE "Enter year"
$ DEFINE/NOLOG Report_file 'FILE'
$ if f$type (FILE) .nes. "INTEGER"
$ then
$ call error_menu "Error: NON Integer Value..Please enter numeric value"
$ wait 0:0:0.15
$ set term/width=132
$ goto START
$ endif
$ call error_menu "Checking whether emp_id is present in Database !!!"
$ sqlplus/
set feedback on
define IEMP_ID = '&REF';
define IYEAR = '&FILE';
select emp_id from employee where emp_id=&IEMP_ID and year = &IYEAR;
exit;
任何人都可以帮助我..简单地说,我只需要输入一次,然后我需要将它用于各种目的(主要是在许多 sql 查询中)。有这样做的可能性吗?