私はcourse_no、departおよびenrollmentという3つの異なる入力を受け入れようとしています。 しかし、私はこのエラーを取得しています:無効な識別子PL/SQL
old 4: select count(*) into DeptFound from dept where dept = &depart;
new 4: select count(*) into DeptFound from dept where dept = csce;
select count(*) into DeptFound from dept where code = csce;
*
ERROR at line 4:
ORA-06550: line 4, column 56:
PL/SQL: ORA-00904: "CSCE": invalid identifier
ORA-06550: line 4, column 2:
PL/SQL: SQL Statement ignored
マイDEPTクラスは、char型(4)のコード列を持っているので、それが無効の識別子である理由私は知りません。このよう
select count(*) into DeptFound from dept where dept = csce;
-- =>
select count(*) into DeptFound from dept where dept = 'csce';
-- case-sensitive
そこに '&'を入れているのはなぜですか? '&depart'では? – bytepusher
@bytepusher私はそれを削除し、それは私に同じエラーを与えている。しかし、今回は:PL/SQL:ORA-00904: "DEPART":無効な識別子 – Dani