Search Results

Search: Posts Made By: ustechie
3,737
Posted By ustechie
because I was not sure whether it comes under...
because I was not sure whether it comes under unix scripting or any other kind of script.
3,737
Posted By ustechie
No.....this is not Unix....I realized it is a...
No.....this is not Unix....I realized it is a windows batch file...I am pasting the complete code....this might help u in understanding the flow....

rem Create Date variable
FOR /F "TOKENS=1*...
3,737
Posted By ustechie
Need help on "VDATE" function
Hi,

I have a batch job which FTPs source feeds to the server. It has a function "VDATE" which is used to extract current date and it was used to add the date in the log file as suffix. Following...
4,829
Posted By ustechie
First of all thanks a lot......!!! you came...
First of all thanks a lot......!!!
you came like a savior.....

there is a separate script which checks the count.....I implemented simple extraction of WHERE clause and creation of SELECT...
4,829
Posted By ustechie
Hi Scottn... your resolution is...
Hi Scottn...

your resolution is working.....I tried to modify it so that it can work for both small cases and upper cases.....plz check if this looks good:

sed "s/ [sS][eE][tT] / #!#!#...
4,829
Posted By ustechie
This is the sql mentioned in the input file: ...
This is the sql mentioned in the input file:

UPDATE TFNCLMRSV_INFO old SET old.cur_rec_ind = 'Y', old.CLM_RSV_UPDT_TS = current timestamp WHERE old.cur_rec_ind = 'N' AND old.CLM_RSV_INSRT_TS =...
4,829
Posted By ustechie
sure... This is the sql mentioned in the...
sure...


This is the sql mentioned in the input file:
UPDATE TFNCLMRSV_INFO old SET old.cur_rec_ind = 'Y', old.CLM_RSV_UPDT_TS = current timestamp WHERE old.cur_rec_ind = 'N' AND...
4,829
Posted By ustechie
Hey Thanks a lot Scottn!!! This is exactly...
Hey Thanks a lot Scottn!!!

This is exactly what I was looking for....thanks again.....

I have 1 more doubt.....Now I want to replace the 1st WHERE from the result mentioned above with 'SELECT...
4,829
Posted By ustechie
How to extract WHERE clause from a SQL using UNIX???
Hi,

I need to know how to extract entire WHERE clause from a SQL statement using UNIX command.


For example:
If following is the SQL then how to extract entire WHERE clause:
UPDATE...
1,626
Posted By ustechie
How to extract entire WHERE clause from a SQL using UNIX
Hi UNIX Gurus,

I have a SQL utility which fires DML statements against DB2 tables. Logic is to identify DML statements, put it into a file ($dml) and execute the job.

DML file can have more...
1,213
Posted By ustechie
hey thanx...... its has helped me in...
hey thanx......
its has helped me in understanding the correct logic here....
thanks a lot!!!!
1,213
Posted By ustechie
yes...it is awk.....
yes...it is awk.....
1,213
Posted By ustechie
Plz explain the process of this code....
Hi Unix Gurus,

Please explain the processing done by the code mentioned below:

for (i=1;i<=59;i++)
{
sub(/ *$/,"", $i)
}
newrec_key = $2
new_line = $0
if (empty_oldfile==1)
{...
3,088
Posted By ustechie
ohh is it..... format is not fixed.....it could...
ohh is it.....
format is not fixed.....it could be in 1 line or may be in different lines.....

also it is not sure that it has be an update statement....it could also be a selete statement and...
3,088
Posted By ustechie
UPDATE TFNCLMRSV_INFO old SET old.cur_rec_ind =...
UPDATE TFNCLMRSV_INFO old SET old.cur_rec_ind = 'Y', old.CLM_RSV_UPDT_TS = current timestamp WHERE old.cur_rec_ind = 'N' AND old.CLM_RSV_INSRT_TS = (SELECT max(new.CLM_RS
V_INSRT_TS) FROM...
3,088
Posted By ustechie
tried this code: awk '/UPDATE/,/;/ $0 ~...
tried this code:
awk '/UPDATE/,/;/ $0 ~ "UPDATE" {getline;print "Select COUNT(*) from " $0} /WHERE/,/;/' $dml


getting following result:
Select COUNT(*) from
3,088
Posted By ustechie
UPDATE TFNCLMRSV_INFO old SET ...
UPDATE
TFNCLMRSV_INFO old
SET
old.cur_rec_ind = 'Y',
old.CLM_RSV_UPDT_TS = current timestamp
WHERE
old.cur_rec_ind = 'N' AND
old.CLM_RSV_INSRT_TS = (SELECT max(new.CLM_RSV_INSRT_TS)...
3,088
Posted By ustechie
ohh...i am sorry if i didnt make it clear....i...
ohh...i am sorry if i didnt make it clear....i also tried this one but not getting the result as expected.....

dev_server$ awk '/UPDATE/,/;/ $0 ~ "UPDATE" {getline;print "Select COUNT(*) from "...
3,088
Posted By ustechie
dev_server$ awk '{print}/UPDATE/,/;/ $0 ~...
dev_server$ awk '{print}/UPDATE/,/;/ $0 ~ "UPDATE" {getline; a="Select COUNT(*) from " $0} /WHERE/,/;/{a=a"\n"$0;} $0 ~ /;$/{print a;}' $dml

UPDATE <TABLE_NAME> ........; same query again instead...
3,088
Posted By ustechie
@ Franklin: no....i was getting same query...
@ Franklin: no....i was getting same query again.....i mean the updte query i mentione in the input file....

@ Anurag: what needs to be used in place of input file, i am using the file name having...
3,088
Posted By ustechie
its not creating a SELECT COUNT(*) query from...
its not creating a SELECT COUNT(*) query from that query.....
UPDATE query remains unchanged after executing this command.....
3,088
Posted By ustechie
Need help in GREP command.....
Hi UNIX Gurus,

I want to grep the WHERE clause mentioned in the SQL like below or from all the complez queries having this kind of logic. Basic intention is to check the record count impacted by...
6,799
Posted By ustechie
I am sorry.....I didnt get this....... was it...
I am sorry.....I didnt get this.......
was it for me? I can not relate it with my posts.......
6,799
Posted By ustechie
This is not possible as the script is a generic...
This is not possible as the script is a generic script. We cannot use that logic because the table name keeps on changing every time we execute that script. Currently this script was used for this...
6,799
Posted By ustechie
Record value is not greater than the field size. ...
Record value is not greater than the field size.
In fact there is no data in that field but the length of that field is greater than 254 char (VARCHAR 255). This is causing the issue.
Showing results 1 to 25 of 59

 
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy