04-08-2008
Hello again...
So let me get this straight... You have to do something like....
$sth -> bind_param_in(1,\$messages_id_pkseq.nextval, 12);
$sth -> bind_param_in(2,\$message_text, 256);
$sth -> bind_param_in(3, ..... );
and like that for each of the parameters, then
$sth -> execute(); without parms?
Interesting..... Thanks...
As for perl for Oracle DB work via the DBI (which is I think what you are speaking of here), I have to admit that except for low-volume inserts/updates like summary records, or updating some status-of-a-job record and things like that, I don't use it much either. Something like what you are doing I would only do if the transaction rate is relatively low. Otherwise, you might consider input via sql+ and get the return value by assigning the result of a qx|| call to an array....
So you have a simple sql+ script that takes the VALUES in as parms and in perl you do something like....
(@IO) = qx|sqlplus -s login\/passwd\@DB scripttoexecute parm1 parm2... |;
The in/out parm should end up as $IO[0], etc.
The -s parm SILENCES sql+ so the normal stuff dumped to stdout doesn't end up in @IO, only what you want...
My syntax might be a little off... I'm writing this off-the-cuff as it were, and I'm a little rusty lately...
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I am trying to install perl-DBD-Oracle-1.16-1.2.rpm on Suse (SLE 9), like
rpm -Uvh perl-DBD-Oracle-1.16-1.2.rpm but I keep getting the following error message
error: Failed dependencies:
libclntsh.so.10.1 is needed by perl-DBD-Oracle-1.16-1.2.el4
libnnz10.so is needed by... (1 Reply)
Discussion started by: hassan1
1 Replies
2. UNIX for Dummies Questions & Answers
Hi friends,
I am new to Perl programming. I have a requirement, using perl I need to connect to Oracle DB and get some records ( on unix environment). I googled and found that we need to use DBD (Database Drivers), DBI (DataBase Interface) to connect to oracle. I tried using " sqlplus... (1 Reply)
Discussion started by: satguyz
1 Replies
3. Programming
hi i am trying to connect to an oracle database using dbi and i get this ::
Driver has not implemented the disconnect_all method. at /opt/perl/lib/site_perl/5.8.0/sun4-solaris/DBI.pm line 575
END failed--call queue aborted.
for all i know, the script was working earlier, but has... (1 Reply)
Discussion started by: poggendroff
1 Replies
4. Shell Programming and Scripting
Hi Friends,
I am having Perl 5 and Oracle 9i. I just wanna to connect Oracle DB & to perform some select query statement.
Could anyone pls let me know.
I've tried below command which i found in some website, But it throws some error.:confused:
Executed:
perl -e 'use DBI; print... (1 Reply)
Discussion started by: Vijayakumarpc
1 Replies
5. Shell Programming and Scripting
Hello All,
I need to now how can I establish connection with oracle database then shutdown abort and then startup, In other words need to implement the following lines to perl script:
export ORACLE_SID=<some user>
${ORACLE_HOME}/bin/sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown... (2 Replies)
Discussion started by: Alalush
2 Replies
6. Shell Programming and Scripting
I want to use Perl to connect to a remote Oracle DB
I have no oracle installation on my server (and dont plan on installing one) I am using solaris 9 on x86 server.
Is this possible?
I basically want to run some basic sql queries on the remote oracle db which I have access to using perl on my... (0 Replies)
Discussion started by: frustrated1
0 Replies
7. Shell Programming and Scripting
Hi,
#!/usr/bin/perl
my @sid=`cat /etc/oratab|grep -v "^#"|grep -v "*"|grep -v "#"|cut -d: -f1 -s`;
my $log;
my $body="";
my $oraclesid="";
chomp($hostname);
foreach my $oraclesid (@SID){
$body="";
chomp($oraclesid);
$dbname=print ($oraclesid);
print... (2 Replies)
Discussion started by: rocky1954
2 Replies
8. Shell Programming and Scripting
Hi,
we have PERL 64-bit build with Oracle 10g DBD . PERL database connection are working fine. Database upgraded to 11.2 and in PERL documents it says still use 10g DBD to connect to 11.2. when I try some test connections, I am getting this error . Did anyone see this error before .
I set the... (2 Replies)
Discussion started by: talashil
2 Replies
9. Shell Programming and Scripting
Hi,
I am new to perl.How to query oracle database with perl???
Thanks (1 Reply)
Discussion started by: tdev457
1 Replies
10. Shell Programming and Scripting
I've a Centralized Server which can connect to all Oracle Databases.
When I was trying the below code it doesn't work, But tnsping was working fine.
#!D:/perl5/bin/perl.exe
use DBI;
my $dbh = DBI->connect('dbi:Oracle:QBDIWCE', 'IDUSER', 'SECRET123#' ) || die( $DBI::errstr . "\n" ) ;
... (1 Reply)
Discussion started by: ilugopal
1 Replies
LEARN ABOUT PHP
pdostatement.debugdumpparams
PDOSTATEMENT.DEBUGDUMPPARAMS(3) 1 PDOSTATEMENT.DEBUGDUMPPARAMS(3)
PDOStatement::debugDumpParams - Dump an SQL prepared command
SYNOPSIS
public void PDOStatement::debugDumpParams (void )
DESCRIPTION
Dumps the information contained by a prepared statement directly on the output. It will provide the SQL query in use, the number of param-
eters used ( Params), the list of parameters with their key name or position, their name, their position in the query (if this is supported
by the PDO driver, otherwise, it will be -1), type ( param_type) as an integer, and a boolean value is_param.
This is a debug function, which dumps the data directly to the normal output.
Tip
As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of
this function, and save it in a string (for example).
This will only dump the parameters in the statement at the moment of the dump. Extra parameters are not stored in the statement, and not
displayed.
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
PDOStatement.debugDumpParams(3) example with named parameters
<?php
/* Execute a prepared statement by binding PHP variables */
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
$sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);
$sth->execute();
$sth->debugDumpParams();
?>
The above example will output:
SQL: [96] SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour
Params: 2
Key: Name: [9] :calories
paramno=-1
name=[9] ":calories"
is_param=1
param_type=1
Key: Name: [7] :colour
paramno=-1
name=[7] ":colour"
is_param=1
param_type=2
Example #2
PDOStatement.debugDumpParams(3) example with unnamed parameters
<?php
/* Execute a prepared statement by binding PHP variables */
$calories = 150;
$colour = 'red';
$name = 'apple';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < ? AND colour = ?');
$sth->bindParam(1, $calories, PDO::PARAM_INT);
$sth->bindValue(2, $colour, PDO::PARAM_STR);
$sth->execute();
$sth->debugDumpParams();
?>
The above example will output:
SQL: [82] SELECT name, colour, calories
FROM fruit
WHERE calories < ? AND colour = ?
Params: 2
Key: Position #0:
paramno=0
name=[0] ""
is_param=1
param_type=1
Key: Position #1:
paramno=1
name=[0] ""
is_param=1
param_type=2
SEE ALSO
PDO.prepare(3), PDOStatement.bindParam(3), PDOStatement.bindValue(3).
PHP Documentation Group PDOSTATEMENT.DEBUGDUMPPARAMS(3)