ORA-12728:正则表达式插入范围无效

时间:2019-05-20 11:17:46

标签: oracle stored-procedures plsql sql-insert

该错误仅在插入表客户端时出现,并且仅在我的计算机中出现,这是因为与其他客户端进行了测试是否能够加载它。使用sqldeveloper 18.2和oracle数据库快速版11g。

表格:

CREATE TABLE Clientes(
DNI_CIF VARCHAR2(9) NOT NULL CHECK (REGEXP_LIKE(DNI_CIF, '[A-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][A-Z]')),
Contrasena VARCHAR2(25) NOT NULL,
Telefono NUMBER(9) NOT NULL,
Email VARCHAR2(25) UNIQUE,
TipoCliente VARCHAR2(25),
Nombre VARCHAR2(30) NOT NULL,
FormaPago VARCHAR2(20),
NumeroCuenta VARCHAR2 (24),
CancelacionesIndebidas INT CHECK (CancelacionesIndebidas BETWEEN 0 and 3),
PRIMARY KEY(DNI_CIF),
CONSTRAINT Clientes_chk1 CHECK (TipoCliente IN ('Particular', 'Empresa', 'Administracion Publica'))
);

程序:

PROCEDURE insert_clientes(w_DNI_CIF clientes.dni_cif%TYPE,w_Contrasena clientes.contrasena%TYPE,w_Telefono clientes.telefono%TYPE,w_Email clientes.email%TYPE,
    w_TipoCliente clientes.tipocliente%TYPE,w_Nombre clientes.nombre%TYPE,
    w_FormaPago clientes.formapago%TYPE,w_NumeroCuenta clientes.numerocuenta%TYPE,
    w_CancelacionesIndebidas clientes.cancelacionesindebidas%TYPE);
CREATE OR REPLACE PACKAGE BODY INSERTS AS 


PROCEDURE insert_clientes(w_DNI_CIF clientes.dni_cif%TYPE,w_Contrasena clientes.contrasena%TYPE,w_Telefono clientes.telefono%TYPE,w_Email clientes.email%TYPE,
w_TipoCliente clientes.tipocliente%TYPE,w_Nombre clientes.nombre%TYPE,w_FormaPago clientes.formapago%TYPE,w_NumeroCuenta clientes.numerocuenta%TYPE,
w_CancelacionesIndebidas clientes.cancelacionesindebidas%TYPE)
IS

BEGIN

INSERT INTO Clientes (DNI_CIF,Contrasena,Telefono,Email,TipoCliente,Nombre,FormaPago,NumeroCuenta,CancelacionesIndebidas)
VALUES(w_DNI_CIF,w_Contrasena,w_Telefono,w_Email,w_TipoCliente,w_Nombre,w_FormaPago,w_NumeroCuenta,w_CancelacionesIndebidas);

END insert_clientes;

插入:

INSERTS.insert_clientes('12312389P','12345678',666666666,'una@muno.com','Particular','Miguel de Unamuno','Transferencia','ES7119225879874039280971',0);

1 个答案:

答案 0 :(得分:2)

