Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Statement execute thrown exception doesn't populate the odbcErrors array

Aperta
#429 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
database

Direzione di ricerca

Inizia dal percorso Statement.execute() e riproduci l'errore con la sequenza prepare, bind ed execute fornita su DB2 for i usando il tracing di unixODBC. Confronta l'errore generato con le informazioni diagnostiche ODBC disponibili durante l'esecuzione; il lavoro è completato quando l'array odbcErrors dell'errore contiene le informazioni che descrivono il fallimento dell'istruzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe your system

  • odbc Package Version: 2.4.9
  • ODBC Driver: 1.1.0.28-0
  • unixODBC 2.3.9
  • Database Name: DB2 for i
  • Database Version: V7R5M0
  • Database OS: IBM i
  • Node.js Version: 18.18.2
  • Node.js OS: IBM i

Describe the bug
The error doesn't contain the odbcErrors data. console.log of the error in a catch block will give you

[Error: [odbc] Error executing the statement] { odbcErrors: [] }

Expected behavior
odbcErrors to have the information about what caused the error

To Reproduce
Steps to reproduce the behavior:

  1. Run the node.js code below:

Code

try {
const connection = await odbc.connect(my_connection_string);
const statement = await connection.createStatement();
let bindVal = [
        field1 || '',
        field2 || '']
await statement.prepare(`UPDATE MYLIB.MYTABLE
      SET 
      FIELD1 = ?
      WHERE FIELD2 = ?`);
await statement.bind(bindVal);
const result = await statement.execute();
} catch (error) {
        console.log(error);
        const odbc_error = error?.odbcErrors || 'No ODBC error object';
        console.log(odbc_error)
        const odbc_error_message = error?.odbcErrors?.[0]?.message || 'No ODBC error message';
        console.log(odbc_error_message)
}

Additional context
Checked the following table to find out what the error was but couldn't find anything there either:
qsys2.history_log_info
qsys2.joblog_info
https://github.com/IBM/node-odbc/issues/389 - @harsh-savvient mentioned this issue
https://github.com/IBM/node-odbc/issues/363 - @mikemicmike also raised this issue Dec 21, 2023 and @FredoMartini confirmed it March 1, 2024 and the robot closed the issue May 30, 2024 as stale
https://github.com/IBM/node-odbc/issues/30

Lingua principale
JavaScript
Stelle
159
Fork
92
Merge medio
5h 59m
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IBM/node-odbc

Tutte le issue di IBM/node-odbc

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.