Search Postgresql Archives

Re: C function working with input/ouput tables failed !

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FIRST PROBLEM IS SOLVED !

> First problem:
> When I try to get the input table, the first element is forgotten, then, the
> whole matrix is wrong! I have no idea of what happens?
>
> Example:
>      Input table                 Matrix obtained
>                             By reading tuple by tuple
>
>       1  0  2  0                    0  1  0  2
>       0  1  0  0                    0  0  1  0
>       0  0  1  0                    0  0  0  1
>       0  0  0  1                    0  0  0  0
>
> If you are interested to read the code:
> Look at the function called: compute_puissance_table
> At the line containing     : DBG(?Update of puissance_m?);
> --------------------

I change :
pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,tupdesc, j, &isnull));
To :
pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,tupdesc, j+1, &isnull));
In :
>            for (i = 0; i < nl; i++)
>              {
>                DBG("Tuple number %i\n", i+1);
>                HeapTuple tuple = tuptable->vals[i];
>                for (j = 0; j < nc; j++)
>                {
>                    pm->data[i][j]= DatumGetInt32(SPI_getbinval(tuple,
> tupdesc, j, &isnull));
>                }
>              }

In fact "SPI_getbinval(tuple,tupdesc, 0, &isnull));" returns NULL;

HOWEVER THE SECOND PROBLEM IS STILL OPEN !

Thanks for your reading!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux