Peter Scott schreef:
> Is there a simple way to create a new table with the same structure
> as a given one in a *different* database? That means the CREATE
> TABLE foo AS SELECT * FROM bar WHERE 1=2 method won't work.
That instruction doesn't guarantee that the new table has the same
structure.
Good Evening David-
You will need BOTH DBI and DBIx::Procedure::DBName packages (where DBName is
name of DBVendor)
*assume* both of these packages are available from CPAN
so the 1st 3 lines of your perl script should look something like
#@/usr/local/bin/perl -w
use DBI:
use DBIx::Procedure::D
Sure, here is my example-
I'm declaring a column as type varray like this:
"CREATE TYPE phone as varray(20) of varchar2(30)"
I then insert phone numbers into the varray like this:
insert into ADDRESS values (phone('949-933-5680', '949-600-5866',
'949-699-3608'))
This creates a column of varray
It took us a while to whittle this down into a small test case; however,
the fruits of labour seem to have paid off:
% perl -MDBI -e 'my $dbh =
DBI->connect("dbi:Sybase:server=MYSERVER","janedoe","janepass"); my
$arr_ref = $dbh->selectall_arrayref("execute sp_who"); print
@{$arr_ref->[0]},"\n";
Export from database 1
Import into database 2
Truncate table in database 2
-Original Message-
From: Peter Scott [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 06, 2007 2:38 PM
To: dbi-users@perl.org
Subject: Duplicate table structure
Is there a simple way to create a new table with t
Is there a simple way to create a new table with the same structure as a
given one in a *different* database? That means the CREATE TABLE foo AS
SELECT * FROM bar WHERE 1=2 method won't work. Didn't find anything in
some searching. I'd need to have two database handles open.
They're both Oracle
Ok that is what I need.
I checked the latest source and OCIDefineObject is not there (but we knew
that). Having a quick look at the OIC docs we may need to initialized the
OCI environment in Object mode beforehad which I do not think we do right
now.
I will have to check to see how hard tha
'varray' haven't hear of that in years. At least not since Nested Tables
came along . I aways thoght they were for PL/SQL only.
I will have a look at them later this week. I am just wondering how one want
to look at the data in DBI??
Can you give me a quick working example of what you want
On Tue, Jun 05, 2007 at 05:03:23PM -0700, Charles Pareto wrote:
>Hi Tim,
>[...] All I'm looking for is a way to select a column that is defined as
> type varray.
>Is there any way this can be accomplished using DBD-Oracle or anything
> else?
For simple data you could use SQL statemen