Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to convert R$Timestamp in Sql*Plus within a UNIX Shell Script? Post 302828915 by Dapconsult on Wednesday 3rd of July 2013 01:16:25 PM
Old 07-03-2013
Wrench How to convert R$Timestamp in Sql*Plus within a UNIX Shell Script?

I need to compare a R$Timestamp field sql within a Unix Shell Script.
In straight SQL the following code works fine:

Table Name: LL_UNIT_TRANSACTION UT
Field: R$Timestamp

Where TRUNC(UT.R$Timestamp) >= TRUNC(SYSDATE -7)


the following returns no data within the Unix Shell Script
AND TRUNC(DATE '1970-01-01' + UT.TIMESTAMP/86400) >= TRUNC(SYSDATE -7)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Unix Timestame to real timestamp

Hello, Did anyone know how to use script (e.g. perl) to conver Unix Timestame to real timestame in GMT+8 ? 1245900787 file:/tmp/a/Test/.txt.swp has created 1245900988 file:/tmp/a/Test/.txt.swp has changed Thu, 25 Jun 2009 11:33:07 GMT+8 file:/tmp/a/Test/.txt.swp has created Thu, 25 Jun... (4 Replies)
Discussion started by: happyday
4 Replies

2. Shell Programming and Scripting

To convert a date(in string format) to unix timestamp

Hi All, I have a string like below. "Mar 31 2009" . I want to convert this to unix time . Also please let me know how to find the unix time for the above string minus one day. For Eg. if i have string "Mar 31 2009" i want to find the unix time stamp of "Mar 30 2009". Thanks in advance,... (11 Replies)
Discussion started by: girish.raos
11 Replies

3. AIX

Convert unix timestamp to year month day format ?

Hello, How do I convert unix timestamp value to 'normal' date format - to get year month and day values ? Looks like it's easy to do using GNU date (linux systems). But how do I do tthis on AIX ? I don't want to write C program, any ways to do that using unix shells ? thanks (1 Reply)
Discussion started by: vilius
1 Replies

4. AIX

convert a specific date to a unix timestamp

hello, i have an AIX5.3 machine and i am writing a script to display some processes. inside the script i want to get the time that the process starts and convert it to a unix timestamp. is there a command that i can use to do that? i search the web but all i found is long scripts and it does... (4 Replies)
Discussion started by: omonoiatis9
4 Replies

5. Shell Programming and Scripting

Convert the SQL Query in Shell Script

Hi All, I have a query with output below select 'create synonym "'||TABLE_NAME||'" for '||Table_owner||'."'||table_name||'"'||chr(59) from user_synonyms; ================== create synonym "RV_SBC_SIG" for WFCONTROLLER_TE."RV_SBC_SIG"; create synonym "AQM_TASK" for AWQM_TE."AQM_TASK";... (2 Replies)
Discussion started by: pvmanikandan
2 Replies

6. Shell Programming and Scripting

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX?

Please share the doc asap as very urgently required. (1 Reply)
Discussion started by: 24ajay
1 Replies

7. Shell Programming and Scripting

How to pass Oracle sql script as argument to UNIX shell script?

Hi all, $ echo $SHELL /bin/bash Requirement - How to pass oracle sql script as argument to unix shell script? $ ./output.sh users.sql Below are the shell scripts and the oracle sql file in the same folder. Shell Script $ cat output.sh #!/bin/bash .... (7 Replies)
Discussion started by: a1_win
7 Replies

8. Shell Programming and Scripting

Convert UNIX timestamp to readable format in the file

Hello I have a file : file1.txt with the below contents : 237176 test1 test2 1442149024 237138 test3 test4 1442121300 237171 test5 test7 1442112823 237145 test9 test10 1442109600 In the above file fourth field represents the timestamp in Unix format. I found a command which converts... (6 Replies)
Discussion started by: rahul2662
6 Replies

9. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

10. Shell Programming and Scripting

Convert date in dd mm yyyy format to UNIX timestamp

Hello All, I have a date in DD/MM/YYYY format. I am trying to convert this into unix timestamp. I have tried following: date -d $mydate +%s where mydate = 23/12/2016 00:00:00 I am getting following error: date: extra operand `+%s' Try `date --help' for more information. ... (1 Reply)
Discussion started by: angshuman
1 Replies
TRUNC(3)						     Linux Programmer's Manual							  TRUNC(3)

NAME
trunc, truncf, truncl - round to integer, toward zero SYNOPSIS
#include <math.h> double trunc(double x); float truncf(float x); long double truncl(long double x); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): trunc(), truncf(), truncl(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; or cc -std=c99 DESCRIPTION
These functions round x to the nearest integer not larger in absolute value. RETURN VALUE
These functions return the rounded integer value. If x is integral, infinite, or NaN, x itself is returned. ERRORS
No errors occur. VERSIONS
These functions first appeared in glibc in version 2.1. ATTRIBUTES
Multithreading (see pthreads(7)) The trunc(), truncf(), and truncl() functions are thread-safe. CONFORMING TO
C99, POSIX.1-2001. NOTES
The integral value returned by these functions may be too large to store in an integer type (int, long, etc.). To avoid an overflow, which will produce undefined results, an application should perform a range check on the returned value before assigning it to an integer type. SEE ALSO
ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2013-06-21 TRUNC(3)
All times are GMT -4. The time now is 01:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy