简体   繁体   中英

SQL in Oracle 10g

insert into BOOK values(&bid, '&title', '&pub', &year);

I am getting an error when I run the query in oracle 10g, this is the error message i am getting:

ORA-01008: not all variables bound

By default, SQL Plus treats '&' as a special character that begins a substitution string. So when you run this query oracle will consider bid, title, pub, year as bind variables and prompt you to enter the values for these variables. Enter the values for them it will replace the values and inserts the record into the database.

If you want to turn of the default behavior you can use the following command

SQL> set define off 

Once you want to turn on the default behavior use this command

SQL> set define on

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM