11-09-2009
The ouput expecting is
After running the below sql query
select ename,eid,edate from emp where trunc(edate) = trunc(to_Date(sysdate))
output is
Ename Eid Edate
-----------------
xyz 987 8-11-2009
abc 453 8-11-2009
Expecting output is
Ename Eid Edate
-----------------
xyz 0987 08-11-2009
abc 0453 08-11-2009
Where 0(zero) was missing in the column Eid and Edate after export the results to csv file.
Please suggest me
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I know in oracle a .sql file is called by @ <path> /<filename>.
But how to call in sql 2005, I am opening the sql sessionwith sqsh, is there any command to execute there a .sql file (query in sql 2005) in K shell script. (0 Replies)
Discussion started by: n2ekhil
0 Replies
2. UNIX for Dummies Questions & Answers
Hi guys,
I am new on here, I have a function in oracle that returns a specific value:
create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies
3. UNIX for Dummies Questions & Answers
This is basically what I want to do:
I have a file that contains single lines of IDs.
I want to query the oracle database using these IDs
to get a count of which ones match a certain condition.
the basic idea is:
cat myfile |
while read id
do
$id in select count(PC.ptcpnt_id)
from... (4 Replies)
Discussion started by: whoknows
4 Replies
4. Shell Programming and Scripting
Hi,
I have data in my text file something like this.
adams
robert
ahmed
gibbs
I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell.
If you have code for similar scenario , please ehlp.
I want the output of the sql query... (7 Replies)
Discussion started by: rdhanek
7 Replies
5. Shell Programming and Scripting
Can someone help me on creating a script that will manage/create a csv file from Pl/Sql using UNIX?Any advice is welcome,thank you so much,:) (2 Replies)
Discussion started by: Atrap
2 Replies
6. Shell Programming and Scripting
I need to run sql script from shell script which takes the input from a file and contents of file will be like :
12345
34567
78657
and query will be like :
select seq_nbr from bus_event where event_nbr='12345';
select seq_nbr from bus_event where event_nbr='34567';
select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies
7. Shell Programming and Scripting
Hi,
I never did this before... what I want to do is execute a SQL query from a unix script and redirect sql query's output to a flat file (comma separated one) without the header info (no column names). I would also want not to print the query's output to the screen.
snapshot of my script:... (13 Replies)
Discussion started by: juzz4fun
13 Replies
8. Shell Programming and Scripting
Hi All,
Seeking for your assistance to read each line $1 and $2 of input file and used it to query.
Ex. file1.txt(number range)
9064500000 9064599999
9064600000 9064699999
9064700000 9064799999
Database name: ranges_log
a_no message
9064500001 test
9064700000 ... (7 Replies)
Discussion started by: znesotomayor
7 Replies
9. 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
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
fbsql_read_clob
FBSQL_READ_CLOB(3) 1 FBSQL_READ_CLOB(3)
fbsql_read_clob - Read a CLOB from the database
SYNOPSIS
string fbsql_read_clob (string $clob_handle, [resource $link_identifier])
DESCRIPTION
Reads CLOB data from the database.
If a select statement contains BLOB and/or CLOB columns FrontBase will return the data directly when data is fetched. This default behav-
ior can be changed with fbsql_set_lob_mode(3) so the fetch functions will return handles to BLOB and CLOB data. If a handle is fetched a
user must call fbsql_read_clob(3) to get the actual CLOB data from the database.
PARAMETERS
o $clob_handle
- A CLOB handle, returned by fbsql_create_clob(3).
o $
link_identifier -A FrontBase link identifier returned by fbsql_connect(3) or fbsql_pconnect(3).If optional and not specified, the
function will try to find an open link to the FrontBase server and if no such link is found it will try to create one as if
fbsql_connect(3) was called with no arguments.
RETURN VALUES
Returns a string containing the specified CLOB data.
EXAMPLES
Example #1
fbsql_read_clob(3) example
<?php
$link = fbsql_pconnect("localhost", "_SYSTEM", "secret")
or die("Could not connect");
$sql = "SELECT CLOB_COLUMN FROM CLOB_TABLE;";
$rs = fbsql_query($sql, $link);
$row_data = fbsql_fetch_row($rs);
// $row_data[0] will now contain the clob data for the first row
fbsql_free_result($rs);
$rs = fbsql_query($sql, $link);
fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE);
$row_data = fbsql_fetch_row($rs);
// $row_data[0] will now contain a handle to the CLOB data in the first row
$clob_data = fbsql_read_clob($row_data[0]);
fbsql_free_result($rs);
?>
SEE ALSO
fbsql_create_clob(3), fbsql_read_blob(3), fbsql_set_lob_mode(3).
PHP Documentation Group FBSQL_READ_CLOB(3)