Sponsored Content
Full Discussion: Database access
Top Forums Shell Programming and Scripting Database access Post 302246764 by Ikon on Tuesday 14th of October 2008 10:47:09 AM
Old 10-14-2008
Code:
$rowsreturned = $sth->rows;

This will tell you how many or if any rows were returned.

Is that what your looking for?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

microsoft access database on Unix

Hello, I am a newborn baby to Unix and I was told that it was possible to have Microsoft Access databases on a Unix web server. I am using Perl to interface and query the Access database, which puts the information into the appropriate fields of a web page. Then updated information is submitted... (1 Reply)
Discussion started by: spiderling
1 Replies

2. Programming

C program with Oracle database access

Hey, I want to access oracle database through Unix C programming.. Can you through me some light on that... (5 Replies)
Discussion started by: kavi
5 Replies

3. Shell Programming and Scripting

Perl Database access

Hi, I tried to run this code but it isnt giving me any output or errors. My aim is to retrieve the row based on the flag name(this is the primary key). flag_test is my table This is how i ran it: perl read_db.pl flag1 flag1 is the criteria in where clause -------- this is my... (2 Replies)
Discussion started by: mercuryshipzz
2 Replies

4. UNIX for Advanced & Expert Users

Help with ms access database and firebird

Hi! I need to access two diferent databases allocated in a linux server through PHP. I know in the php.ini file I can't configure some parameters as odbc.default_db... but I can't configure it. I've already installed unixodbc drivers Can Anybody point me to a tutorial web o teach me how... (0 Replies)
Discussion started by: ncatdesigner
0 Replies

5. Shell Programming and Scripting

Access to database/eval command

Hi i have the following code: if(($line!=1) and (@field!='\$')){ print ( "\nTRY TO CONNECT TO DATABASE................\n"); my $dbh = DBI->connect($dsn, $user, $pass); print ("CONNECTED TO DATABASE\n"); eval ... (1 Reply)
Discussion started by: chriss_58
1 Replies

6. Shell Programming and Scripting

problem trying to access a database

hi guys, I am using the following code in order to access a database. #!/usr/bin/perl print "READ DATA FROM DATABASE\n"; use DBI; use strict; #use DBD::Oracle; my $user='reassure'; my $pass='R3Assur3'; #my $dsn="dbi:Oracle:orcl"; my $dsn='dbi:Oracle:cobscs.world'; my $dbh =... (1 Reply)
Discussion started by: chriss_58
1 Replies

7. IP Networking

Access database over internet, help

Hi! :D I'm new here, and I will appreciate all the help you can give. This is the problem we are trying to solve at my office. At office 1 we have SCO UNIX 5.0.can't remember last number. On it runs database software on which we input/read/modify data throughout terminal software, on remote... (1 Reply)
Discussion started by: PNemesis
1 Replies

8. Shell Programming and Scripting

using unix scripts database access

i want to access database (sql script) within a unix script. help me (2 Replies)
Discussion started by: chamaraa
2 Replies

9. UNIX for Dummies Questions & Answers

Access to a database

Hello all, is it possible to write a script in order to connect to a database, load data in a specific domain and execute the corresponding command? (3 Replies)
Discussion started by: FelipeAd
3 Replies

10. AIX

No Suitable Driver for MS Access database

Hi, I am running a JDBC:ODBC code to access .mdb file in my windows system successfully but, not able to access MS Access mdb file in AIX Unix box. when I am trying to run the same piece of code in AIX Unix box it is saying "No Suitable Driver". I need some immediate help. (0 Replies)
Discussion started by: thirunp
0 Replies
DBI::Format(3)						User Contributed Perl Documentation					    DBI::Format(3)

NAME
DBI::Format - A package for displaying result tables SYNOPSIS
# create a new result object $r = DBI::Format->new('var1' => 'val1', ...); # Prepare it for output by creating a header $r->header($sth, $fh); # In a loop, display rows while ($ref = $sth->fetchrow_arrayref()) { $r->row($ref); } # Finally create a trailer $r->trailer(); DESCRIPTION
THIS PACKAGE IS STILL VERY EXPERIMENTAL. THINGS WILL CHANGE. This package is used for making the output of DBI::Shell configurable. The idea is to derive a subclass for any kind of output table you might create. Examples are o a very simple output format as offered by DBI::neat_list(). "AVAILABLE SUBCLASSES". o a box format, as offered by the Data::ShowTable module. o HTML format, as used in CGI binaries o postscript, to be piped into lpr or something similar In the future the package should also support interactive methods, for example tab completion. These are the available methods: new(@attr) new(\%attr) (Class method) This is the constructor. You'd rather call a subclass constructor. The construcor is accepting either a list of key/value pairs or a hash ref. header($sth, $fh) (Instance method) This is called when a new result table should be created to display the results of the statement handle $sth. The (optional) argument $fh is an IO handle (or any object supporting a print method), usually you use an IO::Wrap object for STDIN. The method will query the $sth for its NAME, NUM_OF_FIELDS, TYPE, SCALE and PRECISION attributes and typically print a header. In general you should not assume that $sth is indeed a DBI statement handle and better treat it as a hash ref with the above attributes. row($ref) (Instance method) Prints the contents of the array ref $ref. Usually you obtain this array ref by calling $sth->fetchrow_arrayref(). trailer (Instance method) Once you have passed all result rows to the result package, you should call the trailer method. This method can, for example print the number of result rows. AVAILABLE SUBCLASSES
First of all, you can use the DBI::Format package itself: It's not an abstract base class, but a very simple default using DBI::neat_list(). Ascii boxes This subclass is using the Box mode of the Data::ShowTable module internally. Data::ShowTable(3). Raw Row is written without formating. Columns returned in comma or user defined separated list. String Row is written using a string format. Future releases will include th ability set the string format. AUTHOR AND COPYRIGHT
This module is Copyright (c) 1997, 1998 Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Email: joe@ispsoft.de Phone: +49 7123 14887 The DBD::Proxy module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
DBI::Shell(3), DBI(3), dbish(1) perl v5.8.0 2002-11-29 DBI::Format(3)
All times are GMT -4. The time now is 05:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy