Sponsored Content
Full Discussion: Call SQL LOADER FROM UNIX
Top Forums UNIX for Dummies Questions & Answers Call SQL LOADER FROM UNIX Post 302955357 by sam1234 on Wednesday 16th of September 2015 03:20:01 PM
Old 09-16-2015
Call SQL LOADER FROM UNIX

HI Experts,

I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.

Also i need the insert the file name as a value in a column while loading data. If any of you actually worked on this kind of task please help me.


This is what i need to do



file: FILE_NAME.txt



CODE DATE
1234 01012015
1345 01012015
3456 01012015


after loading the date the table should look like this


CODE DATE FILE_NAME
1234 01012015 file_name.txt
1345 01012015 file_name.txt
3456 01012015 file_name.txt

we need to store this file name because there will be multiple files being placed in that location and
each file has different functionality. Please help me.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to call pl/sql in unix script

sample code as following: test_sql(){ #test#echo test_sql str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM set verify off set heading off set feedback off #--------start pl/sql { DECLARE CURSOR pah_cs IS select id from table where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies

2. Shell Programming and Scripting

how can I call a pl/sql funciton in unix script

who can show me how to call pl/sql function or precudure in unix script.. cheers, (6 Replies)
Discussion started by: YoYo
6 Replies

3. UNIX for Advanced & Expert Users

How to call SQL procedure from UNIX Shellscript ?

Hi All I would be thankful to you all if you will guide me the steps to call a stored proc. from unix shell script. that stored proc. could be parameterised or parameterless developed in SQL. Any info. in this topic would help me..... Thanks in advance.... (1 Reply)
Discussion started by: varungupta
1 Replies

4. UNIX for Advanced & Expert Users

Bus error(coredump) while running SQL*Loader in HP Unix 11

Hi All, I am getting coredump error, when I try to execute Oracle SQL*Loader from Shell script in Unix environment. But SQL*Loader from local machine runs fine with same database. SQL*Loader: Release 9.2.0.6.0 - Production on Mon Apr 23 05:23:47 2007 Copyright (c) 1982, 2002, Oracle... (3 Replies)
Discussion started by: srinivas_paluku
3 Replies

5. Shell Programming and Scripting

Can SQL Server call be made from unix sh

Hi, I need to make SQL Server procedure call (exec <proc name>)from unix shell script. First of all I would like to know if it is possible. I know we can do it from Oracle but not sure about SQL Server. Version: SunOS 5.8 SQL 8.0 I have made the below entry in the interface file. NSXNA267 ... (0 Replies)
Discussion started by: sspreethi
0 Replies

6. Shell Programming and Scripting

how to handle sql loader errors in unix

hi all, how to handle sql loader errors in unix shell ?? thanks in advance gemini (3 Replies)
Discussion started by: gemini106
3 Replies

7. Shell Programming and Scripting

sql loader for inserting the data from multiple fields from unix

Hi , I have my log file something like this (07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011 (07/29/2009 00:02:26.236) 367524 (07/29/2009 00:02:28.207) 949395117 (07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864 I am trying to insert the data... (3 Replies)
Discussion started by: rdhanek
3 Replies

8. Shell Programming and Scripting

Call a pl sql function from unix

hi, I want to know how to call a pl sql function testfunction(param1,..) that returns a value and grab that value in a shell variable. Thnx in advance ---------- Post updated 03-30-10 at 11:58 AM ---------- Previous update was 03-29-10 at 03:49 PM ---------- thnx a lot jim (0 Replies)
Discussion started by: austinhell3_16
0 Replies

9. Shell Programming and Scripting

How to call SQL Loader in shell script?

HI Experts, I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into the table. Also i... (1 Reply)
Discussion started by: sam1234
1 Replies

10. UNIX for Dummies Questions & Answers

Call SQL LOADER FROM UNIX

HI Experts, I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into the table. Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
Data::Phrasebook::Loader::Text(3pm)			User Contributed Perl Documentation		       Data::Phrasebook::Loader::Text(3pm)

NAME
Data::Phrasebook::Loader::Text - Absract your phrases with plain text files. SYNOPSIS
use Data::Phrasebook; my $q = Data::Phrasebook->new( class => 'Fnerk', loader => 'Text', file => 'phrases.txt', ); # use default delimiters (:variable) my $phrase = $q->fetch($keyword,{variable => 'substitute'}); # use Template Toolkit style delimiters $q->delimiters( qr{ [% s* (w+) s* %] }x ); my $phrase = $q->fetch($keyword,{variable => 'substitute'}); DESCRIPTION
This loader plugin implements phrasebook patterns using plain text files. Phrases can be contained within one or more dictionaries, with each phrase accessible via a unique key. Phrases may contain placeholders, please see Data::Phrasebook for an explanation of how to use these. Groups of phrases are kept in a dictionary. In this implementation a single file is one complete dictionary. An example plain text file: foo=Welcome to :my world. It is a nice :place. Within the phrase text placeholders can be used, which are then replaced with the appropriate values once the get() method is called. The default style of placeholders can be altered using the delimiters() method. INHERITANCE
Data::Phrasebook::Loader::Text inherits from the base class Data::Phrasebook::Loader::Base. See that module for other available methods and documentation. METHODS
load Given a "file", load it. "file" must contain a valid phrase map. my $file = 'english.txt'; $loader->load( $file ); This method is used internally by Data::Phrasebook::Generic's "data" method, to initialise the data store. To utilise the dictionary framework for a Plain Text phrasebook, the idea is to use a directory of files, where the directory is passed via the "file" argument and the dictionary, the specific name of the file, is passed via the "dictionary" argument. my $file = '/tmp/phrasebooks'; my $dictionary = 'english.txt'; $loader->load( $file, $dictionary ); get Returns the phrase stored in the phrasebook, for a given keyword. my $value = $loader->get( $key ); dicts Having instantiated the "Data::Phrasebook" object class, and using the "file" attribute as a directory path, the object can return a list of the current dictionaries available as: my $pb = Data::Phrasebook->new( loader => 'Text', file => '/tmp/phrasebooks', ); my @dicts = $pb->dicts; or my @dicts = $pb->dicts( $path ); keywords Having instantiated the "Data::Phrasebook" object class, using the "file" and "dict" attributes as required, the object can return a list of the current keywords available as: my $pb = Data::Phrasebook->new( loader => 'Text', file => '/tmp/phrasebooks', dict => 'TEST', ); my @keywords = $pb->keywords; or my @keywords = $pb->keywords( $path, $dict ); Note that $path can either be the directory path, where $dict must be the specific file name of the dictionary, or the full path of the dictionary file. In the second instance, the function will not load a dictionary, but can be used to interrogate the contents of a known dictionary. SEE ALSO
Data::Phrasebook. SUPPORT
Please see the README file. AUTHOR
Barbie, <barbie@cpan.org> for Miss Barbell Productions <http://www.missbarbell.co.uk>. COPYRIGHT AND LICENSE
Copyright (C) 2004-2010 Barbie for Miss Barbell Productions. This module is free software; you can redistribute it and/or modify it under the Artistic Licence v2. perl v5.10.1 2010-08-31 Data::Phrasebook::Loader::Text(3pm)
All times are GMT -4. The time now is 07:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy