# error: sql: Scan error on column index 2: converting NULL to string is unsupported

- **ID:** `go/database-sql-null-value-in-non-null-column`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Scanning a NULL database value into a non-nullable Go type, such as string or int, without using sql.Null* types.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Use sql.NullString and similar types** (95% success)
   ```
   var name sql.NullString
if err := rows.Scan(&name); err != nil { return err }
if name.Valid { /* use name.String */ } else { /* handle NULL */ }
   ```

## Dead Ends

- **Using default values manually** — May mask actual NULL meaning; use NullString for proper handling. (50% fail)
