Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with procedures and cursors

Hello all.

We're using MaxDB V7.6.03.07 (64bit) and the maxdb PHP-extension

(V7.6.00.38) to connect to it.

OS: SuSE Linux Enterprise Server x86_64

Server: Apache 2.2.3 / PHP 5.2.5

"Normal" queries (select/insert/update/delete) work fine, but

procedure-calls and cursors just don't work:

Every time i call a procedure which creates a cursor, this cursor disappears

immediately ("unknown table name ...").

Issuing the same statements in the DB-Studio works as expected.

Procedure:

[code]

CREATE DBPROC CALCULATE_AUFTRAG_TERMINE(IN [...], [...])

RETURNS CURSOR AS

[...]

DECLARE CALCULATE_RETURN CURSOR FOR SELECT [...] FOR REUSE;

[/code]

PHP:

[code]

class ... {

$this->maxdb->real_connect(...);

$this->query = $this->maxdb->query(

"CALL CALCULATE_AUFTRAG_TERMINE [...]"

);

$this->query = $this->maxdb->query(

"SELECT * FROM CALCULATE_RETURN"

);

}

[/code]

PHP-Log:

[code]

PHP Warning: maxdb::query() [<a href='function.maxdb-query'>function.maxdb-query</a>]:

-4004 POS(15) Unknown table name:CALCULATE_RETURN [42000]

[/code]

A related(?) problem exists with cursors.

If i DECLARE a cursor and run SELECT on it, i get a "unknown table name"

error as well.

[code]

$this->maxdb->query("DECLARE ... CURSOR FOR ...")

[/code]

... leads to a -4004 error, but ...

[code]

$stmt = $this->maxdb->prepare("DECLARE ... CURSOR FOR ...")

$stmt->bind_param("", array());

$stmt->execute();

[/code]

... works fine!

If i do the same thing (prepare/execute) for the procedure above,

Apache dies with a segmentation fault.

Apache error_log:

[code]

... [notice] child pid 17005 exit signal Segmentation fault (11)

[/code]

Any help/ideas are appreciated.

Sincerely,

Daniel Berlin

Former Member
Not what you were looking for? View more on this topic or Ask a question