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
after loading the date the table should look like this
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.
Last edited by Corona688; 09-16-2015 at 06:13 PM..
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
sql::translator::schema::object
SQL::Translator::Schema::Object(3pm) User Contributed Perl Documentation SQL::Translator::Schema::Object(3pm)NAME
SQL::Translator::Schema::Object - Base class SQL::Translator Schema objects.
SYNOPSIS DESCSIPTION
Base class for Schema objects. Sub classes Class::Base and adds the following extra functionality.
Construction
Derived classes should declare their attributes using the "_attributes" method. They can then inherit the "init" method from here which
will call accessors of the same name for any values given in the hash passed to "new". Note that you will have to impliment the accessors
your self and we expect perl style methods; call with no args to get and with arg to set.
e.g. If we setup our class as follows;
package SQL::Translator::Schema::Table;
use base qw/SQL::Translator::Schema::Object/;
__PACKAGE__->_attributes( qw/schema name/ );
sub name { ... }
sub schema { ... }
Then we can construct it with
my $table = SQL::Translator::Schema::Table->new(
schema => $schema,
name => 'foo',
);
and init will call "$table->name("foo")" and "$table->schema($schema)" to set it up. Any undefined args will be ignored.
Multiple calls to "_attributes" are cumulative and sub classes will inherit their parents attribute names.
This is currently experimental, but will hopefull go on to form an introspection API for the Schema objects.
Global Attributes
The following attributes are defined here, therefore all schema objects will have them.
extra
Get or set the objects "extra" attibutes (e.g., "ZEROFILL" for MySQL fields). Call with no args to get all the extra data. Call with a
single name arg to get the value of the named extra attribute, returned as a scalar. Call with a hash or hashref to set extra attributes.
Returns a hash or a hashref.
$field->extra( qualifier => 'ZEROFILL' );
$qualifier = $field->extra('qualifier');
%extra = $field->extra;
$extra = $field->extra;
remove_extra
"extra" can only be used to get or set "extra" attributes but not to remove some. Call with no args to remove all extra attributes that
have been set before. Call with a list of key names to remove certain extra attributes only.
# remove all extra attributes
$field->remove_extra();
# remove timezone and locale attributes only
$field->remove_extra(qw/timezone locale/);
equals
Determines if this object is the same as another.
my $isIdentical = $object1->equals( $object2 );
SEE ALSO TODO BUGS AUTHOR
Ken Youens-Clark <kclark@cpan.org>, Mark Addison <mark.addison@itn.co.uk>.
perl v5.14.2 2012-01-20 SQL::Translator::Schema::Object(3pm)