Subject Re: [ib-support] Call Interbase Stored Procedure from PHP
Author Xavier Solé
The two tables are:

CREATE TABLE "Spot" (
"SpotId" INTEGER NOT NULL,
"ClId" INTEGER NOT NULL,
"ArrayTypeId" INTEGER NOT NULL,
"ArrayRow" INTEGER NOT NULL,
"ArrayColumn" INTEGER NOT NULL,
"Row" INTEGER NOT NULL,
"Column" INTEGER NOT NULL);

Where:
- SpotId is the PK has an autoincrement associated with a trigger (obviously
it has an index).
- ClId is a FK (it has an index)
- ArrayTypeId is another FK (it has an index)
- There is another index (unique=yes) for the columns:
"ArrayTypeId","ArrayRow","ArrayColumn","Row"."Column"
- An one index more (unique=no) for:
"ArrayRow","ArrayColumn","Row"."Column"


CREATE TABLE "RawData" (
"RawDataId" INTEGER NOT NULL,
"HybridizationId" INTEGER NOT NULL,
"SpotId" INTEGER NOT NULL,
"Intensity" INTEGER NOT NULL,
"Background" INTEGER NOT NULL,
"Area" INTEGER);

Where:
- RawDataId is the PK has an autoincrement associated with a trigger
(obviously it has an index).
- HybridizationId is a FK (it has an index)
- SpotId is a FK to the table Spot(it has an index)
- There is another index (unique=yes) for the columns:
"HybridizationId","SpotId"

The procedure, whose name is HYB_RAW_DATA_PROC and has two arguments (hybid1
and hybid2) is:

AS
begin
/* Procedure Text */
FOR
SELECT "ArrayRow", "ArrayColumn", "Row", "Column", "Intensity",
"Background", "Area"
FROM "Spot", "RawData"
WHERE "RawData"."SpotId" = "Spot"."SpotId" AND
("RawData"."HybridizationId" = :hybid1 or
"RawData"."HybridizationId" = :hybid2)
ORDER BY "ArrayRow", "ArrayColumn", "Row", "Column"
INTO :arrayrow, :arraycolumn, :subrow, :subcolumn, :intensity,
:background, :area
DO
SUSPEND;
end

When I execute the SP in IB Expert (Windows) or IBAccess (Linux) everything
works fine. But when I execute it from a PHP script with the command:

$sth = ibase_query("SELECT * FROM HYB_RAW_DATA_PROC(96,97)")

it shows me the error:

Warning: InterBase: I/O error for file "" Error while trying to open file No
such file or directory sort error in
/usr/local/apache/htdocs/hybdb/hybridization_raw_proc.php on line 83

I have heard that interbase creates temporary files in order queries where
there are not indexes to walk the results in an ordered way. Perhaps it is
just a problem of privileges? It seems that Interbase cannot create this
temporary file. I must say that this query returns more than 18000 rows.

My version of interbase is the 6.0 classic server for linux. I use Apache and
PHP 4.

I think this is everything.

Thank you,

Xavier.

A Divendres 08 Març 2002 07:09, vàreu escriure:
> Xavier,
> try ORDER BY 1, 2, 3, 4. If that doesn't work, tell us the definition of
> these four columns (and any indexes defined on them). Version of IB etc.
> could possibly help as well.
>
> HTH,
> Set
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

--
Xavier Solé Acha (mailto:x.sole@...)
Servei d'Epìdemiologia i Registre del Càncer
Institut Català d'Oncologia
Av. Gran Via km. 2,7
08907 L'Hospitalet de Llobregat, Barcelona
Tel: +34 932 607 401
Tel: +34 932 607 787