Question: I have a date column in source which is defined as varchar(255). I want to convert that to timestamp(0). I am using the below query:

```
SEL CAST(CAST( SERIND AS CHAR(10)) || ' 00:00:00' AS TIMESTAMP(0))
FROM DP_BOX.SOC1
WHERE SERIND ='20130518'

```

I am getting invalid timestamp here. Sample SERIND are 

```
20170509
00000000

```

Can anyone please help me on this?

Answer: 
Because an array `int [a][b]` (2D int array) is not a compatible type with `int*` (int pointer). A 2D array when used in an expression decays to a pointer to the first element, which in this case would be an array pointer to a 1D array, of type `int(*)[b]`.

The line `ptr[b]=arr;` therefore makes no sense and it also access the array `ptr` out of bounds.

If you wish to have a pointer to the first item in the 2D array, you would have to type 

```
ptr[n] = &arr[0][0]; // where n is a value that makes sense

```
yes,I have figured it out.Now,i understand my mistake.

```
int* ptr[b];
ptr[b]=arr;

```

is totally wrong.In here I was declaring an array of "ptr" which is pointer to integer and was assigning a pointer "arr" to "ptr[b]" which is pointer to integer.as, arr is a 2D array it returns the address of arr[0][0] .but
ptr[b] is pointer to integer.so,these are not the same.(Actually,"ptr[b]=arr" doesn't make any sense.at first,I didn't understood it enough but now I have fixed it.

```
int (*ptr)[b];
ptr=arr;

```

Now it works without any warning.