CREATE TABLE price.price (
ric text,
date date,
close decimal,
created_at timestamp,
high decimal,
low decimal,
open decimal,
security_id int,
volume decimal,
PRIMARY KEY (ric, date)
)
I would like to fetch the `close` column and display it in a C++ application.
Here's the relevant code:
const cass_byte_t* close;
int scale = 0;
cass_value_get_decimal(cass_row_get_column_by_name(row, "close"), &close, &size, &scale);
cout << atof((char*)close) << endl;
printf("CLOSE: '%.*s'\n", (int)size, close);
The cout line prints 0, the printf prints garbage. How do i fetch the value of a decimal field?
--
You received this message because you are subscribed to the Google Groups "DataStax C++ Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-user+unsubscribe@lists.datastax.com.