This commit is contained in:
casnet1
2020-10-31 12:48:58 -06:00
9 changed files with 28 additions and 4 deletions
+28 -4
View File
@@ -67,8 +67,15 @@ async function readExecel ( path )
let pdfVis = rows [i][12];
let sqlString = `INSERT INTO Libro values ( null, '${isbn}' , '${titulo}', '${categoria}', '${autor}', ${paginas}, '${edicion}', '${precio}', '${version}', '${descripcion}', ${year}); `;
try{
await query(sqlString);
}
catch (error){
console.log(`string : ${sqlString}`);
console.log(`Ocurrio un error al insertar en la base de datos msj: ${error}`);
new TypeError (`Error al insertar en la base de datos msj: ${error}`);
return;
}
@@ -81,12 +88,28 @@ async function readExecel ( path )
let idLibro = sqlAnswer.idLibro;
sqlString = `INSERT INTO Imagen values (null, ${idLibro}, '${imagen}' );`;
await query(sqlString);
try{
await query(sqlString);
}
catch (error){
console.log(`string : ${sqlString}`);
console.log(`Ocurrio un error al insertar en la base de datos msj: ${error}`);
new TypeError (`Error al insertar en la base de datos msj: ${error}`);
return;
}
sqlString = `INSERT INTO Visualizacion values (null, ${idLibro}, '${pdfVis}' );`;
await query(sqlString);
try{
await query(sqlString);
}catch (error){
console.log(`string : ${sqlString}`);
console.log(`Ocurrio un error al insertar en la base de datos msj: ${error}`);
new TypeError (`Error al insertar en la base de datos msj: ${error}`);
return;
}
@@ -99,6 +122,7 @@ async function readExecel ( path )
return;
}
catch (error){
console.log(`string : ${sqlString}`);
console.log(`Ocurrio un error al insertar en la base de datos msj: ${error}`);
new TypeError (`Error al insertar en la base de datos msj: ${error}`);
return;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB