I keep on getting error as said below:
line 10: warning: here-document at line 2 delimited by end-of-file (wanted `')L_QUERY
My shell script code is as follows:
#!/bin/bash
sqlplus -silent USERNAME/PASSWORD@DBS <<SQL_QUERY
begin
for cur_r in (select Branch, Account_Type, Title, FirstName, LastName, Birthday, WorkPhone, HomePhone, Address, State, Zip, Email from accountrequest_temp)
loop
insert into accountrequest (Branch, Account_Type, Title, FirstName, LastName, Birthday, WorkPhone, HomePhone, Address, State, Zip, Email)
values (cur_r.branch, cur_r.account_type, cur_r.title, cur_r.firstname, cur_r.lastname, to_date(cur_r.birthday, 'DD/MM/YYYY), cur_r.workphone, cur_r.homephone, cur_r.address, cur_r.state, cur_r.zip, cur_r.email);
end loop;
end;
SQL_QUERY
Please help.
INSERT INTO...SELECT. This will improve your performance by not making individualINSERTcalls for each record and reducing the number of context switches. If you did that, you wouldn't even need thePL/SQLblock.sqlplusis not even invoked, which in turn means that, whatever error you may have in your SQL query, it has nothing to do with your problem. I can not reproduce the HERE-error, so either you have not pasted your command verbatim (I guess your username is not reallyUSERNAME), or that you have some non-printable characters in your script. My feeling is that the latter is correct, so I would look at the script as a hex-dump to check for erroneous characters.