sqltypes (library)

Usage and interface

Documentation on exports

REGTYPE
sqltype(int).
sqltype(flt).
sqltype(num).
sqltype(string).
sqltype(date).
sqltype(time).
sqltype(datetime).

These types have the same meaning as the corresponding standard types in the basictypes library.

Usage: sqltype(Type)

  • Description: Type is an SQL data type supported by the translator.

PREDICATE

Usage: accepted_type(SystemType,NativeType)

  • Description: For the moment, tests wether the SystemType received is a sybase or a postgres type (in the future other systems should be supported) and obtains its equivalent NativeType sqltype.
  • Call and exit should be compatible with:
    (sqltypes:sybasetype/1)SystemType is an SQL data type supported by Sybase.
    (sqltypes:sqltype/1)NativeType is an SQL data type supported by the translator.

PREDICATE

Usage: get_type(Constant,Type)

  • Description: Prolog implementation-specific definition of type retrievals. CIAO Prolog version given here (ISO).
  • Call and exit should be compatible with:
    (basic_props:term/1)Constant is any term.
    (sqltypes:sqltype/1)Type is an SQL data type supported by the translator.
  • The following properties should hold at call time:
    (term_typing:nonvar/1)Constant is currently a term which is not a free variable.

PREDICATE

Usage: type_compatible(TypeA,TypeB)

  • Description: Checks if TypeA and TypeB are compatible types, i.e., they are the same or one is a subtype of the other.
  • Call and exit should be compatible with:
    (sqltypes:sqltype/1)TypeA is an SQL data type supported by the translator.
    (sqltypes:sqltype/1)TypeB is an SQL data type supported by the translator.

PREDICATE

Usage: type_union(TypeA,TypeB,Union)

  • Description: Union is the union type of TypeA and TypeB.
  • Call and exit should be compatible with:
    (sqltypes:sqltype/1)TypeA is an SQL data type supported by the translator.
    (sqltypes:sqltype/1)TypeB is an SQL data type supported by the translator.
    (sqltypes:sqltype/1)Union is an SQL data type supported by the translator.

REGTYPE
SQL datatypes supported by Sybase for which a translation is defined:

sybasetype(integer).
sybasetype(numeric).
sybasetype(float).
sybasetype(double).
sybasetype(date).
sybasetype(char).
sybasetype(varchar).
sybasetype('long varchar').
sybasetype(binary).
sybasetype('long binary').
sybasetype(timestamp).
sybasetype(time).
sybasetype(tinyint).

Usage: sybasetype(Type)

  • Description: Type is an SQL data type supported by Sybase.

PREDICATE

Usage: sybase2sqltypes_list(SybaseTypesList,SQLTypesList)

  • Description: SybaseTypesList is a list of Sybase SQL types. PrologTypesList contains their equivalent SQL-type names in CIAO.
  • The following properties should hold upon exit:
    (basic_props:list/1)SybaseTypesList is a list.
    (basic_props:list/1)SQLTypesList is a list.

PREDICATE

Usage: sybase2sqltype(SybaseType,SQLType)

  • Description: SybaseType is a Sybase SQL type name, and SQLType is its equivalent SQL-type name in CIAO.
  • The following properties should hold upon exit:
    (sqltypes:sybasetype/1)SybaseType is an SQL data type supported by Sybase.
    (sqltypes:sqltype/1)SQLType is an SQL data type supported by the translator.

REGTYPE
SQL datatypes supported by postgreSQL for which a translation is defined:

postgrestype(int2).
postgrestype(int4).
postgrestype(int8).
postgrestype(float4).
postgrestype(float8).
postgrestype(date).
postgrestype(timestamp).
postgrestype(time).
postgrestype(char).
postgrestype(varchar).
postgrestype(text).
postgrestype(bool).

Usage: postgrestype(Type)

  • Description: Type is an SQL data type supported by postgres.

PREDICATE

Usage: postgres2sqltypes_list(PostgresTypesList,SQLTypesList)

  • Description: PostgresTypesList is a list of postgres SQL types. PrologTypesList contains their equivalent SQL-type names in CIAO.
  • The following properties should hold upon exit:
    (basic_props:list/1)PostgresTypesList is a list.
    (basic_props:list/1)SQLTypesList is a list.

PREDICATE

Usage: postgres2sqltype(PostgresType,SQLType)

  • Description: PostgresType is a postgres SQL type name, and SQLType is its equivalent SQL-type name in CIAO.
  • The following properties should hold upon exit:
    (sqltypes:postgrestype/1)PostgresType is an SQL data type supported by postgres.
    (sqltypes:sqltype/1)SQLType is an SQL data type supported by the translator.