Sage 100

 View Only
Expand all | Collapse all

CI_Item UDFs are absent from a SQL query

  • 1.  CI_Item UDFs are absent from a SQL query

    Posted 06-07-2024 16:19

    Client is on MAS 200 v4.5 Advanced.  When they SQL query CI_Item, the UDFs do not come through - only standard fields.  They do, however, when they do an Excel query.


    DSN=MAS90CBL; Directory=\\XXXXXX\Sage\MAS450\MAS90; Prefix=\\XXXXXX\Sage\MAS450\MAS90\SY\, \\XXXXXX\Sage\MAS450\MAS90\==\; ViewDLL=\\XXXXX\Sage\MAS450\MAS90\HOME; LogFile=\PVXODBC.LOG; RemotePVKIOHost=XXXXX; RemotePVKIOPort=20222; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SERVER=NotTheServer

    The role performing the query has permissions to the CI_item table, since they can see the fields in an Excel query.  ODBC Security is enabled, and all the fields are enabled for the role.

    Thoughts?



    ------------------------------
    Barbara Goldstein
    Sr. Consultant
    DSD Business Systems
    ------------------------------


  • 2.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-07-2024 19:38

    Does it happen without the C/S ODBC?



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------



  • 3.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-08-2024 10:05
    Some UDFs don’t appear. Some do.

    ---------------------------------
    Bob Pfahnl
    Manager - Silicon Valley
    DSD Business Systems
    ---------------------------------





  • 4.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-08-2024 13:11

    Do the missing ones show up in  a Crystal report?

    Does the  add and delete a UDF on the object still work to fix strange UDF behavior like this?



    ------------------------------
    Phil McIntosh
    Friendly Systems, Inc.
    ------------------------------



  • 5.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-08-2024 13:33

    They all show up in Excel and Crystal.  Only some don't show up in the SQL query.  We'll post the Query statement when received.  Client claims they do no filtering.  It behaves exactly the same in an old instance of SQL on another server, however, they just reported it.

     

    Bob Pfahnl | Manager

    Silicon Valley

    main: 800.627.9032 x220

    direct: 408.641.0922

    w: dsdinc.com

    e: bobp@dsdinc.com

     

    1b59c5a27c8b42868f6f74c165ea62f8@dsdinc.com?anonymous&ep=signature">

    1b59c5a27c8b42868f6f74c165ea62f8@dsdinc.com?anonymous&ep=signature">Book time to meet with me

     

     






  • 6.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-08-2024 17:02

    User DSN or System DSN?  If it's a User DSN, try a System DSN.



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 7.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-09-2024 08:44

    Same results with Admin with all permissions?  Different workstation?



    ------------------------------
    Jeff Schwenk
    Bottomline Software, Inc.
    (540) 221-4444
    ------------------------------



  • 8.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-10-2024 11:36

    The UDFs that do not show up are ones that were added 1-2 years ago for a project.



    ------------------------------
    Barbara Goldstein
    Sr. Consultant
    DSD Business Systems
    ------------------------------



  • 9.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-10-2024 12:13

    Is the SQL query run fresh as "select * from..."? 

    Or perhaps as a SQL View stored in a database (which might need to be re-compiled to pull in new columns)?



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 10.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-13-2024 20:34

    Client response when I requested the SQL statements (hint: I'm not SQL competent, so please tell me if you see anything that makes sense and ask questions):

    Hello Barbara, There are a bunch of stored procedures that run to refresh the data from MAS into this SQL DB. 

    I believe this is the query to refresh all the tables including the CI_Item. 

    USE [MAS90CBL]

    GO

    /****** Object:  StoredProcedure [dbo].[sp_Refresh_MAS90CBLTables]    Script Date: 6/13/2024 2:06:11 PM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    -- =============================================

    -- Author:        <Purnima>

    -- Create date: <Create Date,,>

    -- Description:   <SO_SalesOrderHeader >

    --  exec [dbo].[sp_Refresh_MAS90CBLTables_test];exec [dbo].[sp_Refresh_MAS90CBLTables];

    --

    -- =============================================

    ALTER PROCEDURE [dbo].[sp_Refresh_MAS90CBLTables]  

    AS

    BEGIN

    Select * Into #SO_SalesOrderHeader

        From [MAS90CBL].[dbo].SO_SalesOrderHeader

          If exists (Select count(*) From #SO_SalesOrderHeader)

            BEGIN

                 if OBJECT_ID('SO_SalesOrderHeader') Is Not Null

                      Drop Table SO_SalesOrderHeader

                 Select *

                 Into SO_SalesOrderHeader

                 From #SO_SalesOrderHeader

            END

            

    Select * Into #SO_SalesOrderHistoryDetail

          From [MAS90CBL].[dbo].SO_SalesOrderHistoryDetail

          If exists (Select count(*) From #SO_SalesOrderHistoryDetail)

            BEGIN

                 if OBJECT_ID('SO_SalesOrderHistoryDetail') Is Not Null

                      Drop Table SO_SalesOrderHistoryDetail

                 Select *

                 Into SO_SalesOrderHistoryDetail

                 From #SO_SalesOrderHistoryDetail

            END

    Select * Into #SO_SalesOrderHistoryHeader

          From [MAS90CBL].[dbo].SO_SalesOrderHistoryHeader

          If exists (Select count(*) From #SO_SalesOrderHistoryHeader)

            BEGIN

                 if OBJECT_ID('SO_SalesOrderHistoryHeader') Is Not Null

                      Drop Table SO_SalesOrderHistoryHeader

                 Select *

                 Into SO_SalesOrderHistoryHeader

                 From #SO_SalesOrderHistoryHeader

            END

    Select * Into #AR_InvoiceHistoryDetail

          From [MAS90CBL].[dbo].AR_InvoiceHistoryDetail

          If exists (Select count(*) From #AR_InvoiceHistoryDetail)

            BEGIN

                 if OBJECT_ID('AR_InvoiceHistoryDetail') Is Not Null

                      Drop Table AR_InvoiceHistoryDetail

                 Select *

                 Into AR_InvoiceHistoryDetail

                 From #AR_InvoiceHistoryDetail

            END

    Select * Into #AR_InvoiceHistoryHeader

          From [MAS90CBL].[dbo].AR_InvoiceHistoryHeader

          If exists (Select count(*) From #AR_InvoiceHistoryHeader)

            BEGIN

                 if OBJECT_ID('AR_InvoiceHistoryHeader') Is Not Null

                      Drop Table AR_InvoiceHistoryHeader

                 Select *

                 Into AR_InvoiceHistoryHeader

                 From #AR_InvoiceHistoryHeader

            END

    Select * Into #SO_SalesOrderDetail

          From [MAS90CBL].[dbo].SO_SalesOrderDetail

          If exists (Select count(*) From #SO_SalesOrderDetail)

            BEGIN

                 if OBJECT_ID('SO_SalesOrderDetail') Is Not Null

                      Drop Table SO_SalesOrderDetail

                 Select *

                 Into SO_SalesOrderDetail

                 From #SO_SalesOrderDetail

            END

    Select * Into #AR_Customer

          From [MAS90CBL].[dbo].AR_Customer

          If exists (Select count(*) From #AR_Customer)

            BEGIN

                 if OBJECT_ID('AR_Customer') Is Not Null

                      Drop Table AR_Customer

                 Select *

                 Into AR_Customer

                 From #AR_Customer

            END

    Select * Into #SO_ShipToAddress

          From [MAS90CBL].[dbo].SO_ShipToAddress

          If exists (Select count(*) From #SO_ShipToAddress)

            BEGIN

                 if OBJECT_ID('SO_ShipToAddress') Is Not Null

                      Drop Table SO_ShipToAddress

                 Select *

                 Into SO_ShipToAddress

                 From #SO_ShipToAddress

            END

    Select ItemCode

          ,WarehouseCode

          ,TransactionDate

          ,TransactionCode

          ,EntryNo

          ,SequenceNo

          ,IMTransactionEntryComment

          ,APDivisionNo

          ,VendorNo

          ,ARDivisionNo

          ,CustomerNo

          ,ReferenceDate

          ,FiscalCalYear

          ,FiscalCalPeriod

          ,ShipToCode

          ,InvoiceType

          ,InvoiceHistoryHeaderSeqNo

          ,ReceiptHistoryHeaderSeqNo

          ,ReceiptHistoryPurchaseOrderNo

          ,TransactionQty

          ,AllocatedCost

          ,UnitPrice

          ,ExtendedPrice

          ,ExtendedStandardCost

          ,DateUpdated

          ,TimeUpdated

          ,UserUpdatedKey

          ,UDF_ACCOUNT

    Into #IM_ItemTransactionHistory

          From [MAS90CBL].[dbo].IM_ItemTransactionHistory

          If exists (Select count(*) From #IM_ItemTransactionHistory)

            BEGIN

                 if OBJECT_ID('IM_ItemTransactionHistory') Is Not Null

                      Drop Table IM_ItemTransactionHistory

                 Select *

                 Into IM_ItemTransactionHistory

                 From #IM_ItemTransactionHistory

            END

    Select ItemCode

          ,ItemType

          ,ItemCodeDesc

          ,ExtendedDescriptionKey

          ,UseInAR

          ,UseInSO

          ,UseInPO

          ,UseInBM

          ,CalculateCommission

          ,DropShip

          ,EBMEnabled

          ,PriceCode

          ,PrintReceiptLabels

          ,AllocateLandedCost

          ,WarrantyCode

          ,SalesUnitOfMeasure

          ,PurchaseUnitOfMeasure

          ,StandardUnitOfMeasure

          ,PostToGLByDivision

          ,SalesAcctKey

          ,CostOfGoodsSoldAcctKey

          ,InventoryAcctKey

          ,PurchaseAcctKey

          ,ManufacturingCostAcctKey

          ,TaxClass

          ,PurchasesTaxClass

          ,ProductLine

          ,ProductType

          ,Valuation

          ,DefaultWarehouseCode

          ,PrimaryAPDivisionNo

          ,PrimaryVendorNo

          ,ImageFile

          ,Category1

          ,Category2

          ,Category3

          ,Category4

          ,ExplodeKitItems

          ,ShipWeight

          ,CommentText

          ,RestockingMethod

          ,StandardUnitCost

          ,StandardUnitPrice

          ,CommissionRate

          ,BaseCommAmt

          ,PurchaseUMConvFctr

          ,SalesUMConvFctr

          ,Volume

          ,RestockingCharge

          ,ProcurementType

          ,DateCreated

          ,TimeCreated

          ,UserCreatedKey

          ,DateUpdated

          ,TimeUpdated

          ,UserUpdatedKey

          ,UDF_DISPOSITION

          ,UDF_WRITE

          ,UDF_INSPECT

          ,AllowBackOrders

          ,AllowReturns

          ,AllowTradeDiscount

          ,InactiveItem

          ,ConfirmCostIncrInRcptOfGoods

          ,LastSoldDate

          ,LastReceiptDate

          ,SalesPromotionCode

          ,SaleStartingDate

          ,SaleEndingDate

          ,SaleMethod

          ,NextLotSerialNo

          ,InventoryCycle

          ,RoutingNo

          ,PlannerCode

          ,BuyerCode

          ,LowLevelCode

          ,PlannedByMRP

          ,VendorItemCode

          ,SetupCharge

          ,AttachmentFileName

          ,ItemImageWidthInPixels

          ,ItemImageHeightInPixels

          ,LastTotalUnitCost

          ,SalesPromotionPrice

          ,SuggestedRetailPrice

          ,SalesPromotionDiscountPercent

          ,TotalQuantityOnHand

          ,AverageBackOrderFillDays

          ,LastAllocatedUnitCost

          ,TotalInventoryValue

          ,UDF_HTS_US

          ,UDF_PO_RECEIPT_NOTE

          ,UDF_HTS_EU

          ,UDF_LEAD_TIME

          ,UDF_EXPLODE_PL

            Into #CI_Item

          From [MAS90CBL].[dbo].CI_Item

          

          If exists (Select count(*) From #CI_Item)

            BEGIN

                 if OBJECT_ID('CI_Item') Is Not Null

                      Drop Table CI_Item

                 Select *

                 Into CI_Item

                 From #CI_Item

            END

    end   

    You can see the CI_Item at the end. Let me know if this helps and If we can jump on another call.



    ------------------------------
    Barbara Goldstein
    Sr. Consultant
    DSD Business Systems
    ------------------------------



  • 11.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-13-2024 23:16

    What are the names of the missing UDFs?  Are they listed in the select into ci_item statement?



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 12.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-14-2024 11:25

    @Doug Higgs There are 12 UDFs that are not listed in the SQL statement.  Could it be that simple?



    ------------------------------
    Barbara Goldstein
    Sr. Consultant
    DSD Business Systems
    ------------------------------



  • 13.  RE: CI_Item UDFs are absent from a SQL query

    Posted 06-14-2024 11:32

    Yes.  If those are the missing twelve.



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------