# Yugabyte driver api - How to retrieve all columns upon failed INSERT?

**URL:** <https://forum.yugabyte.com/t/yugabyte-driver-api-how-to-retrieve-all-columns-upon-failed-insert/1126>\
**Category:** General\
**Created:** [July 14, 2021, 7:27pm UTC](https://forum.yugabyte.com/t/yugabyte-driver-api-how-to-retrieve-all-columns-upon-failed-insert/1126 "2021-07-14T19:27:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sham\_yuga](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sham\_yuga](https://forum.yugabyte.com/u/sham_yuga)\
**Post date:** [July 14, 2021, 7:27pm UTC](https://forum.yugabyte.com/t/yugabyte-driver-api-how-to-retrieve-all-columns-upon-failed-insert/1126/1 "2021-07-14T19:27:01Z")

</div>

We are migrating from Apache Cassandra DB to Yugabyte DB

* * *

With Apache Cassandra, GoCQL driver([GitHub - gocql/gocql: Package gocql implements a fast and robust Cassandra client for the Go programming language.](https://github.com/gocql/gocql)) provides the option to retrieve all columns upon failed INSERT using `MapScanCAS()` api:

```auto
    insertValuesString = "INSERT INTO my_table (col1,col2,col3) " + "VALUES (?, ?, ?) IF NOT EXISTS"
    mapObj := map[string]interface{}{}
    applied, err := gocql.Session.Query(insertValuesString,
        col1,
        col2,
	col3).MapScanCAS(mapObj)

```

* * *

Using Yugabyte DB, ycql shell provides all columns with `RETURN STATUS AS ROW` clause, as mentioned here([IF NOT EXISTS clause is not returning all columns, If the row already exists - #2 by dorian\_yugabyte](https://forum.yugabyte.com/t/if-not-exists-clause-is-not-returning-all-columns-if-the-row-already-exists/925/2)).

* * *

We are currently using driver: [GitHub - yugabyte/gocql: The YugabyteDB database Go Driver for YCQL, based on the gocql Driver](https://github.com/yugabyte/gocql) for YugabyteDB.

For YugabyteDB, what is the driver api to fetch all the columns, upon failed INSERT?

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [July 15, 2021, 10:53am UTC](https://forum.yugabyte.com/t/yugabyte-driver-api-how-to-retrieve-all-columns-upon-failed-insert/1126/2 "2021-07-15T10:53:00Z")

</div>

Hi @sham_yuga

> [@sham\_yuga](#):
>
> For YugabyteDB, what is the driver api to fetch all the columns, upon failed INSERT?

The driver returns a row object, so the same api that you fetch a row. In the response you linked, [there is a sample code in python](https://docs.yugabyte.com/latest/api/ycql/batch/#example-in-python-using-returns-as-status), that you can see it just retrieves a row.
