Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded DB

Status
Not open for further replies.

Strannik

Programmer
Jul 4, 2002
132
UA
I need the following: some simple database(not client-server) which would be embedded for Perl. So I don't need to install database software on client's machine.

Has anybody solution for this ?
Thanks in advance.
 
MySQL, DB_File, and a plethora of others,

You can access the Database using perl's DBI interface once it's been configured for your particular database choice.

Usually you wouldn't install Client DB front ends for access to a DB from Perl, let the perl scripts access the database through cgi, and present the details in a web interface

HTH
--Paul

It's a non-trivial task to set up, but well worth the effort

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
to Paul:

Thanks.
So you say that I don't need to install MySQL on customer's PC. Just copy MySQL data files to its machine and use DBI package to access it. Am i correct ?
 
In a word NO.

The data is at a central repository, and is accessed over the/a network, and everyone is happy.

Client Vs Server side databases ... concurrency ... heartbreak ... r u mad??

No, I meant that once the DB is set up, and can be accessed from the webserver, everyone is looking at the one set of information. (which is usually what is required to make progress)

UNLESS: you're the same Strannik, who pipped me for a job at GE, in which case, Yeah, Go ahead, shure, that'll work.
Or you're that guy Strannik, who works over at NCR, nice chick BTW

--Just Kidding hehh, hennneh hnnnhhh
--
----Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
To Paul:

That's not a deal. Just imagine. I have perl script which must work with database. Script is a part of software application. If I release my software I must require that any user will download and install MySQL DB.That won't do :(
 
If you create a web application using MySQL database, all the client needs is a browser to connect to the server. and the server will handle all data relevant transactions with the database.

If you release your software, and MySQL is a dependency, then so be it. MySQL is free for non-profit making organisations, and they can pay for support for it. Profit making organisations can afford it.

If you're worried about MySQL, look up DB_File which comes with Perl, though it's not as full featured as MySQL

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
to Paul:

OK. Then MySQL doesn't match my needs. The only functionality I'd like to see - database with flat files which supports data indexing to improve searching.
 
look up DB_File, but it's gonna mean installing perl on each client application

check out autobundle functionality on cpan, as thsi should allow to dictate what bundles you want dropped into the perl distribution.

AFAIK, DB_File comes with perl as standard, haven't used it extensively, or explicitly.

Did use it once through a internet search engine script call perlfect from and it did all that was asked of it

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Question: you've created this perl script to interact with a database. What database did you use when you created the script?

There's always a better way. The fun is trying to find it!
 
to Paul:

You know ... I've read about DB_File. This can suit me because it's simple and built-in.
In Windows package it's called SDBM_File.

I used standard sample from cpan.org but it failed :( I wanted to create new db file and populate it with sample pair of values.

use warnings ;
use SDBM_File ;

tie(%h, 'SDBM_File', 'data.dbmx', O_RDWR|O_CREAT, 0666)
or die "Couldn't tie SDBM file 'filename': $!; aborting";

$h{"newkey"} = "newvalue";

untie %h;

Errors:
Argument "O_SVWST" isn't numeric in null operation at Untitled line 4.
Couldn't tie SDBM file 'filename': No such file or directory; aborting at Untitled line 4.
 
When I used it, it was called DB_File, are you sure SDBM_File isn't just another flavour?

O_SVWST looks like a poorly declared constant in one of the modules would be a guess, how did you install SDBM_File

On Doze, I assume you're using ppm under ActivStates' distribution

--Paul
 
to Paul:

I use Windows installation ... so the only db package there is SDBM_File.It's built-in ... so I didn't change anything.
 
Could you provide me with your own working sample ?
 
Code:
C:\>ppm query *
Querying target 1 (ActivePerl 5.8.2.808)
   1. ActivePerl-DocTools         [0.04] Perl extension for Documentation TOC Generation
   2. ActiveState-RelocateTree    [0.03] Relocate a Perl installation
   3. ActiveState-Rx              [0.60] Regular Expression Debugger
   4. Archive-Tar                 [1.07] Manipulates TAR archives
   5. Bit-Vector                   [6.3] Efficient base class implementing bit vectors
   6. Compress-Zlib               [1.22] Interface to zlib compression library
   7. Data-Dump                   [1.01] Pretty printing of data structures
   8. Date-Calc                    [5.3] Gregorian calendar date calculations
   [b]9. DB_File                    [1.806] Perl5 access to Berkeley DB version 1.x[/b]
  10. DBD-ODBC                    [1.07] ODBC Driver for DBI
  11. DBI                         [1.43] Database independent interface for Perl
  12. Digest-HMAC                 [1.01] Keyed-Hashing for Message Authentication

Just some of the modules on my DoZe install
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top