sql - While inserting multiple rows what does the statement 'select 1 from dual' do? -


while inserting multiple rows table using following style :

insert  ghazal_current (ghazalname,rating) values('ajab apna haal hota jo visaal-e-yaar hota',5) ghazal_current (ghazalname,rating) values('apne hothon par sajana chahta hun',4) ghazal_current (ghazalname,rating) values('shaam se aankh mein nami si hai',4) ghazal_current (ghazalname,rating) values('tumhe yaad ho ke na yaad ho',3)  select 1 dual; 

what statement select 1 dual mean ? here ?

dual built-in table, useful because guaranteed return 1 row. means dual may used pseudo-columns such user or sysdate, results of calculations , like. owner of dual sys can accessed every user. dual well-covered in documentation. find out more.

in case, select 1 dual; returns 1. need because insert syntax demands select clause not querying input values table.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -