Question: I am pretty new to mysql. I have set of csv files which I want to insert into different tables. I have fixed 100 columns for all the files. But, some files contain values only upto 50 column. So I want to insert zero value for all the other columns. Can someone please tell me how to do that.

Answer: 
You can use the ternary or conditional operator. The basic form is:

```
condition ? valueIfTrue : valueIfFalse

```

Example:  

```
const char* x = (SomeFunction() == 0) ? "is null" : "is not null";

```

When `SomeFunction()` returns 0, `x` is initialised with "`is null`", otherwise
with "`is not null`".
Your question is a bit confusing, or rather not enough information was provided. It is not clear if the `dimsOut[]` variable is needed elsewhere. In case it is used ONLY for the computation of `dataSize`, you can use directly the `dims[]` array and do:

```
int typeSize = data->primType().getTypeSize() * data->nDataVar();
int dimension = dims[0] * dims[1] * ((condition) ? dims[2] : 1);
const size_t dataSize = typeSize * dimension;

```

In case that dimsOut is used elsewhere, then you can use the first block modifying the dimsOut[3] assignment with the ternary operator:

```
int dimsOut[4];
dimsOut[0] = data->nDataVar();
dimsOut[1] = dims[0];
dimsOut[2] = dims[1];
dimsOut[3] = (condition) ? dims[2] : 1;

const size_t dataSize = data->primType().getTypeSize() * dimsOut[0] * dimsOut[1] * dimsOut[2] * dimsOut[3];

```