These figures show the valid syntax for host structure declarations.
>>-+--------+--+----------+--+---------+--struct--+-----+--{----> +-auto---+ +-const----+ '-_Packed-' '-tag-' +-extern-+ '-volatile-' '-static-' .----------------------------------------------------------------. | .-,-----. | V V | | >----+-+-float----------------------------------+----var-1-+-- ; -+-+--}--> | +-double---------------------------------+ | | +-decimal (--precision--+----------+--)--+ | | | '-,--scale-' | | | | .-int-. | | | +-+-+--------+--+-long long-+--+-----+-+-+ | | | | '-signed-' +-long------+ | | | | | | '-short-----' | | | | | +-sqlint32---------------------------+ | | | | '-sqlint64---------------------------' | | | +-varchar-structure----------------------+ | | +-vargraphic-structure-------------------+ | | +-lob------------------------------------+ | | +-SQL-varchar----------------------------+ | | +-rowid----------------------------------+ | | '-binary---------------------------------' | | .-,-----------------------. | | V | | +-+----------+--char----var-2--+--------------+-+-- ; -------+ | +-signed---+ '-[--length--]-' | | '-unsigned-' | | .-,-----------------------. | | V | | '-wchar_t----var-5--+--------------+-+-- ; ------------------' '-[--length--]-' .-,----------------------------------. V | >----variable-name--+-----------------+-+-- ; ----------------->< '- = --expression-' varchar-structure .-int-. |--struct--+-----+--{--+--------+--short--+-----+--var-3-- ; ---> '-tag-' '-signed-' >--+----------+--char--var-4--[--length--]-- ; --}--------------| +-signed---+ '-unsigned-'
vargraphic-structure .-int-. |--struct--+-----+--{--+--------+--short--+-----+---------------> '-tag-' '-signed-' >--var-6-- ; --wchar_t--var-7--[--length--]-- ; --}-------------| lob |--SQL TYPE IS--+-+-CLOB---+--(--length--+---+--)-+-------------| | +-DBCLOB-+ +-K-+ | | '-BLOB---' +-M-+ | | '-G-' | +-+-CLOB_LOCATOR---+--------------+ | +-DBCLOB_LOCATOR-+ | | '-BLOB_LOCATOR---' | '-+-CLOB_FILE---+-----------------' +-DBCLOB_FILE-+ '-BLOB_FILE---' SQL-varchar |--VARCHAR--variable-name--[--length--]-------------------------| rowid |--SQL TYPE IS ROWID--------------------------------------------| binary |--SQL TYPE IS--+-BINARY---------+--(--length--)----------------| +-VARBINARY------+ '-BINARY VARYING-'
#pragma pack(1) struct { short myshort; long mylong; char mychar[5]; } a_st; #pragma pack()