In Oracle, I believe that the answer to your question is yes ( I am not
familiar with the others ).

Here is a snippet of a .pm that I run using Oracle as the database, it is
ugly but maybe it is what you are looking for.

   my $sth = $self->{'dbc'}->prepare("select c.TAG_NAME
                                     ,a.COLUMN_DATA_TYPE
                                     ,a.COLUMN_STARTING_POS
                                     ,a.COLUMN_ENDING_POS
                                     ,a.COLUMN_LENGTH
                                     ,a.COLUMN_DATA_TYPE
                                     ,a.DATE_CONVERSION_MASK
                                     ,b.SQLLDR_DATATYPE
                                     from
                                      META_TAB_COL\@STAGE001 a
                                     ,FEED_DATATYPE_CONVERSIONS\@STAGE001 b
                                     ,FDMS_COLUMN_TRANSLATION c where
                                     a.COLUMN_NAME = c.BASELINE_COL_NAME and
                                     a.FIELD_NUMERIC_MASK =
b.FEED_DATATYPE(+) and
                                     a.FEED_NAME = $feedName
                                     order by a.COLUMN_STARTING_POS" );

$sth->execute();

#Declare the variables for database values.
my ($tagName ,$dataType ,$colStartPos ,$colEndPos ,$colLength ,$colDataType
,$colDateFmt ,$colNumFmt );

#Bind the variables to the sql statement.
$sth->bind_columns( \($tagName ,$dataType ,$colStartPos ,$colEndPos
,$colLength ,$colDataType ,$colDateFmt ,$colNumFmt ));

AND SO ON...

Regards,

Bryan




-----Original Message-----
From: Martin Moss [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 7:38 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Joining Databases


Daft question,

Is it possible to join databases without making two calls. I.e. can the join
be done within SQL, not using 2 $db references?
Not sure which databases yet, but probably mysql, oracle, postgreSQL.


Regards

Marty

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to