Tutoriale PHP
  Comunitatea PHP Romania
 

 
Tutoriale PHP
Index » Noutati

Harun Yayli's Blog: oci_bind_by_name maxlength is not so optional


Postat:Vineri 09 Mai 2008 18:45
Accesari:12
Comentarii:0
Favorite:0
Sursa: http://www.phpdeveloper.org

Del.icio.us
Digg
Technorati
Categorii: Noutati | alfahost_ro

Harun Yayli came across a slight problem in his development using the oci_bind_by_name function for one of his queries:

If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.

His sample code gave him a "can bind a LONG value only for insert into a LONG column..." error from his Oracle database. His fix was to add that length parameter (his max column length) and all was well. One of his comments (from cj) helps to explain things a bit more:

It makes senses that a length would be required because when the oci_bind_by_name() call is made, there is no data in $$key (a.k.a. $a, $b or $c). Without a length passed, PHP tells the DB to expect a single byte string.

Comentarii


    Ultimele discutii in forum RSS Forum

    Ultimele articole Ultimele articole

    Top membri

    Pirahna Pirahna
    acasa , in pat
    carco carco
    Bucuresti
    Birkoff Birkoff
    Bucuresti
    Mascka Mascka
    Braila
    raul_ raul_
    whooper whooper
    Toronto ON
    mihaitha mihaitha
    Sibiu
    gabysolomon gabysolomon
    Bacau
    oriceon oriceon
    Constanta
    garlicinicolae garlicinicolae

    Newsletter


    Email:
     inscriere
     renuntare
     
     Arhiva newsletter

    Site-ul lunii

    blg
     Blgpunctro

    Propune un site

    Online

    127 utilizatori online

    Parteneriat



    Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Loans | Credit Card | Mobile Phones | Mobile Phones | Libros
    Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
    Powered by Simplis