1DBD::Sponge(3)        User Contributed Perl Documentation       DBD::Sponge(3)
2
3
4

NAME

6       DBD::Sponge - Create a DBI statement handle from Perl data
7

SYNOPSIS

9         my $sponge = DBI->connect("dbi:Sponge:","","",{ RaiseError => 1 });
10         my $sth = $sponge->prepare($statement, {
11                 rows => $data,
12                 NAME => $names,
13                 %attr
14             }
15         );
16

DESCRIPTION

18       DBD::Sponge is useful for making a Perl data structure accessible
19       through a standard DBI statement handle. This may be useful to DBD mod‐
20       ule authors who need to transform data in this way.
21

METHODS

23       connect()
24
25         my $sponge = DBI->connect("dbi:Sponge:","","",{ RaiseError => 1 });
26
27       Here's a sample syntax for creating a database handle for the Sponge
28       driver.  No username and password are needed.
29
30       prepare()
31
32         my $sth = $sponge->prepare($statement, {
33                 rows => $data,
34                 NAME => $names,
35                 %attr
36             }
37         );
38
39       ·   The $statement here is an arbitrary statement or name you want to
40           provide as identity of your data. If you're using DBI::Profile it
41           will appear in the profile data.
42
43           Generally it's expected that you are preparing a statement handle
44           as if a "select" statement happened.
45
46       ·   $data is a reference to the data you are providing, given as an
47           array of arrays.
48
49       ·   $names is a reference an array of column names for the $data you
50           are providing.  The number and order should match the number and
51           ordering of the $data columns.
52
53       ·   %attr is a hash of other standard DBI attributes that you might
54           pass to a prepare statement.
55
56           Currently only NAME, TYPE, and PRECISION are supported.
57

BUGS

59       Using this module to prepare INSERT-like statements is not currently
60       documented.
61
63       This module is Copyright (c) 2003 Tim Bunce
64
65       Documentation initially written by Mark Stosberg
66
67       The DBD::Sponge module is free software; you can redistribute it and/or
68       modify it under the same terms as Perl itself. In particular permission
69       is granted to Tim Bunce for distributing this as a part of the DBI.
70

SEE ALSO

72       DBI
73
74
75
76perl v5.8.8                       2006-02-07                    DBD::Sponge(3)
Impressum