I previously posted this inappropriately in the SQL Server forum not realizing syntax would be different. So sorry for duplicate posting!
I've done a search on a few sites for the answer to this, and i think i'm not finding it because it is too basic. But still it seems to be a valid question, and possibly a useful trick, so i'll ask anyway.
I am creating a reusable component in vb that will retrieve personnel specific data for front-end apps. I am working with a large view, and most of the fields have the potential of containing nulls.
I know to use the following for individual fields:
<code> Select nvl(field1,chr(0)), field2, ... ...</code>
But with the number of fields required, I really don’t want to have to select each field individually. This also seems like a good trick to have in my bag for the future.
Is there some way to convert nulls to blanks or zeros while using <code> select * </code>? For fun I attempted the following code:
<code> select nvl(*,chr(0)) from ... ... </code>
but as I’m sure you guessed, it didn’t work!
Any help or advice is greatly appreciated!
I've done a search on a few sites for the answer to this, and i think i'm not finding it because it is too basic. But still it seems to be a valid question, and possibly a useful trick, so i'll ask anyway.
I am creating a reusable component in vb that will retrieve personnel specific data for front-end apps. I am working with a large view, and most of the fields have the potential of containing nulls.
I know to use the following for individual fields:
<code> Select nvl(field1,chr(0)), field2, ... ...</code>
But with the number of fields required, I really don’t want to have to select each field individually. This also seems like a good trick to have in my bag for the future.
Is there some way to convert nulls to blanks or zeros while using <code> select * </code>? For fun I attempted the following code:
<code> select nvl(*,chr(0)) from ... ... </code>
but as I’m sure you guessed, it didn’t work!
Any help or advice is greatly appreciated!