in reply to Merging Arrays into a Hash with Substitutions
You can specify in the query what to return for a given field when the row being returned happens to have a null in that field. I don't know whether this is the sort of thing where the syntax varies from one database system to the next, but in Oracle, you would do something like this:
The first arg to NVL() is a field to be returned, and the second arg is a string to be returned when the given field is null. It adds a bit of flexibility when doing queries, and can help simplify the perl scripting."select id,NVL(field_a,' '),NVL(field_b,'NO_B') from table..."
|
|---|