CREATE TABLE serial.materialized_holding_code (
id BIGSERIAL PRIMARY KEY,
issuance INTEGER NOT NULL REFERENCES serial.issuance (id) ON DELETE CASCADE,
- holding_type TEXT NOT NULL,
- ind1 TEXT,
- ind2 TEXT,
subfield CHAR,
value TEXT
);
my $istmt = spi_prepare(
q{
INSERT INTO serial.materialized_holding_code (
- issuance, holding_type, ind1, ind2, subfield, value
- ) VALUES ($1, $2, $3, $4, $5, $6)
- }, qw{INT TEXT TEXT TEXT CHAR TEXT}
+ issuance, subfield, value
+ ) VALUES ($1, $2, $3)
+ }, qw{INT CHAR TEXT}
);
foreach ($field->subfields) {
spi_exec_prepared(
$istmt,
$_TD->{new}{id},
- $_TD->{new}{holding_type},
- $field->indicator(1),
- $field->indicator(2),
$_->[0],
$_->[1]
);