他の分野を調べてみましたが、自分がしていることの何が問題なのかわかりません。「00000-0000」としてフォーマットされた 9 桁の郵便番号を含むはずの列にチェック制約を作成しようとしています。これは割り当て用なので、許可されているのはチェック制約を作成することだけです。
私はすでに他の列に対して check ステートメントを正常に使用していますが、何らかの理由で、Stack Overflow で見つけたステートメントが機能しません。使用できる文字は、数字とハイフン ('-') のみです。
alter table Student
add constraint student_zip_ck
check (Zip not like '%[0-9\-]%' escape '\');
このチェック制約は、スタック オーバーフローに関する別の (肯定的な評価の) 質問に基づいてモデル化されているため、何が問題なのかわかりません。これは私が受け取るエラーです。
Error starting at line 751 in command:
alter table Student
add constraint student_zip_ck
check (Zip not like '%[0-9\-]%' escape '\')
Error report:
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-01424: missing or illegal character following the escape character
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.
提案、質問、またはコメントがある人はいますか?