Home » SQL & PL/SQL » SQL & PL/SQL » Error in insert query.
Error in insert query. [message #362895] Thu, 04 December 2008 07:35 Go to next message
shaksing
Messages: 115
Registered: November 2008
Senior Member
I have created a table using this query:

CREATE TABLE NPPI_PURGADO_P
(PASO NUMBER(3) NOT NULL PRIMARY KEY , PROCEDIMIENTO VARCHAR2(80) NOT NULL, TABLA_MAESTRA VARCHAR2(40) NOT NULL, TABLA_DETALLE VARCHAR2(40) , TABLA_MAESTRA_HIST VARCHAR2(40) , REGISTROS_BLOQUE NUMBER(7) DEFAULT '1000' NOT NULL , REGISTROS_MAX NUMBER(10) , NUMERO_MESES NUMBER(3) DEFAULT '13' NOT NULL );

And after trying to insert i got error as

ORA-00933 SQL command not properly ended

Cause: The SQL statement ends with an inappropriate clause. For example, an ORDER BY clause may have been included in a CREATE VIEW or INSERT statement. ORDER BY cannot be used to create an ordered view or to insert in a certain order.

INSERT INTO NPPI_PURGADO_P (PASO , PROCEDIMIENTO , TABLA_MAESTRA , TABLA_DETALLE , TABLA_MAESTRA_HIST , REGISTROS_BLOQUE , REGISTROS_MAX , NUMERO_MESES) VALUES
(1 , 'PURGADO_PROMOCIÓNES' , 'NPPI_HIST_PROMO_APLIC_ENE' , 'NPPI_HIST_DET_PROMO_AP_ENE', '' , 10000 , '' , 13),
(2 , 'PURGADO_PROMOCIÓNES' , 'NPPI_HIST_PROMO_APLIC_FEB' , 'NPPI_HIST_DET_PROMO_AP_FEB', '' , 10000 , '' , 13));

What can i do for this ?Please guide.
Re: Error in insert query. [message #362897 is a reply to message #362895] Thu, 04 December 2008 07:42 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
If you follow the guidelines then we will be more than happy to guide you.

Regards

Raj
Re: Error in insert query. [message #362900 is a reply to message #362895] Thu, 04 December 2008 07:49 Go to previous message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@shaksing,

Either break your INSERT statements into two seperate insert statements which follows the following syntax:

INSERT INTO table
(column-1, column-2, ... column-n)
VALUES
(value-1, value-2, ... value-n);


Or
Use INSERT ALL which has the following syntax:
INSERT ALL
INTO <table_name> VALUES <column_name_list)
INTO <table_name> VALUES <column_name_list)
...
<SELECT Statement>;


Btw,
Please go through OraFAQ Forum Guidelines especially on "How to Format Your Post?" section.

Regards,
Jo
Previous Topic: Data filtering
Next Topic: Delete Statement
Goto Forum:
  


Current Time: Fri Dec 02 18:42:57 CST 2016

Total time taken to generate the page: 0.34303 seconds