Sponsored Content
Full Discussion: DBI - Change database
Top Forums Shell Programming and Scripting DBI - Change database Post 302210955 by cbkihong on Wednesday 2nd of July 2008 09:55:48 AM
Old 07-02-2008
My impression is that you need to disconnect and reconnect. But why are you doing this? Unless you really have a lot of databases, opening all of the connections you need at the beginning and just close them all at the end should do it ....
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PERL DBI module install

We ran into an issue trying to install DBI and DB2 modules for perl for AIX from the link http://www-306.ibm.com/software/data/db2/perl/ We tried to install the DBI module using bash# perl -MCPAN -e 'install DBI' command. However we ended up with the following error. Stop. ... (3 Replies)
Discussion started by: jerardfjay
3 Replies

2. Shell Programming and Scripting

change the contraints type of fields in database

how to disable the contraint type of a field (which is present in diffrent tables ) in database using a single unix script file. (4 Replies)
Discussion started by: shaksing
4 Replies

3. Programming

perl dbi to oracle getting disconnect_all for oracle dbi help

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. Programming

Problems using Perl DBI to edit database entries - basic stuff

Hello. I am taking a Perl class in college and we've briefly covered SQL and moved on. We have a term project and we can do whatever we want. My project will rely strongly on an SQL Database so I am trying to learn as much about Perl DBI as I can to get things up and going. I am basically... (1 Reply)
Discussion started by: Dave247
1 Replies

5. Shell Programming and Scripting

connect to MySQL from Perl using DBI

Hi, I want to connect perl with the mysql to select and so on but the connection don't work code #!/usr/bin/perl BEGIN { # PERL MODULES WE WILL BE USING use DBI; $dbh = DBI->connect('DBI:mysql:C:\Program Files\MySQL\MySQL Server 5.0\data\db1','','pass') or die $DBI::errstr;} #... (1 Reply)
Discussion started by: eng_shimaa
1 Replies

6. UNIX for Advanced & Expert Users

Perl's DBI Module on OS X - uninstallable?

i've been struggling with installing the Perl DBI & DBD modules all weekend, and I'm getting close, but no cigar as of yet. When I run the perl script db.pl I get the following mismatch error: Mon Apr 19 09:43:29 EDT 2010 /Library/Perl/DBD-mysql-4.011 -> peterv@MBP17.local<515>$: db.pl | tee... (0 Replies)
Discussion started by: peterv6
0 Replies

7. Shell Programming and Scripting

perl: help with DBI

Hi there, I have a bit of code similar to below (which ive actually got from perldoc, but mine is similar enough) $sth = $dbh->prepare(q{ SELECT region, sales FROM sales_by_region }); $sth->execute; my ($region, $sales); # Bind Perl variables to columns: $rv =... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

8. Shell Programming and Scripting

Perl DBI error

Hi All, I installed DBI module in a non INC location and using it in my script via "use lib". But it throw the below error at the "use DBI" step. Please help Usage: DBI::_install_method(dbi_class, meth_name, file, attribs=Nullsv) at /xx/xxx/xxxxx/xxxxx/oracle/lib/DBI.pm/oracle/lib/DBI.pm line... (2 Replies)
Discussion started by: prasperl
2 Replies

9. Red Hat

Can't locate DBI.pm in @INC

my os details as follow bash-3.2$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.8 (Tikanga) I run the following and encounter the following error bash-3.2$ mysqlhotcopy -? Can't locate DBI.pm in @INC (@INC contains:... (5 Replies)
Discussion started by: jediwannabe
5 Replies
DBI::Shell(3)						User Contributed Perl Documentation					     DBI::Shell(3)

NAME
DBI::Shell - Interactive command shell for the DBI SYNOPSIS
perl -MDBI::Shell -e shell [<DBI data source> [<user> [<password>]]] or dbish [<DBI data source> [<user> [<password>]]] DESCRIPTION
The DBI::Shell module (and dbish command, if installed) provide a simple but effective command line interface for the Perl DBI module. DBI::Shell is very new, very experimental and very subject to change. Your milage will vary. Interfaces will change with each release. TO DO
Proper docs - but not yet, too much is changing. "/source file" command to read command file. Allow to nest via stack of command file handles. Add command log facility to create batch files. Commands: load (query?) from file save (query?) to file Use Data::ShowTable if available. Define DBI::Shell plug-in semantics. Implement import/export as plug-in module Clarify meaning of batch mode Completion hooks Set/Get DBI handle attributes Portability Emulate popular command shell modes (Oracle, Ingres etc)? COMMANDS
Many commands - few documented, yet! help /help chistory /chistory (display history of all commands entered) /chistory | YourPager (display history with paging) clear /clear (Clears the current command buffer) commit /commit (commit changes to the database) connect /connect (pick from available drivers and sources) /connect dbi:Oracle (pick source from based on driver) /connect dbi:YourDriver:YourSource i.e. dbi:Oracle:mysid Use this option to change userid or password. current /current (Display current statement in the buffer) do /do (execute the current (non-select) statement) dbish> create table foo ( mykey integer ) dbish> /do dbish> truncate table OldTable /do (Oracle truncate) drivers /drivers (Display available DBI drivers) edit /edit (Edit current statement in an external editor) Editor is defined using the enviroment variable $VISUAL or $EDITOR or default is vi. Use /option editor=new editor to change in the current session. To read a file from the operating system invoke the editor (/edit) and read the file into the editor buffer. exit /exit (Exits the shell) get /get (Retrieve a previous command to the current buffer) go /go (Execute the current statement) Run (execute) the statement in the current buffer. This is the default action if the statement ends with / dbish> select * from user_views/ dbish> select table_name from user_tables dbish> where table_name like 'DSP%' dbish> / dbish> select table_name from all_tables/ | more history /history (Display combined command and result history) /history | more option /option [option1[=value]] [option2 ...] /option (Displays the current options) /option MyOption (Displays the value, if exists, of MyOption) /option MyOption=4 (defines and/or sets value for MyOption) perl /perl (Evaluate the current statement as perl code) quit /quit (Leaves shell. Same as exit) redo /redo (Re-execute the previously executed statement) rhistory /rhistory (Display result history) rollback /rollback (rollback changes to the database) For this to be useful, turn the autocommit off. /option autocommit=0 table_info /table_info (display all tables that exist in current database) /table_info | more (for paging) trace /trace (set DBI trace level for current database) Adjust the trace level for DBI 0 - 4. 0 off. 4 is lots of information. Useful for determining what is really happening in DBI. See DBI. type_info /type_info (display data types supported by current server) AUTHORS and ACKNOWLEDGEMENTS The DBI::Shell has a long lineage. It started life around 1994-1997 as the pmsql script written by Andreas Konig. Jochen Wiedmann picked it up and ran with it (adding much along the way) as dbimon, bundled with his DBD::mSQL driver modules. In 1998, around the time I wanted to bundle a shell with the DBI, Adam Marks was working on a dbish modeled after the Sybase sqsh utility. Wanting to start from a cleaner slate than the feature-full but complex dbimon, I worked with Adam to create a fairly open modular and very configurable DBI::Shell module. Along the way Tom Lowery chipped in ideas and patches. As we go further along more useful code and concepts from Jochen's dbimon is bound to find it's way back in. COPYRIGHT
The DBI::Shell module is Copyright (c) 1998 Tim Bunce. England. All rights reserved. Portions are Copyright by Jochen Wiedmann, Adam Marks and Tom Lowery. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.8.0 2002-11-29 DBI::Shell(3)
All times are GMT -4. The time now is 11:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy