Sponsored Content
Top Forums Shell Programming and Scripting perl, testing a database for a match Post 302420000 by radoulov on Monday 10th of May 2010 09:41:24 AM
Old 05-10-2010
After selecting the data you could build your logic using:

Code:
$sth->rows

You don't need to fetch any data.

P.S. You don't even need real data in the select list:

Code:
select null from table where ...

and then:

Code:
$sth->rows and continue here ... or just stop.

No rows will be evaluated as false in boolean context.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PERL: Read from Database and copy

I have a microsoft access database with anout 220 lines. theres a question and 4 option awnsers and only ones correct which is also listed in th database. Is there any perl script that will copy and the lines from the database and put into a .asp website ? (2 Replies)
Discussion started by: perleo
2 Replies

2. Shell Programming and Scripting

error connecting database from perl

Hi, While i am trying to connect to Oracle database from Perl using DBI module,am getting the error as follows : Can't load '/usr/local/fuseperl-modules/lib/i586-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libwtc9.so: cannot open shared object file: No such file... (4 Replies)
Discussion started by: DILEEP410
4 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. Shell Programming and Scripting

perl hash of hashes from database

hi there, I have some database output that looks like this SELECT nic_name,nic_duplex,nic_speed,nic_ip FROM network_table WHERE hostname = "server1" result is this (ive delimited with a pipe for ease of reading) bge0|full|1000|10.32.100.1 bge1|full|1000|11.12.101.7 ... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

5. Shell Programming and Scripting

parse apl-numeric codes from filenames, and match them to entries in database

Hello, I am new to Unix scripting, and would like some help with my issue: I have vairous files having some alphanumeric codes in them e.g. 10000-01 34440TE 34590SR All these codes are stored in the database, and I need to parse these codes out of these filenames, and match them... (2 Replies)
Discussion started by: mvaidya
2 Replies

6. Shell Programming and Scripting

[Perl] script -database

Welcome. I am writing a perl script. I have to design a database consisting of a single table (any subject) saved in a text file. (I make it vi command name and I am giving permission chmod u + x?) The table should contain at least four columns, including a column containing the ID (serial number )... (4 Replies)
Discussion started by: qwerty007
4 Replies

7. Shell Programming and Scripting

help with perl database printing

Hey guys i am using perl and trying to pull a list of books from a database and then populate the list in a separate TT2 file. When the list is generated there should be 39 book names. When I do the foreach statement in my tt2 below, the first statement gives me 39 Array(random number) and the... (1 Reply)
Discussion started by: Joey12
1 Replies

8. Programming

Help with mySQL database by perl script

Hello; I was trying to set up a mysql database using following script, but never went through. The code seems fine without any syntax error as I tested it: perl -c Brapa0101-db.pl Brapa0101-db.pl syntax OKHowever, whenever I run it, an error message was tossed out: DBD::mysql::st execute... (7 Replies)
Discussion started by: yifangt
7 Replies

9. Shell Programming and Scripting

PERL: testing directory on windows platform

Hi Gurus, kindly analyse the following for me, please OS: Windows 7 Code location: C:\ Output: "Program Files not being recognised" "System Volume Information is a directory" "Windows not being recognised" main { my @dirlist = <*>; foreach my $fn... (0 Replies)
Discussion started by: biglau
0 Replies

10. Shell Programming and Scripting

Perl module error in testing

PERL MODULE : To debug my perl module code in test environment. I have taken production module to the test in the my home path directory and was trying to test it by changing the below path in my test code. But still i am getting the error to debug it. can you please let me knw whether i am... (13 Replies)
Discussion started by: ramkumar15
13 Replies
Bio::Chado::Schema::Test(3pm)				User Contributed Perl Documentation			     Bio::Chado::Schema::Test(3pm)

NAME
Bio::Chado::Schema::Test - Library to be used by Bio::Chado::Schema test scripts. SYNOPSIS
use lib qw(t/lib); use Bio::Chado::Schema::Test; use Test::More; my $schema = Bio::Chado::Schema::Test->init_schema(); DESCRIPTION
This module provides the basic utilities to write tests against Bio::Chado::Schema. METHODS
init_schema my $schema = Bio::Chado::Schema::Test->init_schema( deploy => 1, populate => 1, storage_type => '::DBI::Replicated', storage_type_args => { balancer_type=>'DBIx::Class::Storage::DBI::Replicated::Balancer::Random' }, ); This method removes the test SQLite database in t/var/BCS.db and then creates a new, empty database. This method will call deploy_schema() by default, unless the deploy flag is set to 0. This method will call populate_schema() if the populate argument is set to a true value. has_custom_dsn Returns true if the BCS_TEST_DSN environment variable is set. deploy_schema Bio::Chado::Schema::Test->deploy_schema( $schema ); This method does one of two things to the schema. It can either call the experimental $schema->deploy() if the BCSTEST_SQLT_DEPLOY environment variable is set, otherwise the default is to read in the t/lib/sqlite.sql file and execute the SQL within. Either way you end up with a fresh set of tables for testing. populate_schema Bio::Chado::Schema::Test->populate_schema( $schema ); After you deploy your schema you can use this method to populate the tables with test data. perl v5.14.2 2011-11-08 Bio::Chado::Schema::Test(3pm)
All times are GMT -4. The time now is 06:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy