06-18-2011
Hi
Please post your sample output of your query, and also, how you would like it t be formatted. I mean how you would like the formatted output to look like.
Guru.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all, im new to the forums and i hope im not asking a heavily posted Q but here goes.
I use the following script to do a simple calculation, the problem is, the data i receive is in the form of numbers with commas i.e.
1,000,000
This code below wont recognise the commas so i have to remove... (2 Replies)
Discussion started by: benjo
2 Replies
2. Shell Programming and Scripting
Hi,
I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification
in short
select var,data from usage;
o/p=... (1 Reply)
Discussion started by: rkrish
1 Replies
3. Shell Programming and Scripting
Hello everyone,
I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected.
I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
Discussion started by: rockf1bull
3 Replies
4. Shell Programming and Scripting
Hi Guys..
Need your help to format the output of my shell script.
I am using spool command to take out put in csv file.
below is my code. (for example)
col USERNAME for a15
col EMAIL for a30
col FULL_NAME for a20
col LAST_LOGIN for a40
col DATE_CREATED for a40
SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies
5. Shell Programming and Scripting
I am facing a problem formatting the output of my shell script in excel.
We are directing the output of the script to an excel sheet and need long integer type data printed in Excel as it is (i.e. not in the default scientific notation).
Also, leading zeroes(if any) in the output are getting... (4 Replies)
Discussion started by: bornali.p
4 Replies
6. Shell Programming and Scripting
HI,
I want to connect to database and fetch the count from a table.
The sql query is as below :
select count(*) from table_test where test_column='read';
How can I print the output of this statement using shell script.
Thanks in advance. (4 Replies)
Discussion started by: confused_info
4 Replies
7. Shell Programming and Scripting
Hi All,
#!/bin/ksh
call_sql ()
{
sql=$1
sqlplus -s $sqlparam_sieb <<EOF
SET ECHO OFF;
SET NEWPAGE NONE;
SET SQLBL OFF;
SET VERIFY OFF;
SET LINESIZE 2000;
SET... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies
8. Shell Programming and Scripting
I want to run sql query in shell script and output data save as delimited text (delimited text would be comma)
Code:
SPOOL_FILE=/pgedw/dan.txt
SQL=/pgedw/dan.sql
sqlplus -s username/password@myhost:port/servicename <<EOF
set head on
set COLSEP ,
set linesize 32767
SET TRIMSPOOL ON
SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies
9. Shell Programming and Scripting
I am writing the following script to create the file v_out.txt.
sqlplus -s /nolog << EOF
CONNECT scott/tiger@orcl;
whenever sqlerror exit sql.sqlcode;
set newpage 0;
SET PAGESIZE 0;
SET ECHO OFF;
SET FEEDBACK OFF;
SET HEADING OFF;
SET VERIFY OFF;
SET LINESIZE 100;
set tab off;
set... (7 Replies)
Discussion started by: itzkashi
7 Replies
10. UNIX for Beginners Questions & Answers
I am trying to write SQL query output into a .csv file. But in the output columns are displaying in different lines instead of coming in one line.
Main Code shell script:
this is my code:
#!/bin/bash
file="db_detail.txt"
. $file
rm /batch/corpplan/bin/dan.csv... (6 Replies)
Discussion started by: sandeepgoli53
6 Replies
LEARN ABOUT PHP
datetime.format
DATETIME.FORMAT(3) 1 DATETIME.FORMAT(3)
DateTime::format - Returns date formatted according to given format
Object oriented style
SYNOPSIS
public string DateTime::format (string $format)
DESCRIPTION
string DateTimeImmutable::format (string $format) string DateTimeInterface::format (string $format)
Procedural style
string date_format (DateTimeInterface $object, string $format)
Returns date formatted according to given format.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3)
o $format
- Format accepted by date(3).
RETURN VALUES
Returns the formatted date string on success or FALSE on failure.
EXAMPLES
Example #1
DateTime.format(3) example
Object oriented style
<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>
Procedural style
<?php
$date = date_create('2000-01-01');
echo date_format($date, 'Y-m-d H:i:s');
?>
The above example will output:
2000-01-01 00:00:00
NOTES
This method does not use locales. All output is in English.
SEE ALSO
date(3).
PHP Documentation Group DATETIME.FORMAT(3)