Skip to main content

sqlcard

Function sqlcard 

Source
pub fn sqlcard(sqlcode: i32, sqlstate: &str, rows: i32) -> Vec<u8> ⓘ
Expand description

A complete SQLAM 7 SQLCARD: the SQLCAGRP with its SQLCAXGRP present (so SQLERRD3 can carry the rows a statement affected) and its SQLDIAGGRP null. Character fields are in the single-byte CCSID ACCRDBRM declares (UTF-8, so plain ASCII here). Byte layout:

0x00                       SQLCAGRP present
SQLCODE    i32 BE          4 bytes
SQLSTATE   5 chars         padded with blanks
SQLERRPROC 8 chars         "NETGET  "
0x00                       SQLCAXGRP present
  SQLERRD1..6  6 x i32     SQLERRD3 = rows affected, the rest 0
  SQLWARN0..A  11 chars    blanks
  SQLRDBNAME   u16 0       empty VCS
  SQLERRMSG_m  u16 0       empty VCM
  SQLERRMSG_s  u16 0       empty VCS
0xFF                       SQLDIAGGRP null

SQLDIAGGRP’s null indicator is not optional at SQLAM 7: a driver reads it after the SQLCAXGRP whether or not anything is in it.