my code accesses a db2 database and using the result from this query i want to access a sybase database for the final query... but when i use two different database handles
$dbh1 and $dbh2 it returns "cannot prepare for unknown ..." for the second databases .. hw can i access both databases concurrently without having to break connection from first and using the same handle for second... pls help .. this is important for my project .. thank u in advance
this is the skeleton of code i want to use
$dbh1->connect("to db2 database");
$dbh2->connect("to sybase database");
$sth=$dbh1->prepare("select * from table");
$sth->execute();
while (@row=$sth->fetchrow())
{
##now using $row
1 as parameter for sybase
query
$sth1=$dbh2->prepare(select * from table_syb
where parameter=$row
1 ;
$sth1->execute();
@result=$sth1->fetchrow();
}
this is the error for the 2nd prepare staement
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.