Sponsored Content
Top Forums Programming Help with mySQL database by perl script Post 302560705 by durden_tyler on Friday 30th of September 2011 03:30:19 PM
Old 09-30-2011
No it is not a dumb question.
You could just plug in those statements once you connect to your data source and get a handle for that connection:

Code:
$dbh->do("CREATE DATABASE Brapa0101_db");
$dbh->do("CREATE TABLE table01 (
            run        INT NOT NULL AUTO_INCREMENT  PRIMARY KEY,
            geneid     VARCHAR(20),
            seqtype    VARCHAR(50),
            scaffold   VARCHAR(50),  
            seqstart   INT(11),
            seqend     INT(11),
            seqstrand  VARCHAR(1),
            seqlength  INT(11),
            cdsseq     TEXT)"
        );

tyler_durden

This User Gave Thanks to durden_tyler For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connecting MySql throug Perl Script ?

Dear Friends, I am tryin to connect to the myql through perl scrip. I have already installed mysql and DBI modules to my Perl. There versions are as follows, DBD-mysql MySQL driver for the Perl5 Database DBI Database independent interface for It gives... (4 Replies)
Discussion started by: maheshsri
4 Replies

2. Shell Programming and Scripting

shell script to insert data from gps.txt to mysql database

Hi, I have gps receiver, by using gpsd data i can read gps log data to my database(my sql). Steps: 1. telenet localhost 2947 > gps.txt (press enter) 2. r (press enter) //then i will get the data like below in gps.txt file Trying 127.0.0.1... Connected to localhost.... (1 Reply)
Discussion started by: gudivada213
1 Replies

3. Shell Programming and Scripting

Automating A Perl Script over a database

Dear Scripting Gods I've never done shell scripting before and have only recently got to grips with Perl, so apologies for my naivity. I've written a perl program which takes in two files as arguments (these are text documents which take in the information I need) The perl program spits out a... (1 Reply)
Discussion started by: fraizerangus
1 Replies

4. Shell Programming and Scripting

Create mysql database with bash script - confused

Hi, i have the following: db="create database xxx;GRANT ALL PRIVILEGES ON xxx.* TO user@localhost IDENTIFIED BY 'password';FLUSH PRIVILEGES;quit;" mysql -u root -p$mysql_pass -e "$db" I don't understand why this is failing, it works fine when run from cmd but when is run in a bash script,... (1 Reply)
Discussion started by: ktm
1 Replies

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

6. Shell Programming and Scripting

Help with perl mysql backup script

Hi, im trying to make a script that backups mysql databases but apparently I am having trouble with the variables, or simply something I am missing. Would appreciate any help, here is the script #!/usr/bin/perl -w use strict; require File::Spec; #VARIABLES my $databasename =... (4 Replies)
Discussion started by: Fireline
4 Replies

7. Shell Programming and Scripting

Perl script database date convertion

Need assistance Below script get the output correctly I want to convert the date format .Below is the output . Any idea ? #!/usr/bin/perl -w use DBI; # Get a database handle by connecting to the database my $db = DBI->connect(... (3 Replies)
Discussion started by: ajayram_arya
3 Replies

8. Shell Programming and Scripting

Need help on Insert data to phpMyAdmin mySQL database from Shell Script

Sorry to disturb you, I would like to seek help on inserting data whenever the switch is on or off to my phpMyAdmin mySQL database from my Shell Script. I'm using Raspberry PI as my hardware and I have follow this LINK: instructables.com/id/Web-Control-of-Raspberry-Pi-GPIO/?ALLSTEPS to create my... (4 Replies)
Discussion started by: aoiregion
4 Replies
Class::DBI::Test::SQLite(3pm)				User Contributed Perl Documentation			     Class::DBI::Test::SQLite(3pm)

NAME
Class::DBI::Test::SQLite - Base class for Class::DBI tests SYNOPSIS
use base 'Class::DBI::Test::SQLite'; __PACKAGE__->set_table('test'); __PACKAGE__->columns(All => qw/id name film salary/); sub create_sql { return q{ id INTEGER PRIMARY KEY, name CHAR(40), film VARCHAR(255), salary INT } } DESCRIPTION
This provides a simple base class for Class::DBI tests using SQLite. Each class for the test should inherit from this, provide a create_sql() method which returns a string representing the SQL used to create the table for the class, and then call set_table() to create the table, and tie it to the class. METHODS
set_table __PACKAGE__->set_table('test'); This combines creating the table with the normal Class::DBI table() call. create_sql (abstract) sub create_sql { return q{ id INTEGER PRIMARY KEY, name CHAR(40), film VARCHAR(255), salary INT } } This should return, as a text string, the schema for the table represented by this class. perl v5.12.4 2005-05-24 Class::DBI::Test::SQLite(3pm)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy