![HP NonStop SQL/MP Скачать руководство пользователя страница 255](http://html.mh-extra.com/html/hp/nonstop-sql-mp/nonstop-sql-mp_programming-manual_165149255.webp)
Dynamic SQL Operations
HP NonStop SQL/MP Programming Manual for C—429847-008
10-57
Detailed Dynamic SQL Program
787 sqlda->sqlvar[i].data_len = sqlda->sqlvar[i].data_len & 0377;
788
789
790 break;
791
792 /* ---------------------------------------------------- */
793 /* DECIMAL is supported; if your database has DECIMAL */
794 /* items, you might not want to translate to 32-bit */
795 /* integers as this program does
796 case _SQLDT_DEC_U : /* DECIMAL unsigned */
797
798 /* The following types are unsupported: */
799 case _SQLDT_DEC_LSS : /* DECIMAL LSS */
800 case _SQLDT_DEC_LSE : /* DECIMAL LSE */
801 case _SQLDT_DEC_TSS : /* DECIMAL TSS */
802 case _SQLDT_DEC_TSE : /* DECIMAL TSE */
803
804 /*-------------------------------------------- */
805 /* Map to _SQLDT_32BIT_S type */
806 /* Length info must be set to 4 bytes for */
807 /* scale information to be set to 0 */
808 /* Note: for DECIMAL, you might want to save */
809 /* the scale information instead of setting */
810 /* to zero as this program does */
811 /*-------------------------------------------- */
812 sqlda->sqlvar[i].data_type = _SQLDT_32BIT_S;
813 sqlda->sqlvar[i].data_len = 4; /* and scale is 0 */
814
815 break;
816
817 /* ---------------------------------------------------- */
818 default: /* UNSUPPORTED types or do not need adjustments */
819
820 break; /* (Nothing to be done) */
821
822 /* ---------------------------------------------------- */
823 } /* switch stmt */
824
825 } /* for loop */
826
827 return (0);
828
829 } /* end adjust_sqlda_scale_types
831
832 /* *************************************************** */
833 /* FUNCTION setupvarbuffers */
834 /* This function takes an SQLDA as a parameter and, */
835 /* for sqlda.num_entries, allocates the data buffers */
836 /* for appropriate lengths. For each sqlvar, */
837 /* sqlda.sqlvar[i].var_ptr is set to point to that */
838 /* buffer */
839 /* */
840 /* The sqlda is also changed by altering unsupported */
841 /* data types to the nearest equivalent data types */
842 /* and by setting scale information to 0 */
843 /* */
844 /* sqlda.num_entries is assumed to have a valid value. */
845 /* */
846 /* Return: 0 if successful */
847 /* -1 if failure */
848 /* */
849
Example 10-8. Detailed Dynamic SQL Program
(page 14 of 22)
Содержание NonStop SQL/MP
Страница 4: ......
Страница 14: ...Contents HP NonStop SQL MP Programming Manual for C 429847 008 x ...
Страница 34: ...Introduction HP NonStop SQL MP Programming Manual for C 429847 008 1 8 SQL MP Version Management ...
Страница 60: ...Host Variables HP NonStop SQL MP Programming Manual for C 429847 008 2 26 VARCHAR Data Type ...
Страница 68: ...SQL MP Statements and Directives HP NonStop SQL MP Programming Manual for C 429847 008 3 8 Finding Information ...
Страница 156: ...Explicit Program Compilation HP NonStop SQL MP Programming Manual for C 429847 008 6 40 SQL Program Files ...
Страница 264: ...Dynamic SQL Operations HP NonStop SQL MP Programming Manual for C 429847 008 10 66 Detailed Dynamic SQL Program ...
Страница 294: ...SQL MP Sample Database HP NonStop SQL MP Programming Manual for C 429847 008 A 6 ...
Страница 300: ...Memory Considerations HP NonStop SQL MP Programming Manual for C 429847 008 B 6 Avoiding Memory Stack Overflows ...
Страница 304: ...Maximizing Local Autonomy HP NonStop SQL MP Programming Manual for C 429847 008 C 4 Skipping Unavailable Partitions ...