10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
As we are using SQLPLUS command to connect Oracle Database in unix:
Like below syntax:
sqlplus username/password@dbname << EOI
SET HEADING OFF
SPOOL MAX_DATE_VAL.txt
select max(LAST_UPDT_DATE) from source_defect;
SPOOL OFF
here the result is stored in... (0 Replies)
Discussion started by: Shilpi Gupta
0 Replies
2. Shell Programming and Scripting
Hi, I am trying to use Teradata fastexport in ksh, but getting error as below
temp1.ksh: line 7: syntax error at line 10: `newline' unexpected
below is my code:
#!/bin/ksh
LOGON_STR="TDDB/user,paswd;"
DATAFILE=/path/a.lst;
DEBUG=0
>$DATAFILE
fexp > /dev/null... (3 Replies)
Discussion started by: usrrenny
3 Replies
3. UNIX and Linux Applications
Has anyone used either bteq or mload for inserting into a Teradata Database via perl. We're running Red Hat Enterprise 5.7. I've gotten the DBD::ODBC drivers installed and running. I installed the Teradata ICU, TeraGSS and ODBC pkgs. We are using perl to insert data across the network into... (1 Reply)
Discussion started by: islanderman
1 Replies
4. Shell Programming and Scripting
In a .txt file i have a set of teradata queries which i need to execute and capture result for all queries.Is there any way to run teradata queries from a file? (1 Reply)
Discussion started by: katakamvivek
1 Replies
5. Shell Programming and Scripting
Hi,
I want a script for connecting teradata to load the file to teradata table.
Can you please help me out.
Thanks in advance. (1 Reply)
Discussion started by: victory
1 Replies
6. Shell Programming and Scripting
Hi All,
I am trying to export a file using Fast Export (Teradata) in UNIX. The desired output length is 550 bytes, but the output file is creating string till 75 characters. How to get the full length file?
.LOGON
.EXPORT file=export.txt;
SELECT CAST(('' ||
(CAST('UD ' AS CHAR(3))) || ... (2 Replies)
Discussion started by: unankix
2 Replies
7. Shell Programming and Scripting
Hi, I've been trying to develop a script that performs the parsing of a log every 1 minute and then generating some statistics. I'm fairly new to programming and this is why I come to ask if I can lend a hand.
this is my log:
xxxx 16/04/2012 17:00:52 - xxxx714 - E234 - Time= 119 ms.... (8 Replies)
Discussion started by: jockx
8 Replies
8. Programming
How do i connect from C program to teradata Database?
The C program is being executed from a Unix script, AIX.
I am calling a C program from a Unix shell script and the C Program executes some SQLs on Teradata Database. (3 Replies)
Discussion started by: yschd
3 Replies
9. Programming
hi,
I want to compile a program in C. It have a multiple calls to teradata. I have no idea how to compile in Aix.
The compiler that I should be use is cc.
I tried
cc -G -KPIC tdsfbd0358.c this generates a tdsfbd0358.i and after I have no Idea what I have to make, a link? how?... (3 Replies)
Discussion started by: kajum
3 Replies
10. Programming
I am trying execute a sql file from the script and the sql file has the following code snippet, which throws out the error given below
FOR C_FINELINE_LP AS CURSOR C_SLS FOR
SELECT * FROM WM_UTIL.FLT_DEP
WHERE LOAD_IND = 'N'
DO
.....
.....
....
END FOR;
FOR C_FLTSLS_STR_LP AS... (0 Replies)
Discussion started by: yschd
0 Replies
DATEINTERVAL.FORMAT(3) 1 DATEINTERVAL.FORMAT(3)
DateInterval::format - Formats the interval
SYNOPSIS
public string DateInterval::format (string $format)
DESCRIPTION
Formats the interval.
PARAMETERS
o $format
-
The following characters are recognized in the $format parameter string. Each format character must be prefixed by a percent sign (
%).
+------------------+--------------------------------------+---+
|$format character | | |
| | | |
| | Description | |
| | | |
| | Example values | |
| | | |
+------------------+--------------------------------------+---+
| | | |
| % | | |
| | | |
| | Literal % | |
| | | |
| | | |
| | % | |
| | | |
| | | |
| Y | | |
| | | |
| | Years, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03 | |
| | | |
| | | |
| y | | |
| | | |
| | Years, numeric | |
| | | |
| | | |
| | 1, 3 | |
| | | |
| | | |
| M | | |
| | | |
| | Months, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 12 | |
| | | |
| | | |
| m | | |
| | | |
| | Months, numeric | |
| | | |
| | | |
| | 1, 3, 12 | |
| | | |
| | | |
| D | | |
| | | |
| | Days, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 31 | |
| | | |
| | | |
| d | | |
| | | |
| | Days, numeric | |
| | | |
| | | |
| | 1, 3, 31 | |
| | | |
| | | |
| a | | |
| | | |
| | Total number of days as a result of | |
| | a DateTime::diff or (unknown) other- | |
| | wise | |
| | | |
| | | |
| | 4, 18, 8123 | |
| | | |
| | | |
| H | | |
| | | |
| | Hours, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 23 | |
| | | |
| | | |
| h | | |
| | | |
| | Hours, numeric | |
| | | |
| | | |
| | 1, 3, 23 | |
| | | |
| | | |
| I | | |
| | | |
| | Minutes, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 59 | |
| | | |
| | | |
| i | | |
| | | |
| | Minutes, numeric | |
| | | |
| | | |
| | 1, 3, 59 | |
| | | |
| | | |
| S | | |
| | | |
| | Seconds, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 57 | |
| | | |
| | | |
| s | | |
| | | |
| | Seconds, numeric | |
| | | |
| | | |
| | 1, 3, 57 | |
| | | |
| | | |
| R | | |
| | | |
| | Sign " -" when negative, " +" when | |
| | positive | |
| | | |
| | | |
| | -, + | |
| | | |
| | | |
| r | | |
| | | |
| | Sign " -" when negative, empty when | |
| | positive | |
| | | |
| | | |
| | -, | |
| | | |
+------------------+--------------------------------------+---+
RETURN VALUES
Returns the formatted interval.
NOTES
Note
The DateInterval::format method does not recalculate carry over points in time strings nor in date segments. This is expected
because it is not possible to overflow values like "32 days" which could be interpreted as anything from "1 month and 4 days" to "1
month and 1 day".
EXAMPLES
Example #1
DateInterval example
<?php
$interval = new DateInterval('P2Y4DT6H8M');
echo $interval->format('%d days');
?>
The above example will output:
4 days
Example #2
DateInterval and carry over points
<?php
$interval = new DateInterval('P32D');
echo $interval->format('%d days');
?>
The above example will output:
32 days
Example #3
DateInterval and DateTime::diff with the %a and %d modifiers
<?php
$january = new DateTime('2010-01-01');
$february = new DateTime('2010-02-01');
$interval = $february->diff($january);
// %a will output the total number of days.
echo $interval->format('%a total days')."
";
// While %d will only output the number of days not already covered by the
// month.
echo $interval->format('%m month, %d days');
?>
The above example will output:
31 total days
1 month, 0 days
SEE ALSO
DateTime::diff.
PHP Documentation Group DATEINTERVAL.FORMAT(3)