Sponsored Content
Top Forums Shell Programming and Scripting Facing problem in the sqlldr & shell script Post 302590581 by durden_tyler on Monday 16th of January 2012 11:03:50 PM
Old 01-17-2012
Quote:
Originally Posted by xal_kaushi
I am tried sm other method also but

I am getting this error

SQL*Loader: Release 10.2.0.4.0 - Production on Mon Jan 16 19:52:03 2012

Copyright (c) 1982, 2007, Oracle. All rights reserved.

SQL*Loader-291: Invalid bind variable :TIMESTAMP in SQL string for column VDATE.
...
Just specify the datatype ("timestamp") and the format in your control file and Oracle will perform the implicit conversion if your database column is a date.

An example follows:

Code:
$
$
$ # Data in table "t" before load
$
$ echo "select x, to_char(y, 'mm/dd/yyyy hh24:mi:ss') as y from t;" | sqlplus -s test/test

no rows selected

$
$
$ # Contents of my control file "t.ctl" with inline data
$
$ cat -n t.ctl
     1  load data
     2  infile *
     3  replace
     4  into table t
     5  fields terminated by ","
     6  trailing nullcols
     7  (
     8    x  integer external,
     9    y  timestamp 'DD-MON-RR HH.MI.SS.FF6 AM'
    10  )
    11
    12  BEGINDATA
    13  1,28-DEC-11 12.03.14.107137 AM
    14  2,29-DEC-11 09.23.57.123456 PM
    15  3,08-JAN-12 11.59.59.999999 PM
$
$
$ # Load data using sqlldr
$
$ sqlldr userid=test/test control=t.ctl silent=all
$
$
$ # Data in table "t" after load
$
$ echo "select x, to_char(y, 'mm/dd/yyyy hh24:mi:ss') as y from t;" | sqlplus -s test/test

         X Y
---------- -------------------
         1 12/28/2011 00:03:14
         2 12/29/2011 21:23:57
         3 01/08/2012 23:59:59

$
$

Quote:
...
...the format remains the same throughtout but the date change everyday
for eg today is 16-jan
the file is ERIC_VOUCHERDAT16
You can extract the current date from the "date" command of Unix/Linux, like so -

Code:
$
$ date '+%d'
16
$
$

Assign this to a shell variable and use that variable in your filename within the ftp command-list. Or you could use the output of the command above directly in your filename.

HTH,
tyler_durden
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Facing issue in Solaris OS in crontab for running shell script

Hello i have a shell script. it is running fine when i manually run at command prompt using following command ./script_file but while running shell script from crontab, it is giving error in each line. (2 Replies)
Discussion started by: mabrar
2 Replies

2. Shell Programming and Scripting

Rsh & Sqlldr

Dear expert, Can we invoke sqlldr command remotely. When I try rsh command in machine 10.1.65.116, it's failed on sqlloader command. However, nothing wrong on the shell scripts or environment setting of the remote environment, I able to execute in the scripts in remote machine. in machine... (8 Replies)
Discussion started by: epall
8 Replies

3. Shell Programming and Scripting

facing problem in starting a process in background using shell script.

hey all, i am working on sun solaris machine and i want to start a process in background using shell script (actually i wanna start tomcat server using shell script). please dont tell me that append a & at last because this is not working in the shell script. i have also used nohup and... (8 Replies)
Discussion started by: dtomar
8 Replies

4. UNIX for Dummies Questions & Answers

Problem with xterm & tcsh & sourcing a script in a single command

Hi friends, I have a script that sets the env variable path based on different conditions. Now the new path variable setting should not done in the same terminal or same shell. Only a new terminal or new shell should have the new path env variable set. I am able to do this only as follows: >cd... (1 Reply)
Discussion started by: sowmya005
1 Replies

5. Shell Programming and Scripting

sqlldr in shell script

Hi I'm using SQL*Loader in shell script as below sqlldr $uname/$pword@$ORACLE_SID parfile=$test.par for e.g. if $test is 'file1' and getting the below error LRM-00109: could not open parameter file 'file1' LRM-00113: error when processing file 'file1' SQL*Loader: Release... (7 Replies)
Discussion started by: vinoth_kumar
7 Replies

6. Shell Programming and Scripting

Problem facing command using shell

Dear Brothers! Need your help for the case where I am running one command on prompt and its giving us the correct output, but when i use the same command from shell its directs no output.:wall: the command on command prompt is ls -ltrh * | nawk '{if ($5~ '/$'M'/') print $9}' | grep -v... (1 Reply)
Discussion started by: jojo123
1 Replies

7. Shell Programming and Scripting

Facing problem with Alias created through script.

Hi Guru's, I am creating alias for db instance running on a server through script, am able to create them based on /etc/oratab entries and can use successfully with the below script. #!/bin/bash SCRIPT_PATH=${HOME}/scripts/db/script... (3 Replies)
Discussion started by: venky.b5
3 Replies

8. Shell Programming and Scripting

Sqlldr call via shell script prompts error

Good morning, I'm attempting to call sqlldr via shell script and it is prompting endIf is unec #!/bin/sh cd /tmp/v_tst FILENAME_WANTED=`date +"HourlyData_%Y%m%d_%H00.txt"` echo "FILENAME_WANTED = ${FILENAME_WANTED}" LIST_OF_FILES=`ls -rt HourlyData*.txt |tail -1` LIST_OF_FILES=`basename... (4 Replies)
Discussion started by: V1l1h1
4 Replies

9. Shell Programming and Scripting

Facing issues with shell script changes

My current requirement is to replace xxyxx string with value of date date1 variable holds a date and the current script writes html tags to a file as follows echo date1 nawk 'BEGIN{ FS="," print "<HTML>""<HEAD>""<p>Hi All,<br><br>There are no cases closed on the xxyxx" print ... (2 Replies)
Discussion started by: Rajesh A S
2 Replies
MDBTools(1)															       MDBTools(1)

NAME
mdb-export - Export data in an MDB database table to CSV format. SYNOPSIS
mdb-export [-H] [-d delimiter] [-R row_delim] [[-Q] | [-q quote [-X escape]]] [-I] [-D format] database table DESCRIPTION
mdb-export is a utility program distributed with MDB Tools. It produces a CSV (comma separated value) output for the given table. Such output is suitable for importation into databases or spread- sheets. OPTIONS
-H Supress header row -Q Don't wrap text-like fields (text, memo, date) in quotes. If not specified text fiels will be surrounded by " (double quote) char- acters. -d Specify an alternative column delimiter If no delimiter is specified, table names will be delimited by a , (comma) character. -R Specify a row delimiter -I INSERT statements (instead of CSV). You must specify the SQL dialect. -D Set the date format (see strftime(3) for details) -q Use to wrap text-like fields. Default is ". -X Use to escape quoted characters within a field. Default is doubling. -N namespace Prefix identifiers with namespace. NOTES
ENVIRONMENT
MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. MDBOPTS semi-column separated list of options: o use_index o no_memo o debug_like o debug_write o debug_usage o debug_ole o debug_row o debug_props o debug_all is a shortcut for all debug_* options SEE ALSO
gmdb2(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1) mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) HISTORY
mdb-export first appeared in MDB Tools 0.1. AUTHORS
The mdb-export utility was written by Brian Bruns. BUGS
Memo fields are allowed to contain a newline characters, the current program does nothing about this. 0.7 13 July 2013 MDBTools(1)
All times are GMT -4. The time now is 05:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy