We help IT Professionals succeed at work.

Created script which accepts parameters at the command line but get no data found

tangocoder
tangocoder asked
on
insert_data. sql

define name=&1
define address=&2

Insert into person
Values('&name','&address);

SQL >@insert_data.sql Joe, New_York

No data found

How can I avoid this error message?  

Thanks
Comment
Watch Question

Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
I cannot reproduce the error you gave.

A No Data Found error is from a select not an insert.

My test:
SQL> @q hello world
SQL> define name=&1
SQL> define address=&2
SQL>
SQL> Insert into person
  2  Values('&name','&address');
old   2: Values('&name','&address')
new   2: Values('hello','world')

1 row created.

SQL>
SQL>
SQL> select * from person;

NAME       ADDRESS
---------- ----------
hello      world

SQL>

Open in new window