Subject Re: [ib-support] Call Interbase Stored Procedure from PHP
Author Helen Borrie
At 01:25 PM 08-03-02 -0500, you wrote:
>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.

Xavier,
Is it possible you are out of space in /tmp? You can actually configure
specific areas your filesystem for the temp sort files...I don't use /tmp
for sort files at all because my setup has only a 2 Mb /tmp partition.

regards,
Helen