segfault: Pro*C FETCH INTO host array

From: <mlarimer_at_digitalriver.com>
Date: 2000/02/29
Message-ID: <89gpoq$tr0$1_at_nnrp1.deja.com>#1/1


Why does my prog **segfault** on the FETCH INTO line in the following situation?? The SELECT itself is good -- I can paste it into sqlplus and she fires just fine.

#define ARRAY_SIZE 1000

struct {

    char email_address[ARRAY_SIZE][255];     char domain[ARRAY_SIZE][255];
    char inverted_domain[ARRAY_SIZE][255]; } rows;

int batch_count, total_count = 0;

EXEC SQL DECLARE c1 CURSOR FOR

    SELECT email_address, domain, inverted_domain     FROM cm_namelist_staging ns
    WHERE NOT EXISTS

        (SELECT 1
         FROM cm_name_masters nm
         WHERE nm.email_address = ns.email_address);

EXEC SQL OPEN c1;
EXEC SQL WHENEVER NOT FOUND DO break;
while (1) {

    EXEC SQL FETCH c1 INTO :rows; <<==== SEGFAULT HERE ******

    batch_count = sqlca.sqlerrd[2] - total_count;     total_count = sqlca.sqlerrd[2];
    if (batch_count <= 0) break;

    /* remaining code snipped */
}
EXEC SQL CLOSE c1;
EXEC SQL COMMIT; Any help would be greatly appreciated. Thanks. --mark

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Feb 29 2000 - 00:00:00 CET

Original text of this message