RE: [PHP-DB] Help on Oracle stored Procedure
| From: | Gustafson, Mårten | Date: | Sat, 20 May 2000 11:33:42 +0000 |
| Subject: | RE: [PHP-DB] Help on Oracle stored Procedure | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-58@lists.php.net to get a copy of this message | ||
Hi Alex.
In one or more of your bind lines the length argument is too short eg.
OCIBindByName($func,":DATA_VENCIMENTO", &$DVenc, 30);
-------------------------------------------------^^
Try this instead:
OCIBindByName($func,":DATA_VENCIMENTO", &$DVenc, strlen($DVenc));
Or maybe:
OCIBindByName($func,":DATA_VENCIMENTO", &$DVenc, strlen($DVenc)+1);
I´m not sure if you need to add one (1) to the length. The extra byte vould
be to hold the NULL bte character. Doing either strlen($variable) or
strlen($variable)+1 should solve your problem.
Regards
--Marten
> -----Original Message-----
> From: Alex Takitani Pires [mailto:voidbass@yahoo.com]
> Sent: Friday, May 19, 2000 4:21 PM
> To: Lista PHP
> Subject: [PHP-DB] Help on Oracle stored Procedure
>
>
> Tanks for the big help Marten .. but i'm still geting troubles ......
>
> this is the code :
>
> <?
> $conn = ocilogon("user","myne","ORCL");
>
> $Titulo = 49370;
>
> $SData = date(d."/".m."/".Y);
>
>
> $query = ("BEGIN
> ACFIN3000(:SEQ_TITULO_PESSOA,:SYSDATE,:DATA_VENCIMENTO,:SALDO_
RECEBER,:VAL_BAIXA,:VAL_ATUALIZADO,:VAL_BRUTO,:VAL_MULTA,:VAL_ENCARGO_DIA,:V
AL_BOLSA,:VAL_CRED_EDUC,:BAIXA_CEF,:OUTROS>
_DESCONTOS,:VAL_ACRESCIMO,:VAL_DESPESAS); END;");
>
> $func = OCIParse($conn,$query);
> OCIBindByName($func,":SEQ_TITULO_PESSOA" , &$Titulo ,5);
> OCIBindByName($func,":SYSDATE" , &$SData ,10);
> OCIBindByName($func,":DATA_VENCIMENTO" , &$DVenc ,30);
> OCIBindByName($func,":SALDO_RECEBER" , &$Saldo ,30);
> OCIBindByName($func,":VAL_BAIXA" , &$Baixa ,30);
> OCIBindByName($func,":VAL_ATUALIZADO" , &$Atual ,30);
> OCIBindByName($func,":VAL_BRUTO" , &$Bruto ,30);
> OCIBindByName($func,":VAL_MULTA" , &$Multa ,30);
> OCIBindByName($func,":VAL_ENCARGO_DIA" , &$Encargo ,30);
> OCIBindByName($func,":VAL_BOLSA" , &$Bolsa ,30);
> OCIBindByName($func,":VAL_CRED_EDUC" , &$Cred ,30);
> OCIBindByName($func,":BAIXA_CEF" , &$BaixaCef ,30);
> OCIBindByName($func,":OUTROS_DESCONTOS" , &$Outros ,30);
> OCIBindByName($func,":VAL_ACRESCIMO" , &$Acrescimo ,30);
> OCIBindByName($func,":VAL_DESPESAS" , &$Despesas ,30);
>
> OCIExecute($func);
> echo $query;
> ?>
>
>
> and this is the error message :
>
> Warning: OCIStmtExecute: ORA-01480: trailing null missing
> from STR bind value in
> C:\intranet\matricula\acfin3000.php3 on line 35
> BEGIN
> ACFIN3000(:SEQ_TITULO_PESSOA,:SYSDATE,:DATA_VENCIMENTO,:SALDO_
RECEBER,:VAL_BAIXA,:VAL_ATUALIZADO,:VAL_BRUTO,:VAL_MULTA,:VAL_ENCARGO_DIA,:V
AL_BOLSA,:VAL_CRED_EDUC,:BAIXA_CEF,:OUTROS>
_DESCONTOS,:VAL_ACRESCIMO,:VAL_DESPESAS);
> END;
>
>
>
> Please .......... HHHHHEEEEEEEEEELLLLLLLLLLLLLLPPPPPPPPPP
> !!!!!!!!!!!!!!
>