您需要将 class _DashboardState extends State<Dashboard> { int _bottomNavBarCurrentIndex = 0; dashboardViews.DashboardView dView = new dashboardViews.DashboardView(); List<Widget> _listOffers = new List<Widget>(); Widget _currentView; void loadDashboardView() { _currentView = (_bottomNavBarCurrentIndex == 0 ? dView.getOfferView(_listOffers, _getOfferData) : dView.getOrdersView()); } _showInfoSheet() { showBottomSheet( context: widget.scaffoldKey.currentContext, // referencing the key passed from [DashboardPage] to use its Scaffold. builder: (context) { return Text('Hello'); }); } Future _getOfferData() async { loadDashboardView(); List<Widget> _resultsOffers = new List<Widget>(); SharedPreferences prefs = await SharedPreferences.getInstance(); String _token = prefs.getString('token'); final responseOffers = await http.get(globals.apiConnString + 'GetActiveOffers?token=$_token'); if (responseOffers.statusCode == 200) { List data = json.decode(responseOffers.body); for (var i = 0; i < data.length; i++) { _resultsOffers.add(GestureDetector( onTap: () => _showInfoSheet(), child: Card( child: Padding( padding: EdgeInsets.all(15), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ Row(children: <Widget>[ Expanded( flex: 5, child: Text('${data[i]['Title']}', style: TextStyle( fontWeight: FontWeight.bold, color: globals.themeColor4))), Expanded( flex: 3, child: Row(children: <Widget>[ Icon(Icons.access_time, size: 15, color: Colors.grey), Padding( padding: EdgeInsets.fromLTRB(5, 0, 10, 0), child: Text('11:30 PM', style: TextStyle(color: Colors.black))), ])), Expanded( flex: 1, child: Row(children: <Widget>[ Icon(Icons.local_dining, size: 15, color: Colors.grey), Padding( padding: EdgeInsets.fromLTRB(5, 0, 0, 0), child: Text('${i.toString()}', style: TextStyle(color: Colors.black))), ])), ]), Padding(padding: EdgeInsets.all(10)), Row(children: <Widget>[ Text( 'Created May 2, 2019 at 2:31 PM', style: TextStyle(color: Colors.grey[600]), textAlign: TextAlign.start, ) ]) ]))))); } } setState(() { _listOffers = _resultsOffers; }); loadDashboardView(); } void _bottomNavBarTap(int index) { setState(() { _bottomNavBarCurrentIndex = index; loadDashboardView(); }); } void pullRefresh() { _getOfferData(); } @override Widget build(BuildContext context) { // Scaffold key has been removed as there is no further need to it. return Scaffold( backgroundColor: Colors.grey[200], body: _currentView, bottomNavigationBar: BottomNavigationBar( onTap: _bottomNavBarTap, currentIndex: _bottomNavBarCurrentIndex, items: [ BottomNavigationBarItem( icon: Icon(Icons.near_me), title: Text('OFFERS')), BottomNavigationBarItem( icon: Icon(Icons.broken_image), title: Text('ORDERS')) ], ), ); } } } 过程包装在包装的包装规格部分中,以insert_clientes开头,以CREATE OR REPLACE PACKAGE INSERTS AS结尾。包正文也缺少END INSERTS;

END INSERTS;

并执行以下操作(因此,您为SQL> CREATE OR REPLACE PACKAGE INSERTS AS PROCEDURE insert_clientes(w_DNI_CIF clientes.dni_cif%TYPE, w_Contrasena clientes.contrasena%TYPE, w_Telefono clientes.telefono%TYPE, w_Email clientes.email%TYPE, w_TipoCliente clientes.tipocliente%TYPE, w_Nombre clientes.nombre%TYPE, w_FormaPago clientes.formapago%TYPE, w_NumeroCuenta clientes.numerocuenta%TYPE, w_CancelacionesIndebidas clientes.cancelacionesindebidas%TYPE); END INSERTS; / SQL> CREATE OR REPLACE PACKAGE BODY INSERTS AS PROCEDURE insert_clientes(w_DNI_CIF clientes.dni_cif%TYPE, w_Contrasena clientes.contrasena%TYPE, w_Telefono clientes.telefono%TYPE, w_Email clientes.email%TYPE, w_TipoCliente clientes.tipocliente%TYPE, w_Nombre clientes.nombre%TYPE, w_FormaPago clientes.formapago%TYPE, w_NumeroCuenta clientes.numerocuenta%TYPE, w_CancelacionesIndebidas clientes.cancelacionesindebidas%TYPE) IS BEGIN INSERT INTO Clientes (DNI_CIF, Contrasena, Telefono, Email, TipoCliente, Nombre, FormaPago, NumeroCuenta, CancelacionesIndebidas) VALUES (w_DNI_CIF, w_Contrasena, w_Telefono, w_Email, w_TipoCliente, w_Nombre, w_FormaPago, w_NumeroCuenta, w_CancelacionesIndebidas); END insert_clientes; END inserts; / 列提供的字符串没有问题):

w_dni_cif