chunk_spilt error help
Posted: Tue Nov 26, 2002 3:08 pm
I am doing an insert from a csv file. One of the fields I had to parse spaces into. I am using the code below:
####################################
$query="INSERT INTO options VALUES ($event";
$num_fields = count($data);
for ($x=0;$x < $num_fields;$x++)
{
IF ($data[11]) { $data[11]= chunk_split($data[11], 3, ' '); }
$return_value = convert_string($data[$x]);
$query .= ", '$return_value'";
}
$query .= ")";
echo "</table></table></table>";
$r = pg_exec($c,$query);
##############################################
I have to use chunk_split on the 10th field to get the number to be seperated by a space at every 3rd character, it works until I add the chunk_split. Once I add the chunk split I get the following errrors below. Does anyone have any ideas?
ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140
####################################
$query="INSERT INTO options VALUES ($event";
$num_fields = count($data);
for ($x=0;$x < $num_fields;$x++)
{
IF ($data[11]) { $data[11]= chunk_split($data[11], 3, ' '); }
$return_value = convert_string($data[$x]);
$query .= ", '$return_value'";
}
$query .= ")";
echo "</table></table></table>";
$r = pg_exec($c,$query);
##############################################
I have to use chunk_split on the 10th field to get the number to be seperated by a space at every 3rd character, it works until I add the chunk_split. Once I add the chunk split I get the following errrors below. Does anyone have any ideas?
ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140