| 785 | // |
| 786 | |
| 787 | static void gen_based( const act* action, int column) |
| 788 | { |
| 789 | USHORT datatype; |
| 790 | SLONG length = -1; |
| 791 | |
| 792 | align(column); |
| 793 | bas* based_on = (bas*) action->act_object; |
| 794 | const gpre_fld* field = based_on->bas_field; |
| 795 | |
| 796 | if (based_on->bas_flags & BAS_segment) |
| 797 | { |
| 798 | datatype = gpreGlob.sw_cstring ? dtype_cstring : dtype_text; |
| 799 | if (!(length = field->fld_seg_length)) |
| 800 | length = 256; |
| 801 | if (datatype == dtype_cstring) |
| 802 | length++; |
| 803 | } |
| 804 | else if (field->fld_array_info) |
| 805 | datatype = field->fld_array_info->ary_dtype; |
| 806 | else |
| 807 | datatype = field->fld_dtype; |
| 808 | |
| 809 | switch (datatype) |
| 810 | { |
| 811 | case dtype_short: |
| 812 | fprintf(gpreGlob.out_file, "short"); |
| 813 | break; |
| 814 | |
| 815 | case dtype_long: |
| 816 | fprintf(gpreGlob.out_file, DCL_LONG); |
| 817 | break; |
| 818 | |
| 819 | case dtype_quad: |
| 820 | fprintf(gpreGlob.out_file, DCL_QUAD); |
| 821 | break; |
| 822 | |
| 823 | // Begin date/time/timestamp |
| 824 | case dtype_sql_date: |
| 825 | fprintf(gpreGlob.out_file, "ISC_DATE"); |
| 826 | break; |
| 827 | |
| 828 | case dtype_sql_time: |
| 829 | fprintf(gpreGlob.out_file, "ISC_TIME"); |
| 830 | break; |
| 831 | |
| 832 | case dtype_timestamp: |
| 833 | fprintf(gpreGlob.out_file, "ISC_TIMESTAMP"); |
| 834 | break; |
| 835 | // End date/time/timestamp |
| 836 | |
| 837 | case dtype_int64: |
| 838 | fprintf(gpreGlob.out_file, "ISC_INT64"); |
| 839 | break; |
| 840 | |
| 841 | case dtype_blob: |
| 842 | fprintf(gpreGlob.out_file, "ISC_QUAD"); |
| 843 | break; |
| 844 |
no test coverage detected