pro*c timestamp type
HI.
Here is how i operate with data in my pro*c program (internal type code = 12):
int convert_date(char* date, char* dest) {
sprintf(dest,
"%d%d.%s%d.%s%d %s%d:%s%d:%s%d",
date[0]>=0?date[0]-100:date[0]+256-100,
date[1]>=0?date[1]-100:date[1]+256-100,
date[2]<=9?"0":"",date[2],
date[3]<=9?"0":"", date[3],
date[4]-1<=9?"0":"", date[4]-1,
date[5]-1<=9?"0":"", date[5]-1,
date[6]-1<=9?"0":"", date[6]-1);
dest[30] = 0;
return 0;
}
I assign a returned value to char[7] host variable.
The question is: how can i do the same with timestamp columns? (internal type == 187)?
The reason I cannot translate the value to character type (set descriptor ... type = 5 ...) is that there is some corrupted data in my database and i get a ORA-01877. That is why i have to convert date columns manually.