Hi all, I'm having difficulty inserting empty strings into a CHAR(10)
field in my database.

I'm trying to insert an empty string ('') into a database field.  But in
every case I get a space (' ') as the value in the table.  Using
DBD::Informix 1.00.PC1 with DBI 1.20.

    $stmt = "insert into fftable values(?)";
    $ins_h = $dbh->prepare($stmt);

    $my_value = '';
    $ins_h->bind_param(1,$my_value,{TYPE => SQL_CHAR});

    $ins_h->execute();

I also tried without binding:
    $ins_h->execute($my_value);

I also tried:
    $ins_h->execute('');

In every case I get ' ' (a space) as the value in my database table.
Does anyone know why?

Regards,

Ron MacNeil



Reply via email to