Sponsored Content
Top Forums Shell Programming and Scripting How to replace actual generated date with sysdate? Post 302773483 by jediwannabe on Thursday 28th of February 2013 04:03:41 AM
Old 02-28-2013
How to replace actual generated date with sysdate?

Hi,

currently I've a file with the following content:

Code:
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('024', '024', 2, to_date('29-03-2008 05:16:09', 'dd-mm-yyyy hh24:mi:ss'));
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('032', '032', 2, to_date('24-04-2008 05:17:30', 'dd-mm-yyyy hh24:mi:ss'));
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('034', '034', 2, to_date('24-04-2008 05:17:30', 'dd-mm-yyyy hh24:mi:ss'));

I need to replace the date with SYSDATE, i.e.


Code:
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('024', '024', 2, sysdate);
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('032', '032', 2, sysdate);
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('034', '034', 2, sysdate);

how do I change the above?

thanks a lot!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to FTP fiels according to generated date

Hi, I need to get some files from a server via ftp. normaly I use following scrip, it is worrking fine. cd dir_name ftp -v -n "10.76.170.17" << cmd user "rbi" "rbi" cd recordreceive prompt... (0 Replies)
Discussion started by: maheshsri
0 Replies

2. Shell Programming and Scripting

Need a script to Append date to generated .txt file

Hi, Can anyone plz share their experience with - Building shell script to append the file with date in following format- Filename_MMDDYYYY.txt Thanks in advance (2 Replies)
Discussion started by: prince_of_focus
2 Replies

3. Shell Programming and Scripting

Open the file and replace the variable with actual value

Hi, i have a sql file named sample.sql. The query is given below. select count(*) from $TABLE_NAME In the main script, i am sourcing this sql. I need to replace the $TABLE_NAME with actual value, before running the query. How can i achieve that? The logic i tried is given below:... (3 Replies)
Discussion started by: bharathappriyan
3 Replies

4. Shell Programming and Scripting

Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi, I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing. The above requirement i want in Shell script(KSH)... Can any one please help me? Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies

5. Shell Programming and Scripting

Replace a pattern in a file with a generated number using sed or awk

my file has thousands of line but let me show what i want to achieve... here is one line from that file cat fileName.txt (2,'','user3002,user3003','USER_DATA_SINGLE',1,0,0,'BACKUP',2,NULL,0,450,NULL,NULL,'','2011-05-10... (13 Replies)
Discussion started by: vivek d r
13 Replies

6. UNIX for Advanced & Expert Users

Script to rename file that was generated today and which starts with date

hello, can someone please suggest a script to rename a file that was generated today and filename that being generated daily starts with date, its a xml file. here is example. # find . -type f -mtime -1 ./20130529_4995733057260357019.xml # this finename should be renamed to this format.... (6 Replies)
Discussion started by: bobby320
6 Replies

7. HP-UX

Actual date minus six months (HP UX)

Hi there, is it possible to get the actual date minux six months with just a simple command? It's easy with Linux but on HP Unix (for me) impossible ;) Best wishes (3 Replies)
Discussion started by: System
3 Replies

8. Shell Programming and Scripting

Pass system date and sysdate-7 in script through crontab

Hi , I have to schedule one job in crontab, but with two parameters. 1. Sysdate in YYYYMMDD format 2. Sysdate - 7 in YYYYMMDD format Please suggest how to do that. Thanks in advance. (1 Reply)
Discussion started by: Anupam_Halder
1 Replies

9. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

10. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
YACC(1) 						    BSD General Commands Manual 						   YACC(1)

NAME
yacc -- an LALR(1) parser generator SYNOPSIS
yacc [-dlrtv] [-b file_prefix] [-o output_filename] [-p symbol_prefix] filename DESCRIPTION
Yacc reads the grammar specification in the file filename and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. Yacc normally writes the parse tables and the driver routine to the file y.tab.c. The following options are available: -b file_prefix Change the prefix prepended to the output file names to the string denoted by file_prefix. The default prefix is the character y. -d Cause the header file y.tab.h to be written. -l If the -l option is not specified, yacc will insert #line directives in the generated code. The #line directives let the C compiler relate errors in the generated code to the user's original code. If the -l option is specified, yacc will not insert the #line directives. Any #line directives specified by the user will be retained. -o output_filename Cause yacc to write the generated code to output_filename instead of the default file, y.tab.c. -p symbol_prefix Change the prefix prepended to yacc-generated symbols to the string denoted by symbol_prefix. The default prefix is the string yy. -r Cause yacc to produce separate files for code and tables. The code file is named y.code.c, and the tables file is named y.tab.c. -t Change the preprocessor directives generated by yacc so that debugging statements will be incorporated in the compiled code. -v Cause a human-readable description of the generated parser to be written to the file y.output. If the environment variable TMPDIR is set, the string denoted by TMPDIR will be used as the name of the directory where the temporary files are created. FILES
y.code.c y.tab.c y.tab.h y.output /tmp/yacc.aXXXXXXXXXX /tmp/yacc.tXXXXXXXXXX /tmp/yacc.uXXXXXXXXXX DIAGNOSTICS
If there are rules that are never reduced, the number of such rules is reported on standard error. If there are any LALR(1) conflicts, the number of conflicts is reported on standard error. BSD
May 24, 1993 BSD
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy