kenix
1
Hello,
I have a file called Delete and within the delete file I have the following statement:
delete from employee where employee_id = " "
how do I write a script that read from this file and replace:
employee_id = " " with employee_id is null
Please assist...greatly appreciate it.
thanks,
kenix
krishna
2
Hi,
just type the below at $ prompt :
sed 's/employee_id = \" \"/employee_id is null/g' Delete > Delete.new
then check file Delete.new
Thanks
Krishna
csong2
3
Try :
l_var=`sed -e 's/employee_id = " "/employee_id is null/p' <filename> | head -n 1`
l_var is your string variable
<filename> is the file that contains your sql statement
is that what you were looking for?
cheers
kenix
4
Thank you everyone for your help.
This is very helpful to me. I will defintely try this.
Thanks,
Kenix:)