Fix SQL query handling empty string for NULL columns
Deploy Bürgerwind / deploy (push) Successful in 17s
Details
Deploy Bürgerwind / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
9c8032d511
commit
b5c523ab07
|
|
@ -149,9 +149,11 @@ app.post('/api/sicherung', async (req, res) => {
|
||||||
throw new Error(`Projekt '${projekt_id}' konnte nicht gefunden werden.`);
|
throw new Error(`Projekt '${projekt_id}' konnte nicht gefunden werden.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. FSKs für den Namen finden
|
// 2. FSKs für den Namen finden (Behandlung von NULL vs leerem String)
|
||||||
const ownerRes = await client.query(
|
const ownerRes = await client.query(
|
||||||
`SELECT "FSK" FROM ${schema}.flaecheneigentuemer_alkis WHERE "GNA" = $1 AND "VNA" = $2`,
|
`SELECT "FSK" FROM ${schema}.flaecheneigentuemer_alkis
|
||||||
|
WHERE ("GNA" = $1 OR ("GNA" IS NULL AND $1 = ''))
|
||||||
|
AND ("VNA" = $2 OR ("VNA" IS NULL AND $2 = ''))`,
|
||||||
[nachname, vorname]
|
[nachname, vorname]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue