PostgreSQL table creation issue with SQL query DOUBLE


ledbelly2142

Recommended Posts

I am very new to SQL databases. Need some help with ODBC Logging to PostgreSQL db in DAQFactory...

It appears that PostgreSQL does not use the SQL query DOUBLE. I think this means that when setting up the ODBC logging set, DAQFactory cannot create the initial table and I get the following error:

08/05/11 10:45:54.641

C1011 Could not create table for logging. Msg: ERROR: type "double" does not exist;

Error while executing the query

From PostgreSQL documentation:

The most common cause of unrecognized names is the use of double-quotes around table or column names during table creation. When double-quotes are used, table and column names (called identifiers) are stored case-sensitive, meaning you must use double-quotes when referencing the names in a query. Some interfaces, like pgAdmin, automatically double-quote identifiers during table creation. So, for identifiers to be recognized, you must either:

Avoid double-quoting identifiers when creating tables

Use only lowercase characters in identifiers

Double-quote identifiers when referencing them in quer

My question is, for the Number field in the SQL string, what SQL query command can use instead of "DOUBLE"?

Thank you.

Greg

Link to comment
Share on other sites

"Double" refers to the numeric data type, not double quoting. As for what you can use in place of DOUBLE, you'd have to look in the postgreSQL documentation on what they call a floating point number. Maybe REAL? You can change what DAQFactory uses by clicking the "SQL" button to the right of the place where you enter the data source name.

Link to comment
Share on other sites

I got this from the manual searching for floating point number:

Table in Chapter 8:

Name Storage Size Description Range

smallint 2 bytes small-range integer -32768 to +32767

integer 4 bytes usual choice for integer -2147483648 to +2147483647

bigint 8 bytes large-range integer -9223372036854775808 to 9223372036854775807

decimal variable user-specified precision, exact no limit

numeric variable user-specified precision, exact no limit

real 4 bytes variable-precision, inexact 6 decimal digits precision

double precision 8 bytes variable-precision, inexact 15 decimal digits precision

serial 4 bytes autoincrementing integer 1 to 2147483647

bigserial 8 bytes large autoincrementing integer 1 to 9223372036854775807

Should I use REAL or DOUBLE PRECISION?

Thanks

Greg

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.