我正在开发一个系统,管理员可以根据需要创建任意数量的手风琴,然后,当他要保存数据时,便可以进入数据库。该数据将成为String格式的HTML代码。现在,当我保存太多行HTML代码时,根据我调查的结果,当数据很长时,会出现错误ORA-01460。我想知道如何避免此错误。
我用于保存HTML代码的功能
public function guardar_frontEnd($str_html) {
$conexion = conex::con();
$stid1 = oci_parse($conexion, "begin SP_INSERTAR_FRONTEND(:x1); end;");
oci_bind_by_name($stid1, ':x1', $str_html);
$result = oci_execute($stid1);
oci_free_statement($stid1);
if ($result == 1) {
return true;
} else if ($result == "") {
return false;
}
OCILogoff($conexion);
}
存储过程
CREATE OR REPLACE PROCEDURE SP_INSERTAR_FRONTEND(p_str_html IN VARCHAR2)
AS
str_html CLOB := p_str_html;
v_count number;
BEGIN
SELECT COUNT(*) INTO v_count FROM TBLPRUEBA;
IF (v_count = 0) THEN
INSERT INTO TBLPRUEBA(ID_ACORDEON, DESCRIP_ACORDEON) VALUES(1, 'NO HAY PREGUNTAS');
ELSIF (v_count > 1) THEN
UPDATE TBLPRUEBA T SET T.DESCRIP_ACORDEON = str_html WHERE T.ID_ACORDEON = 2;
ELSE
INSERT INTO TBLPRUEBA VALUES(2, str_html);
COMMIT;
END IF;
END;
iajax_configuration_acordeon.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once '../php/puntosDAO.php';
//TODO:
$p = new puntosDAO();
$cantSubnivelxNivel = json_decode($_REQUEST["cantSubnivelxNivelJSON"]);
$cantPregxSubnivel = json_decode($_REQUEST["cantPregxSubnivelJSON"]);
$cantPregxNivel = json_decode($_REQUEST["cantPregxNivelJSON"]);
$nivel = json_decode($_REQUEST["nivelJSON"]);
$subnivel = json_decode($_REQUEST["subnivelJSON"]);
$preguntas = json_decode($_REQUEST["preguntasJSON"]);
$frontEnd = json_decode($_REQUEST["frontEndJSON"]);
//TODO:
$p->guardar_frontEnd($frontEnd);
//echo ($frontEnd);
echo var_dump($frontEnd);
//TODO: NIVEL
foreach($nivel as $x){
$p->guardarNivel($x);
}
//TODO: SUBNIVEL
$w = 0;
$x = 1;
$y = 0;
$f = 1;
for($i = 0; $i < count($cantSubnivelxNivel); $i++){
if($cantSubnivelxNivel[$w] == 0){
$p->guardarSubNivel($x, 0, "SIN NOMBRE");
$y++;
}
for($j = 0; $j < $cantSubnivelxNivel[$w]; $j++){
$p->guardarSubNivel($x, $f, $subnivel[$y]);
$y++;
$f++;
}
$x++;
$w++;
$f = 1;
}
//TODO: PREGUNTAS
$a = 0;
$n = 1;
$sn = 1;
$d = 0;
$e = 0;
$r = 1;
for($i = 0; $i < count($cantPregxSubnivel); $i++){
if($cantSubnivelxNivel[$d] == 0){
for($z = 0; $z < $cantPregxSubnivel[$e]; $z++){
$p->guardarPreguntas($n, 0, $r, $preguntas[$a]);
$a++;
$r++;
}
$e++;
$r = 1;
}
for($j = 0; $j < $cantSubnivelxNivel[$d]; $j++){
for($z = 0; $z < $cantPregxSubnivel[$e]; $z++){
$p->guardarPreguntas($n, $sn, $r, $preguntas[$a]);
$a++;
$r++;
}
$sn++;
$e++;
$r = 1;
}
$n++;
$d++;
$sn = 1;
}
?>
Acordeon.js
https://drive.google.com/open?id=106KB1k-1AHzyBWkqVeQZsRIbnOBi4o7Y