0

my table

CREATE TABLE emp(
   EMP_NO NUMBER, 
   EMP_NAME VARCHAR2(10 BYTE), 
   ADDRESS VARCHAR2(15 BYTE), 
   PH_NO NUMBER(10,0), 
   DPT_NO NUMBER
)

inserting query:

insert into emp (
    emp_no,
    emp_name,
    address,
    ph_no,
    dpt_no) 
  values (100,'mohan','hyd',7569936347,101),
         (101,'ram','ctr',9553438342,102); 

In this manner i write insert query for multiple records inserting purpose...but i'm getting error as "sql command is not perperly ended.i don't know how to rwsolve this one one..any can help me

3
  • 2
    which DBMS do you use? which language/library do you use to access your database? Commented Aug 13, 2013 at 11:01
  • i'm using sql.it doesn't work above mentioned query.why? Commented Aug 13, 2013 at 11:06
  • oracle sql developer am using but am not getting desire out put.please help me any one Commented Aug 13, 2013 at 11:31

1 Answer 1

1

Assuming you are using sql server prior to 2008. You cannot use this syntax to separate the rows. You could write different insert commands or use a select statement using union to force them into one insert command.

EDIT: Since you are using oracle see if this is helpful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.