|
Posted by Sonnich on 10/13/06 18:56
Pedro Graca wrote:
> Sonnich wrote:
> > The slow thing is that for each row in DB1, I run a query in DB2.
> >
> > The code is basically this - there is some more, but
>
> Try this:
>
> > // get data from MS SQL
> > $result2=odbc_exec($conn2, $sql);
> >
> > while(odbc_fetch_row($result2) )
> > {
> $MSSQLarr[] = odbc_result();
> }
>
> // Oracle SQL
> $ORACLEsql = "select ... where RECORDID in (" . implode(',', $MSSQLarr) . ") ...";
snip
> So, if MSSQL returns 42 rows, instead of 43 queries (1 on MSSQL + 42 on
> Oracle) you do 2 queries only.
I like the idea, but if:
$sql = ..... where code = '1234' and version = '03';
The in would return a lot more than I want :-)
Br
S
Navigation:
[Reply to this message]
|