07-26-2010
sorry agn,
still throwing below error
BD::Oracle::db prepare failed: ORA-00903: invalid table name (DBD ERROR: OCIStmtExecute/Describe)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I know htis isnt exactly unix.... but hopefully someone can help me or direct me someplace to get help.
I can run sql queries in scripts against my informix db using:
dbaccess mydb myquery.sql >> sql.output
I need to write my script to select based on todays date. Its very... (5 Replies)
Discussion started by: MizzGail
5 Replies
2. UNIX for Advanced & Expert Users
Hi Folks,
This is a small chunk of the bigger problem which i am facing and some help here will help me resolve the rest of the issue.
Problem is that i need to pass the value of a variable from a shell script to a SQL query (infact a lot of SQL's)
i have the following solution but somehow... (4 Replies)
Discussion started by: kamitsin
4 Replies
3. Shell Programming and Scripting
I created a script to read a csv file with four columns. The script also saved values of each col in a arry.
In the script, i connected to db try to run a query to pull out data baisc on the values from the csv file.
select Num from tableName
where Sec_Num in ('${isin}') /*isin is an arry... (1 Reply)
Discussion started by: Sherry_Run
1 Replies
4. Shell Programming and Scripting
Unix prompt
=========
echo "Enter the query"
read q
==========
User has entered :
SELECT * FROM employee
=====================
Now the problem starts..
echo $q
Output: SELECT "all files names in the PWD" FROM employee
================================================
... (5 Replies)
Discussion started by: Niroj
5 Replies
5. Shell Programming and Scripting
I have a script (say script1.sh ) and I am calling a script (say script2.sh) within the script1.sh. Here in script1.sh I have a hash ( say %hash1) and i have to pass this hash to script2.sh. Basically i have to do some processing in Scirpt2.sh based on the hash(key,values). I wanted to know how can... (2 Replies)
Discussion started by: ammu
2 Replies
6. Shell Programming and Scripting
I heard this was possible but from my research I haven't been able to figure it out yet. Seems it should be simple enough. Basically from a high level view I'm trying to accomplish...
. $X='grep foo blah.log'
then 'mysql command SELECT foo FROM bar WHERE ' . $X
or something like that.
... (2 Replies)
Discussion started by: kero
2 Replies
7. Shell Programming and Scripting
hi there
I have the following script in which i have created a PrintHash() function.
I want to pass to this function the reference to a hash (in the final code i will be passing different hashes to this print function hence the need for a function). I am getting an error
Type of arg 1 to... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
8. Shell Programming and Scripting
How to pass variable to sql file.
Im tryin in two ways,
Method 1:
my.sql
select * from table where col1 = '$1' and col2 = 'text';
Method 1execute: dbaccess database my.sql $var
Method2:
select * from table col1 in (`cat inputfile`) and col2 = 'text';
method... (2 Replies)
Discussion started by: Roozo
2 Replies
9. Shell Programming and Scripting
I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be used in the query. I want to read this file line by line and then run the query for each value in that... (7 Replies)
Discussion started by: gpk_newbie
7 Replies
10. Shell Programming and Scripting
Hi,
I have created a shell script that reads line from text file and insert into DB table. I have used IFS to separate the line text. Looks IFS is splitting text properly but while passing one of the values that has special characters in it to query, it is giving weird issue. Below is my... (2 Replies)
Discussion started by: yuvi
2 Replies
LEARN ABOUT DEBIAN
anyevent::dbd::pg
AnyEvent::DBD::Pg(3pm) User Contributed Perl Documentation AnyEvent::DBD::Pg(3pm)
NAME
AnyEvent::DBD::Pg - AnyEvent interface to DBD::Pg's async interface
SYNOPSIS
use AnyEvent::DBD::Pg;
my $adb = AnyEvent::DBD::Pg->new('dbi:Pg:dbname=test', user => 'pass', {
pg_enable_utf8 => 1,
pg_server_prepare => 0,
quote_char => '"',
name_sep => ".",
}, debug => 1);
$adb->queue_size( 4 );
$adb->debug( 1 );
$adb->connect;
$adb->selectcol_arrayref("select pg_sleep( 0.1 ), 1", { Columns => [ 1 ] }, sub {
my $rc = shift or return warn;
my $res = shift;
warn "Got <$adb->{qd}> = $rc / @{$res}";
$adb->selectrow_hashref("select data,* from tx limit 2", {}, sub {
my $rc = shift or return warn;
warn "Got $adb->{qd} = $rc [@_]";
});
});
$adb->execute("update tx set data = data;",sub {
my $rc = shift or return warn;
warn "Got exec: $rc";
#my $st = shift;
#$st->finish;
});
$adb->execute("select from 1",sub {
shift or return warn;
warn "Got $adb->{qd} = @_";
});
$adb->selectrow_array("select pg_sleep( 0.1 ), 2", {}, sub {
shift or return warn;
warn "Got $adb->{qd} = [@_]";
$adb->selectrow_hashref("select * from tx limit 1", {}, sub {
warn "Got $adb->{qd} = [@_]";
$adb->execute("select * from tx", sub {
my $rc = shift or return warn;
my $st = shift;
while(my $row = $st->fetchrow_hashref) { warn "$row->{id}"; }
$st->finish;
exit;
});
});
});
AE::cv->recv;
METHODS
connect()
Establish connection to database
selectrow_array( $query, [\%args], $cb->( $rc, ... ))
Execute PG_ASYNC prepare, than push result of "fetchrow_array" into callback
selectrow_arrayref( $query, [\%args], $cb->( $rc, @row ))
Execute PG_ASYNC prepare, than push result of "fetchrow_arrayref" into callback
selectrow_hashref( $query, [\%args], $cb->( $rc, \%row ))
Execute PG_ASYNC prepare, than push result of "fetchrow_hashref" into callback
selectall_arrayref( $query, [\%args], $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_arrayref" into callback
selectall_hashref( $query, [\%args], $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_hashref" into callback
selectcol_arrayref( $query, { Columns => [...], ... }, $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_hashref($args{Columns})" into callback
execute( $query, [\%args], $cb->( $rc, $sth ))
Execute PG_ASYNC prepare, than invoke callback, pushing resulting sth to it.
Please, note: result already passed as first argument
AUTHOR
Mons Anderson, "<mons@cpan.org>"
LICENSE AND COPYRIGHT
Copyright 2010 Mons Anderson.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as
published by the Free Software Foundation; or the Artistic License.
perl v5.10.1 2010-11-30 AnyEvent::DBD::Pg(3pm)