na-google na nimo ang Error code?
how did you get that error bro? and try to find your steps in creating that error.
>1. What version of PB?
>Answer: PB 10.5.2
>2. Classic or .NET?
>Answer: Classic
>3. What are the connection properties of SQLCA (including DBMS and especially DBParm)?
>Answer: SQLCA.DBMS = "ODBC" SQLCA.AutoCommit = False SQLCA.DBParm = "ConnectString='DSN=TPIDB-PPRO;UID=;PWD='"
>4. Is this the SELECT statement from a DW or inline SQL from PowerScript?
>Answer : from a DW
>Can you please post the entire SELECT statement?
>Answer :
> SELECT distinct dbo.t_wo_components.item_number,
> dbo.t_wo_components.site,
> dbo.t_wo_components.wo_number,
> dbo.t_item_master.item_desc,
> --qty_required = dbo.t_wo_components.qty_required,
> qty_required = case wo_status
> when 'P' then dbo.t_wo_components.qty_required * dbo.t_wo_components.unit_conv
> else dbo.t_wo_components.qty_required
> end,
> dbo.t_wo_components.production_term,
> dbo.t_production_order_detail.item_number,
>
> -- qty_on_order = (select sum(dbo.t_po_rec_qty_on_order_dummy.qty_on_order)
> -- from dbo.t_po_rec_qty_on_order_dummy
> -- where dbo.t_po_rec_qty_on_order_dummy.item_number = dbo.t_wo_components.item_number ),
> qty_on_order = IsNull(dbo.t_po_rec_qty_on_order_dummy.qty_on_orde r, 0),
>
> dbo.t_item_master.abbr_desc,
> dbo.t_wo_components.seiban_number,
> dbo.t_production_order_detail.qty_ordered,
>
> qty_on_hand = isnull((select sum(t_item_ledger.qty_on_hand) from t_item_ledger where t_item_ledger.item_number = t_wo_components.item_number and
> t_item_ledger.site = t_wo_components.site),0),
>
> dbo.t_wo_header.wo_status,
> dbo.t_item_master.um,
> dbo.t_pec_struc.vendor,
> dbo.t_wo_components.Repro_ref_wono,
> Form_type=(select top 1 form_type from t_supplier where t_supplier.supp_alias_2 = t_pec_struc.vendor),
> dbo.t_item_master.safety_stock,
> dbo.t_wo_components.unit_conv,
> dbo.t_pec_struc.tpi_opr_where_used,
> dbo.t_wo_components.qty_per,
> dbo.t_pec_struc.qty_per,
> dbo.t_wo_product.qty_ordered,
> dbo.t_item_master.unit_weight,
> cp_pc = CONVERT(decimal(4,1),0.0),
> cp_order = CONVERT(decimal(4,1),0.0),
> dbo.t_wo_components.qty_issued,
>
> QTY_SUM = ISNULL((select SUM(dbo.t_po_rec_qty_sum_dummy.qty_dummy) from dbo.t_po_rec_qty_sum_dummy
> where dbo.t_po_rec_qty_sum_dummy.item_number = dbo.t_wo_components.item_number and
> dbo.t_po_rec_qty_sum_dummy.production_term < '201212' and
> dbo.t_po_rec_qty_sum_dummy.qty_dummy <> 0),0),
>
> dbo.t_wo_components.allocated
>
>FROM dbo.t_wo_components
>
>INNER JOIN dbo.t_item_master ON dbo.t_wo_components.item_number = dbo.t_item_master.item_number
>INNER JOIN dbo.t_production_order_detail ON dbo.t_wo_components.seiban_number = dbo.t_production_order_detail.seiban_number
>INNER JOIN dbo.t_pec_struc ON dbo.t_wo_components.item_number = dbo.t_pec_struc.component and
> dbo.t_wo_components.parent_item = dbo.t_pec_struc.item_number
>INNER JOIN dbo.t_wo_header ON dbo.t_wo_components.wo_number = dbo.t_wo_header.wo_number
>INNER JOIN dbo.t_wo_product ON dbo.t_wo_components.wo_number = dbo.t_wo_product.wo_number and
> dbo.t_wo_product.seiban_number = dbo.t_wo_components.seiban_number
>LEFT JOIN dbo.t_po_rec_qty_on_order_dummy ON dbo.t_wo_components.item_number = dbo.t_po_rec_qty_on_order_dummy.item_number
>
>WHERE ( dbo.t_wo_components.production_term between '201212' and '201212') and
> ( dbo.t_item_master.item_type = '3' ) and
> ( dbo.t_wo_header.wo_status in('R','P')) and
> ( dbo.t_wo_components.repro_ref_wono = '' OR dbo.t_wo_components.repro_ref_wono IS NULL) and
> (dbo.t_wo_components.opr_no = dbo.t_pec_struc.opr_where_used)
>
>GROUP BY dbo.t_wo_components.item_number,
> dbo.t_wo_components.site,
> dbo.t_wo_components.wo_number,
> dbo.t_item_master.item_desc,
> dbo.t_wo_components.qty_required,
> dbo.t_wo_components.production_term,
> dbo.t_production_order_detail.item_number,
> dbo.t_po_rec_qty_on_order_dummy.qty_on_order,
> dbo.t_item_master.abbr_desc,
> dbo.t_wo_components.seiban_number,
> dbo.t_production_order_detail.qty_ordered,
> dbo.t_wo_header.wo_status,
> dbo.t_item_master.um,
> dbo.t_wo_components.parent_item,
> dbo.t_pec_struc.vendor,
> dbo.t_wo_components.Repro_ref_wono,
> dbo.t_item_master.safety_stock,
> dbo.t_wo_components.unit_conv,
> dbo.t_pec_struc.tpi_opr_where_used,
> dbo.t_wo_components.qty_per,
> dbo.t_pec_struc.qty_per,
> dbo.t_wo_product.qty_ordered,
> dbo.t_item_master.unit_weight,
> dbo.t_wo_components.qty_issued,
> dbo.t_item_master.item_number,
> dbo.t_wo_components.allocated
>
>UNION ALL
>
>SELECT distinct dbo.t_wo_components.item_number,
> dbo.t_wo_components.site,
> dbo.t_wo_components.wo_number,
> dbo.t_item_master.item_desc,
> qty_required = case wo_status
> when 'X' then dbo.t_wo_components.qty_required * dbo.t_wo_components.unit_conv
> else dbo.t_wo_components.qty_required
> end,
> dbo.t_wo_components.production_term,
> dbo.t_production_order_detail.item_number,
> --qty_on_order = (select sum(dbo.t_po_rec_qty_on_order_dummy.qty_on_order)
> -- from dbo.t_po_rec_qty_on_order_dummy
> -- where dbo.t_po_rec_qty_on_order_dummy.item_number = dbo.t_wo_components.item_number ),
> qty_on_order = IsNull(dbo.t_po_rec_qty_on_order_dummy.qty_on_orde r, 0),
>
> dbo.t_item_master.abbr_desc,
> dbo.t_wo_components.seiban_number,
> dbo.t_reproduction_order_detail.qty_ordered,
>
> qty_on_hand = isnull((select sum(t_item_ledger.qty_on_hand) from t_item_ledger where t_item_ledger.item_number = t_wo_components.item_number and
> t_item_ledger.site = t_wo_components.site),0),
>
> dbo.t_wo_header.wo_status,
> dbo.t_item_master.um,
> dbo.t_pec_struc.vendor,
> dbo.t_wo_components.Repro_ref_wono,
> Form_type=(select top 1 form_type from t_supplier where t_supplier.supp_alias_2 = t_pec_struc.vendor),
> dbo.t_item_master.safety_stock,
> dbo.t_wo_components.unit_conv,
> dbo.t_pec_struc.tpi_opr_where_used,
> dbo.t_wo_components.qty_per,
> dbo.t_pec_struc.qty_per,
> dbo.t_wo_product.qty_ordered,
> dbo.t_item_master.unit_weight,
> cp_pc = CONVERT(decimal(4,1),0.0),
> cp_order = CONVERT(decimal(4,1),0.0),
> dbo.t_wo_components.qty_issued,
>
> QTY_SUM = ISNULL((select SUM(dbo.t_po_rec_qty_sum_dummy.qty_dummy) from dbo.t_po_rec_qty_sum_dummy
> where dbo.t_po_rec_qty_sum_dummy.item_number = dbo.t_wo_components.item_number and
> dbo.t_po_rec_qty_sum_dummy.production_term < '201212' and
> dbo.t_po_rec_qty_sum_dummy.qty_dummy <> 0),0),
>
> dbo.t_wo_components.allocated
>
> FROM dbo.t_wo_components,
> dbo.t_item_master,
> dbo.t_reproduction_order_detail,
> dbo.t_wo_header,
> dbo.t_pec_struc,
> dbo.t_supplier,
> dbo.t_mrp_item_wrk,
> dbo.t_wo_product,
> dbo.t_production_order_detail,
> dbo.t_po_rec_qty_on_order_dummy
>
> WHERE ( dbo.t_wo_components.production_term between '201212' and '201212') and
> ( dbo.t_wo_components.item_number = dbo.t_item_master.item_number ) and
> ( dbo.t_reproduction_order_detail.ref_seiban_number = dbo.t_wo_components.seiban_number ) and
> ( dbo.t_wo_header.wo_number = dbo.t_wo_components.wo_number) and
> ( dbo.t_wo_components.item_number = dbo.t_pec_struc.component ) and
> ( dbo.t_wo_components.parent_item = dbo.t_pec_struc.item_number ) and
> ( dbo.t_item_master.item_type = '3' ) and
> ( dbo.t_wo_header.wo_status in('R','X')) and
> ( dbo.t_wo_product.wo_number = dbo.t_wo_components.wo_number ) and
> ( dbo.t_wo_product.repro_ref_wono = dbo.t_wo_components.repro_ref_wono ) and
> ( dbo.t_wo_components.repro_ref_wono <> '' OR dbo.t_wo_components.repro_ref_wono is not null ) and
> ( dbo.t_wo_product.seiban_number = dbo.t_wo_components.seiban_number ) and
> ( dbo.t_wo_product.item_number = t_wo_components.parent_item ) and
> ( dbo.t_wo_components.repro_ref_wono <> '' OR dbo.t_wo_components.repro_ref_wono is not null ) and
> ( dbo.t_wo_components.repro_ref_wono = dbo.t_reproduction_order_detail.ref_wonum ) and
> ( dbo.t_production_order_detail.seiban_number = dbo.t_wo_components.seiban_number ) and
> ( dbo.t_wo_components.ref = CAST(dbo.t_reproduction_order_detail.repro_no AS VARCHAR(15)) ) and
> ( dbo.t_wo_components.item_number = dbo.t_po_rec_qty_on_order_dummy.item_number ) and
> (dbo.t_wo_components.opr_no = dbo.t_pec_struc.opr_where_used)
>
>
>GROUP BY dbo.t_wo_components.item_number,
> dbo.t_wo_components.site,
> dbo.t_wo_components.wo_number,
> dbo.t_item_master.item_desc,
> dbo.t_wo_components.qty_required,
> dbo.t_wo_components.production_term,
> dbo.t_production_order_detail.item_number,
> dbo.t_po_rec_qty_on_order_dummy.qty_on_order,
> dbo.t_item_master.abbr_desc,
> dbo.t_wo_components.seiban_number,
> dbo.t_reproduction_order_detail.qty_ordered,
> dbo.t_wo_header.wo_status,
> dbo.t_item_master.um,
> dbo.t_wo_components.parent_item,
> dbo.t_pec_struc.vendor,
> dbo.t_wo_components.Repro_ref_wono,
> dbo.t_item_master.safety_stock,
> dbo.t_wo_components.unit_conv,
> dbo.t_pec_struc.tpi_opr_where_used,
> dbo.t_wo_components.qty_per,
> dbo.t_pec_struc.qty_per,
> dbo.t_wo_product.qty_ordered,
> dbo.t_item_master.unit_weight,
> dbo.t_wo_components.qty_issued,
> dbo.t_item_master.item_number,
> dbo.t_wo_components.allocated
>
>UNION ALL
>
> SELECT distinct dbo.t_testshots_dtl.item_number,
> dbo.t_testshots_dtl.site,
> dbo.t_testshots_dtl.tshot_no,
> dbo.t_item_master.item_desc,
> qty_required = dbo.t_testshots_dtl.qty_required,
> dbo.t_testshots_hdr.production_term,
> item_number = dbo.t_testshots_hdr.fg,
> -- qty_on_order = (select sum(dbo.t_po_rec_qty_on_order_dummy.qty_on_order)
> -- from dbo.t_po_rec_qty_on_order_dummy
> -- where dbo.t_po_rec_qty_on_order_dummy.item_number = dbo.t_testshots_dtl.item_number),
> qty_on_order = IsNull(dbo.t_po_rec_qty_on_order_dummy.qty_on_orde r, 0),
>
> dbo.t_item_master.abbr_desc,
> '' as seiban_number,
> dbo.t_testshots_hdr.qty_required as qty_ordered,
>
> qty_on_hand = isnull((select sum(t_item_ledger.qty_on_hand) from t_item_ledger where t_item_ledger.item_number = t_testshots_dtl.item_number and
> t_item_ledger.site = t_testshots_dtl.site),0),
>
> dbo.t_testshots_hdr.status as wo_status,
> dbo.t_item_master.um,
> '' as vendor,
> '' as Repro_ref_wono,
> '' as Form_type,
> dbo.t_item_master.safety_stock,
> 0 as unit_conv,
> '' as tpi_opr_where_used,
> dbo.t_testshots_dtl.qty_per,
> 0 as qty_per,
> dbo.t_testshots_hdr.qty_required as qty_ordered,
> dbo.t_item_master.unit_weight,
> cp_pc = CONVERT(decimal(4,1),0.0),
> cp_order = CONVERT(decimal(4,1),0.0),
> 0 as qty_issued,
>
> QTY_SUM = ISNULL((select SUM(dbo.t_po_rec_qty_sum_dummy.qty_dummy) from dbo.t_po_rec_qty_sum_dummy
> where dbo.t_po_rec_qty_sum_dummy.item_number = dbo.t_testshots_dtl.item_number and
> dbo.t_po_rec_qty_sum_dummy.production_term < '201212' and
> dbo.t_po_rec_qty_sum_dummy.qty_dummy <> 0),0),
>
> 0 as allocated
>
>FROM dbo.t_testshots_dtl
>
>INNER JOIN dbo.t_item_master ON dbo.t_testshots_dtl.item_number = dbo.t_item_master.item_number
>INNER JOIN dbo.t_testshots_hdr ON dbo.t_testshots_dtl.tshot_no = dbo.t_testshots_hdr.tshot_no
>LEFT JOIN dbo.t_po_rec_qty_on_order_dummy ON dbo.t_testshots_dtl.item_number = dbo.t_po_rec_qty_on_order_dummy.item_number
>
>WHERE ( dbo.t_testshots_hdr.production_term between '201212' and '201212') and
> ( dbo.t_item_master.item_type = '3' ) and
> ( dbo.t_testshots_hdr.status = '1' ) and
> ( dbo.t_testshots_hdr.approved = '1' )
>
>GROUP BY dbo.t_testshots_dtl.item_number,
> dbo.t_testshots_dtl.site,
> dbo.t_testshots_dtl.tshot_no,
> dbo.t_item_master.item_desc,
> dbo.t_testshots_dtl.qty_required,
> dbo.t_testshots_hdr.production_term,
> dbo.t_testshots_hdr.fg,
> dbo.t_po_rec_qty_on_order_dummy.qty_on_order,
> dbo.t_item_master.abbr_desc,
> dbo.t_testshots_hdr.qty_required,
> dbo.t_testshots_hdr.status,
> dbo.t_item_master.um,
> dbo.t_testshots_dtl.parent_item,
> dbo.t_item_master.safety_stock,
> dbo.t_testshots_dtl.qty_per,
> dbo.t_testshots_hdr.qty_required,
> dbo.t_item_master.unit_weight
>
>ORDER BY dbo.t_wo_components.item_number,
> dbo.t_wo_components.wo_number,
> dbo.t_wo_components.production_term,
> dbo.t_wo_components.seiban_number
>
>
>5. Does the same SELECT statement work
>successfully when issue from either the isql pane of the PB Database
>painter or from MS SQL Server Mgmt studio?
>Answer : No, the same error occurs. (on newly installed computers only).
>
>6. What have you tried to this point to fix the issue?
>Answer : Actually not all computers that use this select statement had errors.
>The report that use this sql is already running for many years.
>The error only occurs to a newly installed computers.
>This error happen when we format a computer and re-installed everything.
>Note: the program also use ConnectToNewObject ( "Excel.Application" ) and save information to excel.
>
>What we have done so far:
>1. We try windows xp and windows 7 - error still occurs
>2. We installed excel 97 and excel 2007 - same error.
>3. We run hotfixes for excel - same error.
Similar Threads |
|