Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Convert Update statement into Insert statement in UNIX using awk, sed....

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 03-22-2016
Hammer & Screwdriver Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks,

I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.

I have a bunch of update statements with all columns in a file which I need to convert into insert statements.

UPDATE TABLE_A SET COL1=1 WHERE COL2 is NULL AND COL2=3;

OUTPUT Should be:

INSERT INTO TABLE_A (COL1,COL2,COL3) VALUES (1,NULL,3);

Many Thanks.

Last edited by dev123; 03-22-2016 at 11:07 AM..
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Single quotes insert statement using awk Mathew_paul Shell Programming and Scripting 1 09-27-2017 11:27 AM
How to insert date in a statement? pinpe Shell Programming and Scripting 8 07-09-2011 12:49 PM
How to insert numbers to a in between statement pinpe Shell Programming and Scripting 14 06-19-2011 04:33 PM
Assign variable for INSERT INTO statement Poonamol Programming 16 10-25-2010 03:51 PM
Dynamic Insert statement pritish.sas Programming 1 07-30-2009 03:37 PM
error in insert statement ragavhere Shell Programming and Scripting 2 12-08-2008 02:44 AM
How is use sselect statement o/p in insert statement. nkosaraju Shell Programming and Scripting 2 08-06-2008 09:26 PM
How to convert unix command into Awk statement krishna_gnv Shell Programming and Scripting 1 05-20-2008 10:58 AM
Insert TAB in echo statement sunils27 Shell Programming and Scripting 5 08-26-2005 03:36 AM
awk command for INSERT statement nattynatty Shell Programming and Scripting 4 05-10-2002 02:11 PM


All times are GMT -4. The time now is 11:15 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password