Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我的包体有什么问题??Oracle SQLPLUS 我是oracle的新手,一直在处理导致错误的包体。 (供参考)我的表格是: CREATE TABLE CUSTOMERS (custname VARCHAR2(10), account_no NUMB_Sql_Oracle_Plsql_Package_Sqlplus - Fatal编程技术网

我的包体有什么问题??Oracle SQLPLUS 我是oracle的新手,一直在处理导致错误的包体。 (供参考)我的表格是: CREATE TABLE CUSTOMERS (custname VARCHAR2(10), account_no NUMB

我的包体有什么问题??Oracle SQLPLUS 我是oracle的新手,一直在处理导致错误的包体。 (供参考)我的表格是: CREATE TABLE CUSTOMERS (custname VARCHAR2(10), account_no NUMB,sql,oracle,plsql,package,sqlplus,Sql,Oracle,Plsql,Package,Sqlplus,我的包体有什么问题??Oracle SQLPLUS 我是oracle的新手,一直在处理导致错误的包体。 (供参考)我的表格是: CREATE TABLE CUSTOMERS (custname VARCHAR2(10), account_no NUMBER(5), cur_balance NUMBER(6) ) / LINE/COL ERROR -------- ----------------------------------------------------------------

我的包体有什么问题??Oracle SQLPLUS
我是oracle的新手,一直在处理导致错误的包体。

(供参考)我的表格是:

CREATE TABLE CUSTOMERS
(custname VARCHAR2(10),
account_no NUMBER(5),
cur_balance NUMBER(6)
)
/
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/19     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.


4/25     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>

LINE/COL ERROR
-------- -----------------------------------------------------------------
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.


5/26     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.

LINE/COL ERROR
-------- -----------------------------------------------------------------


12/47    PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.

我的包裹是:

CREATE OR REPLACE PACKAGE c_package AS 
   -- Adds a customer 
   PROCEDURE addCustomer(c_name  customers.custname%type, 
   c_account_no  customers.account_no%type, 
   c_cur_balance customers.cur_balance%type);

   -- Removes a customer 
   PROCEDURE delCustomer(c_account_no  customers.account_no%TYPE); 

   --Lists all customers 
   PROCEDURE listCustomer; 
  
END c_package; 
/

我的包体是:
CREATE OR REPLACE PACKAGE BODY c_package AS
   PROCEDURE addCustomer(
   c_name       customers.custname%type, 
   c_account_no     customers.account_no%type, 
   c_cur_balance    customers.cur_balance%type)
   IS 
   BEGIN 
      INSERT INTO customers(custname,account_no,cur_balance) 
      VALUES(c_name, c_account_no, c_cur_balance); 
   END addCustomer;

   PROCEDURE delCustomer(c_account_no   customers.account_no%type)
   IS 
   BEGIN 
      DELETE FROM customers 
      WHERE account_no = c_account_no; 
   END delCustomer;

   PROCEDURE listCustomer IS 
   CURSOR c_customers is 
      SELECT  custname FROM customers; 
   TYPE c_list is TABLE OF customers.custname%type; 
   custname_list c_list := c_list(); 
   counter integer :=0; 
   BEGIN 
      FOR n IN c_customers LOOP 
      counter := counter +1; 
      custname_list.extend; 
      custname_list(counter) := n.custname; 
      dbms_output.put_line('Customer(' ||counter|| ')'||custname_list(counter)); 
      END LOOP; 
   END listCustomer;
END c_package; 
/

我一直得到的错误是:

CREATE TABLE CUSTOMERS
(custname VARCHAR2(10),
account_no NUMBER(5),
cur_balance NUMBER(6)
)
/
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/19     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.


4/25     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>

LINE/COL ERROR
-------- -----------------------------------------------------------------
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.


5/26     PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.

LINE/COL ERROR
-------- -----------------------------------------------------------------


12/47    PLS-00103: Encountered the symbol "." when expecting one of the
         following:
         in out <an identifier> <a double-quoted delimited-identifier>
         table ... columns long double ref char time timestamp
         interval date binary national character nchar
         The symbol "<an identifier>" was substituted for "." to continue.
行/列错误
-------- -----------------------------------------------------------------
3/19 PLS-00103:在期待一个
以下:
输入输出
桌子列长双参考字符时间戳
间隔日期二进制国家字符nchar
符号“”已替换为“.”以继续。
4/25 PLS-00103:在期待一个
以下:
输入输出
行/列错误
-------- -----------------------------------------------------------------
桌子列长双参考字符时间戳
间隔日期二进制国家字符nchar
符号“”已替换为“.”以继续。
5/26 PLS-00103:在期待一个
以下:
输入输出
桌子列长双参考字符时间戳
间隔日期二进制国家字符nchar
符号“”已替换为“.”以继续。
行/列错误
-------- -----------------------------------------------------------------
12/47 PLS-00103:在期待一个
以下:
输入输出
桌子列长双参考字符时间戳
间隔日期二进制国家字符nchar
符号“”已替换为“.”以继续。



我不确定它是什么,我想它可能是某个地方的一个输入错误,但我不知道是哪一个,正如我所说的,我是oracle sqlplus的新手,并且仍然在了解它,非常感谢您的帮助,谢谢:)您有完整的时间错误吗?因为我只是在fiddle中执行了代码,所有代码都编译了,没有任何问题。每次我在oracle sqlplus中执行代码时,都会出现以下错误:警告:创建的包体存在编译错误。不确定发生了什么。“在我的机器上工作”。您可能在login.sql或glogin.sql脚本中有一些定义。“定义”是什么意思?对我来说也很好。奇怪的是,第3行第19列不是符号
。第一个点在第26列,所以不确定会发生什么。所有错误似乎都与格式不正确的参数有关。我只能通过删除单词
customers
来重现错误。顺便说一句,不相关,但通常如果我们在参数前加前缀,我们使用
p_
(用于“参数”)或
in_
/
out_
(用于指示参数模式)。我有时会看到
a_
(我想是“参数”的意思),或者一些camelCase约定,比如
custName
<代码>c通常表示常量或光标。