484:
485: /* This dynamic sql is trying to create entries in plsql tables
486: ** bindvarsX bindvalsX
487: ** to facilitate the dynamic binding of variables: For example:
488: ** dbms_sql.bind_variable(DSQL_c1, 'cr_segment1_bind', cr.segment1);
489: ** The code fragment here mimics the code in INVPUTLI.get_dynamic_sql_str()
490: */
491:
492: for n in 1..totalsegs loop
749: ** l_item_id_bind gets l_item_id
750: ** Now, open cursor DSQL_c1, parse it and bind the variables
751: */
752:
753: DSQL_c1 := dbms_sql.open_cursor;
754: dbms_sql.parse(DSQL_c1, DSQL_statement1, dbms_sql.native);
755: dbms_sql.define_column(DSQL_c1, 1, DSQL_inventory_item_id);
756: dbms_sql.bind_variable(DSQL_c1, 'organization_id_bind',
757: cr.organization_id);
750: ** Now, open cursor DSQL_c1, parse it and bind the variables
751: */
752:
753: DSQL_c1 := dbms_sql.open_cursor;
754: dbms_sql.parse(DSQL_c1, DSQL_statement1, dbms_sql.native);
755: dbms_sql.define_column(DSQL_c1, 1, DSQL_inventory_item_id);
756: dbms_sql.bind_variable(DSQL_c1, 'organization_id_bind',
757: cr.organization_id);
758: dbms_sql.bind_variable(DSQL_c1, 'l_item_id_bind', l_item_id);
751: */
752:
753: DSQL_c1 := dbms_sql.open_cursor;
754: dbms_sql.parse(DSQL_c1, DSQL_statement1, dbms_sql.native);
755: dbms_sql.define_column(DSQL_c1, 1, DSQL_inventory_item_id);
756: dbms_sql.bind_variable(DSQL_c1, 'organization_id_bind',
757: cr.organization_id);
758: dbms_sql.bind_variable(DSQL_c1, 'l_item_id_bind', l_item_id);
759:
752:
753: DSQL_c1 := dbms_sql.open_cursor;
754: dbms_sql.parse(DSQL_c1, DSQL_statement1, dbms_sql.native);
755: dbms_sql.define_column(DSQL_c1, 1, DSQL_inventory_item_id);
756: dbms_sql.bind_variable(DSQL_c1, 'organization_id_bind',
757: cr.organization_id);
758: dbms_sql.bind_variable(DSQL_c1, 'l_item_id_bind', l_item_id);
759:
760: /* The following is to facilitate the dynamic binding
754: dbms_sql.parse(DSQL_c1, DSQL_statement1, dbms_sql.native);
755: dbms_sql.define_column(DSQL_c1, 1, DSQL_inventory_item_id);
756: dbms_sql.bind_variable(DSQL_c1, 'organization_id_bind',
757: cr.organization_id);
758: dbms_sql.bind_variable(DSQL_c1, 'l_item_id_bind', l_item_id);
759:
760: /* The following is to facilitate the dynamic binding
761: ** of the where clause variables:
762: ** dbms_sql.bind_variable(DSQL_c1,
758: dbms_sql.bind_variable(DSQL_c1, 'l_item_id_bind', l_item_id);
759:
760: /* The following is to facilitate the dynamic binding
761: ** of the where clause variables:
762: ** dbms_sql.bind_variable(DSQL_c1,
763: ** 'cr_segment1_bind', cr.segment1);
764: ** The PL/SQL tables bindvars1 and bindvals1 have alreadey
765: ** been populated before.
766: */
771: INVPUTLI.info('INVPVHDR: BIND values ' ||
772: bindvars1(n)||' gets '|| bindvals1(n));
773: END IF;
774:
775: dbms_sql.bind_variable(DSQL_c1, bindvars1(n), bindvals1(n) );
776:
777: EXCEPTION
778: when others then
779: err_text:= substr('validate_item_header DSQL 1'|| SQLERRM, 1, 240);
783: end loop;
784:
785:
786: Begin
787: DSQL_rows_processed := dbms_sql.execute(DSQL_c1);
788: Exception
789: when others then
790: err_text:= substr('validate_item_header DSQL 2'|| SQLERRM , 1, 240) ;
791: return(SQLCODE);
814: ** returned from the MSI table because of the distinct
815: ** clause
816: */
817:
818: if dbms_sql.fetch_rows(DSQL_c1) > 0 then /* BIG If*/
819:
820: Begin
821: dbms_sql.column_value(DSQL_c1,1,DSQL_inventory_item_id);
822:
817:
818: if dbms_sql.fetch_rows(DSQL_c1) > 0 then /* BIG If*/
819:
820: Begin
821: dbms_sql.column_value(DSQL_c1,1,DSQL_inventory_item_id);
822:
823: dup_item_id := DSQL_inventory_item_id;
824:
825: update mtl_system_items_interface
837: raise VALIDATE_ERR;
838: End;
839:
840: else /*The cursor DSQL_c1 fetched no rows at all*/
841: dbms_sql.close_cursor(DSQL_c1);
842: IF l_inv_debug_level IN(101, 102) THEN
843: INVPUTLI.info('INVPVHDR: entering DSQL2 ');
844: END IF;
845:
871: and set_process_id = :xset_id_bind
872: and msii.organization_id = mp.organization_id + 0
873: and ' || statement_temp2;
874:
875: DSQL_c2 := dbms_sql.open_cursor;
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
872: and msii.organization_id = mp.organization_id + 0
873: and ' || statement_temp2;
874:
875: DSQL_c2 := dbms_sql.open_cursor;
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
873: and ' || statement_temp2;
874:
875: DSQL_c2 := dbms_sql.open_cursor;
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
881: dbms_sql.bind_variable(DSQL_c2, 'xset_id_bind', xset_id);
874:
875: DSQL_c2 := dbms_sql.open_cursor;
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
881: dbms_sql.bind_variable(DSQL_c2, 'xset_id_bind', xset_id);
882:
875: DSQL_c2 := dbms_sql.open_cursor;
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
881: dbms_sql.bind_variable(DSQL_c2, 'xset_id_bind', xset_id);
882:
883: for n in 1..totalsegs loop
876: dbms_sql.parse(DSQL_c2, DSQL_statement2, dbms_sql.native);
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
881: dbms_sql.bind_variable(DSQL_c2, 'xset_id_bind', xset_id);
882:
883: for n in 1..totalsegs loop
884: BEGIN
877: dbms_sql.define_column(DSQL_c2, 1, DSQL2_inventory_item_id);
878: dbms_sql.define_column(DSQL_c2, 2, DSQL2_transaction_id);
879: dbms_sql.define_column(DSQL_c2, 3, DSQL2_organization_id);
880: dbms_sql.bind_variable(DSQL_c2, 'l_item_id_bind', l_item_id);
881: dbms_sql.bind_variable(DSQL_c2, 'xset_id_bind', xset_id);
882:
883: for n in 1..totalsegs loop
884: BEGIN
885: IF l_inv_debug_level IN(101, 102) THEN
886: INVPUTLI.info('INVPVHDR: BIND2 values ' ||
887: bindvars1(n)||' gets '|| bindvals1(n));
888: END IF;
889:
890: dbms_sql.bind_variable(DSQL_c2, bindvars1(n), bindvals1(n) );
891: EXCEPTION
892: when others then
893: err_text:= substr('validate_item_header DSQL 2'|| SQLERRM , 1, 240);
894: return(SQLCODE);
895: END;
896: end loop;
897:
898: begin
899: DSQL_rows_processed := dbms_sql.execute(DSQL_c2);
900: exception
901: when others then
902: err_text:= substr('validate_item_header DSQL 2.2'|| SQLERRM , 1, 240);
903: return(SQLCODE);
903: return(SQLCODE);
904: end;
905:
906: loop
907: if dbms_sql.fetch_rows(DSQL_c2) > 0 then
908: dbms_sql.column_value(DSQL_c2, 1, DSQL2_inventory_item_id);
909: dbms_sql.column_value(DSQL_c2, 2, DSQL2_transaction_id);
910: dbms_sql.column_value(DSQL_c2, 3, DSQL2_organization_id);
911:
904: end;
905:
906: loop
907: if dbms_sql.fetch_rows(DSQL_c2) > 0 then
908: dbms_sql.column_value(DSQL_c2, 1, DSQL2_inventory_item_id);
909: dbms_sql.column_value(DSQL_c2, 2, DSQL2_transaction_id);
910: dbms_sql.column_value(DSQL_c2, 3, DSQL2_organization_id);
911:
912:
905:
906: loop
907: if dbms_sql.fetch_rows(DSQL_c2) > 0 then
908: dbms_sql.column_value(DSQL_c2, 1, DSQL2_inventory_item_id);
909: dbms_sql.column_value(DSQL_c2, 2, DSQL2_transaction_id);
910: dbms_sql.column_value(DSQL_c2, 3, DSQL2_organization_id);
911:
912:
913: /* update item header with new item id
906: loop
907: if dbms_sql.fetch_rows(DSQL_c2) > 0 then
908: dbms_sql.column_value(DSQL_c2, 1, DSQL2_inventory_item_id);
909: dbms_sql.column_value(DSQL_c2, 2, DSQL2_transaction_id);
910: dbms_sql.column_value(DSQL_c2, 3, DSQL2_organization_id);
911:
912:
913: /* update item header with new item id
914: ** This is for updating the III for similar
962: and set_process_id + 0 = xset_id;
963:
964: else
965: -- no more rows, Close cursor and exit
966: dbms_sql.close_cursor(DSQL_c2);
967: exit;
968: end if;
969: end loop;
970: EXCEPTION
968: end if;
969: end loop;
970: EXCEPTION
971: WHEN NO_DATA_FOUND THEN
972: if dbms_sql.is_open(DSQL_c2) then
973: dbms_sql.close_cursor(DSQL_c2);
974: end if;
975: WHEN OTHERS THEN
976: if dbms_sql.is_open(DSQL_c2) then
969: end loop;
970: EXCEPTION
971: WHEN NO_DATA_FOUND THEN
972: if dbms_sql.is_open(DSQL_c2) then
973: dbms_sql.close_cursor(DSQL_c2);
974: end if;
975: WHEN OTHERS THEN
976: if dbms_sql.is_open(DSQL_c2) then
977: dbms_sql.close_cursor(DSQL_c2);
972: if dbms_sql.is_open(DSQL_c2) then
973: dbms_sql.close_cursor(DSQL_c2);
974: end if;
975: WHEN OTHERS THEN
976: if dbms_sql.is_open(DSQL_c2) then
977: dbms_sql.close_cursor(DSQL_c2);
978: end if;
979: err_text:= substr('validate_item_header DSQL STMT2 '|| SQLERRM , 1,240) ;
980: return(SQLCODE);
973: dbms_sql.close_cursor(DSQL_c2);
974: end if;
975: WHEN OTHERS THEN
976: if dbms_sql.is_open(DSQL_c2) then
977: dbms_sql.close_cursor(DSQL_c2);
978: end if;
979: err_text:= substr('validate_item_header DSQL STMT2 '|| SQLERRM , 1,240) ;
980: return(SQLCODE);
981: END; /*PLSQL Block 2 (inside block 1)*/
982:
983:
984: end if; /*BIG if from BLOCK 1*/
985:
986: if dbms_sql.is_open(DSQL_c1) then
987: dbms_sql.close_cursor(DSQL_c1);
988: end if;
989:
990: EXCEPTION
983:
984: end if; /*BIG if from BLOCK 1*/
985:
986: if dbms_sql.is_open(DSQL_c1) then
987: dbms_sql.close_cursor(DSQL_c1);
988: end if;
989:
990: EXCEPTION
991:
989:
990: EXCEPTION
991:
992: WHEN NO_DATA_FOUND THEN
993: if dbms_sql.is_open(DSQL_c1) then
994: dbms_sql.close_cursor(DSQL_c1);
995: end if;
996: WHEN OTHERS THEN
997: if dbms_sql.is_open(DSQL_c1) then
990: EXCEPTION
991:
992: WHEN NO_DATA_FOUND THEN
993: if dbms_sql.is_open(DSQL_c1) then
994: dbms_sql.close_cursor(DSQL_c1);
995: end if;
996: WHEN OTHERS THEN
997: if dbms_sql.is_open(DSQL_c1) then
998: dbms_sql.close_cursor(DSQL_c1);
993: if dbms_sql.is_open(DSQL_c1) then
994: dbms_sql.close_cursor(DSQL_c1);
995: end if;
996: WHEN OTHERS THEN
997: if dbms_sql.is_open(DSQL_c1) then
998: dbms_sql.close_cursor(DSQL_c1);
999: end if;
1000: err_text:= substr('validate_item_header DSQL STMT1'|| SQLERRM , 1,240);
1001: return(SQLCODE);
994: dbms_sql.close_cursor(DSQL_c1);
995: end if;
996: WHEN OTHERS THEN
997: if dbms_sql.is_open(DSQL_c1) then
998: dbms_sql.close_cursor(DSQL_c1);
999: end if;
1000: err_text:= substr('validate_item_header DSQL STMT1'|| SQLERRM , 1,240);
1001: return(SQLCODE);
1002:
1122: where organization_id = :organization_id_bind
1123: and :transaction_type_bind = ''CREATE''
1124: and ' || statement_temp3;
1125:
1126: DSQL_c3 := dbms_sql.open_cursor;
1127: dbms_sql.parse(DSQL_c3, DSQL_statement3, dbms_sql.native);
1128: dbms_sql.define_column(DSQL_c3, 1, DSQL_count_star);
1129:
1130: /* Now bind the variables*/
1123: and :transaction_type_bind = ''CREATE''
1124: and ' || statement_temp3;
1125:
1126: DSQL_c3 := dbms_sql.open_cursor;
1127: dbms_sql.parse(DSQL_c3, DSQL_statement3, dbms_sql.native);
1128: dbms_sql.define_column(DSQL_c3, 1, DSQL_count_star);
1129:
1130: /* Now bind the variables*/
1131: dbms_sql.bind_variable(DSQL_c3, 'organization_id_bind',
1124: and ' || statement_temp3;
1125:
1126: DSQL_c3 := dbms_sql.open_cursor;
1127: dbms_sql.parse(DSQL_c3, DSQL_statement3, dbms_sql.native);
1128: dbms_sql.define_column(DSQL_c3, 1, DSQL_count_star);
1129:
1130: /* Now bind the variables*/
1131: dbms_sql.bind_variable(DSQL_c3, 'organization_id_bind',
1132: cr.organization_id);
1127: dbms_sql.parse(DSQL_c3, DSQL_statement3, dbms_sql.native);
1128: dbms_sql.define_column(DSQL_c3, 1, DSQL_count_star);
1129:
1130: /* Now bind the variables*/
1131: dbms_sql.bind_variable(DSQL_c3, 'organization_id_bind',
1132: cr.organization_id);
1133: dbms_sql.bind_variable(DSQL_c3, 'transaction_type_bind',
1134: cr.transaction_type);
1135: /*
1129:
1130: /* Now bind the variables*/
1131: dbms_sql.bind_variable(DSQL_c3, 'organization_id_bind',
1132: cr.organization_id);
1133: dbms_sql.bind_variable(DSQL_c3, 'transaction_type_bind',
1134: cr.transaction_type);
1135: /*
1136: ** The following binding for
1137: ** DSQL_c3 is exactly the same as for DSQL_c1
1140: */
1141:
1142: for n in 1..totalsegs loop
1143: BEGIN
1144: dbms_sql.bind_variable(DSQL_c3, bindvars1(n), bindvals1(n) );
1145: EXCEPTION
1146: when others then
1147: err_text:= substr('validate_item_header DSQL 1.1'|| SQLERRM , 1, 240);
1148: return(SQLCODE);
1149: END;
1150: end loop;
1151:
1152: BEGIN
1153: DSQL_rows_processed := dbms_sql.execute(DSQL_c3);
1154: EXCEPTION
1155: when others then
1156: err_text:= substr('validate_item_header DSQL 1.2'|| SQLERRM , 1, 240);
1157: return(SQLCODE);
1157: return(SQLCODE);
1158: END;
1159:
1160: ext_flag := 0;
1161: if dbms_sql.fetch_rows(DSQL_c3) > 0 then
1162: dbms_sql.column_value(DSQL_c3,1,DSQL_count_star);
1163: ext_flag := DSQL_count_star;
1164: else
1165: dbms_sql.close_cursor(DSQL_c3);
1158: END;
1159:
1160: ext_flag := 0;
1161: if dbms_sql.fetch_rows(DSQL_c3) > 0 then
1162: dbms_sql.column_value(DSQL_c3,1,DSQL_count_star);
1163: ext_flag := DSQL_count_star;
1164: else
1165: dbms_sql.close_cursor(DSQL_c3);
1166: end if;
1161: if dbms_sql.fetch_rows(DSQL_c3) > 0 then
1162: dbms_sql.column_value(DSQL_c3,1,DSQL_count_star);
1163: ext_flag := DSQL_count_star;
1164: else
1165: dbms_sql.close_cursor(DSQL_c3);
1166: end if;
1167:
1168: if dbms_sql.is_open(DSQL_c3) then
1169: dbms_sql.close_cursor(DSQL_c3);
1164: else
1165: dbms_sql.close_cursor(DSQL_c3);
1166: end if;
1167:
1168: if dbms_sql.is_open(DSQL_c3) then
1169: dbms_sql.close_cursor(DSQL_c3);
1170: end if;
1171:
1172:
1165: dbms_sql.close_cursor(DSQL_c3);
1166: end if;
1167:
1168: if dbms_sql.is_open(DSQL_c3) then
1169: dbms_sql.close_cursor(DSQL_c3);
1170: end if;
1171:
1172:
1173: EXCEPTION
1171:
1172:
1173: EXCEPTION
1174: WHEN OTHERS THEN
1175: if dbms_sql.is_open(DSQL_c3) then
1176: dbms_sql.close_cursor(DSQL_c3);
1177: end if;
1178: err_text:= substr('validate_item_header DSQL STMT3'|| SQLERRM , 1,240);
1179: return(SQLCODE);
1172:
1173: EXCEPTION
1174: WHEN OTHERS THEN
1175: if dbms_sql.is_open(DSQL_c3) then
1176: dbms_sql.close_cursor(DSQL_c3);
1177: end if;
1178: err_text:= substr('validate_item_header DSQL STMT3'|| SQLERRM , 1,240);
1179: return(SQLCODE);
1180:
1234: **where organization_id = cr.organization_id
1235: **and nvl(msii.segment1, '.') = nvl(cr.segment1,'.');
1236: **and so on......
1237: ** intermediate step: ...... = nvl(:cr_segment1_bind, '.')
1238: ** and so on., and then use dbms_sql.bind_variable to bind the
1239: ** values to the cursor DSQL_c4
1240: ** 03MAY96 Added xset_id processing to this dynamic sql stmt.
1241: */
1242:
1246: and set_process_id = :xset_id_bind
1247: and process_flag = 2
1248: and ' || statement_temp4;
1249:
1250: DSQL_c4 := dbms_sql.open_cursor;
1251: dbms_sql.parse(DSQL_c4, DSQL_statement4, dbms_sql.native);
1252: dbms_sql.define_column(DSQL_c4, 1, DSQL_count_star);
1253: dbms_sql.bind_variable(DSQL_c4, 'xset_id_bind', xset_id);
1254: dbms_sql.bind_variable(DSQL_c4, 'organization_id_bind',
1247: and process_flag = 2
1248: and ' || statement_temp4;
1249:
1250: DSQL_c4 := dbms_sql.open_cursor;
1251: dbms_sql.parse(DSQL_c4, DSQL_statement4, dbms_sql.native);
1252: dbms_sql.define_column(DSQL_c4, 1, DSQL_count_star);
1253: dbms_sql.bind_variable(DSQL_c4, 'xset_id_bind', xset_id);
1254: dbms_sql.bind_variable(DSQL_c4, 'organization_id_bind',
1255: cr.organization_id);
1248: and ' || statement_temp4;
1249:
1250: DSQL_c4 := dbms_sql.open_cursor;
1251: dbms_sql.parse(DSQL_c4, DSQL_statement4, dbms_sql.native);
1252: dbms_sql.define_column(DSQL_c4, 1, DSQL_count_star);
1253: dbms_sql.bind_variable(DSQL_c4, 'xset_id_bind', xset_id);
1254: dbms_sql.bind_variable(DSQL_c4, 'organization_id_bind',
1255: cr.organization_id);
1256:
1249:
1250: DSQL_c4 := dbms_sql.open_cursor;
1251: dbms_sql.parse(DSQL_c4, DSQL_statement4, dbms_sql.native);
1252: dbms_sql.define_column(DSQL_c4, 1, DSQL_count_star);
1253: dbms_sql.bind_variable(DSQL_c4, 'xset_id_bind', xset_id);
1254: dbms_sql.bind_variable(DSQL_c4, 'organization_id_bind',
1255: cr.organization_id);
1256:
1257: /*
1250: DSQL_c4 := dbms_sql.open_cursor;
1251: dbms_sql.parse(DSQL_c4, DSQL_statement4, dbms_sql.native);
1252: dbms_sql.define_column(DSQL_c4, 1, DSQL_count_star);
1253: dbms_sql.bind_variable(DSQL_c4, 'xset_id_bind', xset_id);
1254: dbms_sql.bind_variable(DSQL_c4, 'organization_id_bind',
1255: cr.organization_id);
1256:
1257: /*
1258: ** The following binding for
1262: */
1263:
1264: for n in 1..totalsegs loop
1265: begin
1266: dbms_sql.bind_variable(DSQL_c4, bindvars1(n), bindvals1(n) );
1267: exception
1268: when others then
1269: err_text:= substr('validate_item_header DSQL 4.1'|| SQLERRM,1,240);
1270: return(SQLCODE);
1271: end;
1272: end loop;
1273:
1274: begin
1275: DSQL_rows_processed := dbms_sql.execute(DSQL_c4);
1276: exception
1277: when others then
1278: err_text:= substr('validate_item_header DSQL 4.2'|| SQLERRM , 1 , 240);
1279: return(SQLCODE);
1279: return(SQLCODE);
1280: end;
1281:
1282: ext_flag := 0;
1283: if dbms_sql.fetch_rows(DSQL_c4) > 0 then
1284: dbms_sql.column_value(DSQL_c4,1,DSQL_count_star);
1285: ext_flag := DSQL_count_star;
1286:
1287: else
1280: end;
1281:
1282: ext_flag := 0;
1283: if dbms_sql.fetch_rows(DSQL_c4) > 0 then
1284: dbms_sql.column_value(DSQL_c4,1,DSQL_count_star);
1285: ext_flag := DSQL_count_star;
1286:
1287: else
1288: dbms_sql.close_cursor(DSQL_c4);
1284: dbms_sql.column_value(DSQL_c4,1,DSQL_count_star);
1285: ext_flag := DSQL_count_star;
1286:
1287: else
1288: dbms_sql.close_cursor(DSQL_c4);
1289: end if;
1290:
1291: if dbms_sql.is_open(DSQL_c4) then
1292: dbms_sql.close_cursor(DSQL_c4);
1287: else
1288: dbms_sql.close_cursor(DSQL_c4);
1289: end if;
1290:
1291: if dbms_sql.is_open(DSQL_c4) then
1292: dbms_sql.close_cursor(DSQL_c4);
1293: end if;
1294:
1295: EXCEPTION
1288: dbms_sql.close_cursor(DSQL_c4);
1289: end if;
1290:
1291: if dbms_sql.is_open(DSQL_c4) then
1292: dbms_sql.close_cursor(DSQL_c4);
1293: end if;
1294:
1295: EXCEPTION
1296: WHEN OTHERS THEN
1293: end if;
1294:
1295: EXCEPTION
1296: WHEN OTHERS THEN
1297: if dbms_sql.is_open(DSQL_c4) then
1298: dbms_sql.close_cursor(DSQL_c4);
1299: dbms_sql.close_cursor(DSQL_c4);
1300: end if;
1301: err_text:= substr('validate_item_header DSQL STMT4'|| SQLERRM , 1,240);
1294:
1295: EXCEPTION
1296: WHEN OTHERS THEN
1297: if dbms_sql.is_open(DSQL_c4) then
1298: dbms_sql.close_cursor(DSQL_c4);
1299: dbms_sql.close_cursor(DSQL_c4);
1300: end if;
1301: err_text:= substr('validate_item_header DSQL STMT4'|| SQLERRM , 1,240);
1302: return(SQLCODE);
1295: EXCEPTION
1296: WHEN OTHERS THEN
1297: if dbms_sql.is_open(DSQL_c4) then
1298: dbms_sql.close_cursor(DSQL_c4);
1299: dbms_sql.close_cursor(DSQL_c4);
1300: end if;
1301: err_text:= substr('validate_item_header DSQL STMT4'|| SQLERRM , 1,240);
1302: return(SQLCODE);
1303: