Subject | Edit of a Query with a SubSelect causes Exception |
---|---|
Author | Michael Horne |
Post date | 2015-11-12T19:37:55Z |
Delphi 7, IBObjects 5.7.7 2340
I have a tib_query with sql that contains a subselect
SELECT STOCKPO.*,
(select sum(spod_ordqty * spod_cost) from stockpod
where spod_spo_id = :ID) as POSUM
this is an editable query and when we do a post it gets the following error
Exception with message ‘Invalid text in HexTextToBinary’. Process Stopped
If I comment out the subselect it doesn’t have the error.
It worked with the subselect in IBObjects v4.
I thought the EditSQL should allow this.
I have included the code for the query below
Thanks
Michael
object qyStockPO: TIB_Query
CalculatedFields.Strings = (
'Residential Char(1)')
ColumnAttributes.Strings = (
'SPO_SHIPRESIDENTIAL=BOOLEAN=T,F'
'SUM=CURRENCY')
FieldsCharCase.Strings = (
'SPO_SALESPERSON=UPPER'
'SPO_ORDEREDBY=UPPER'
'SPO_LOT=UPPER'
'SPO_APVEN_COMPANY=UPPER'
'SPO_APVEN_ADDR1=UPPER'
'SPO_APVEN_ADDR2=UPPER'
'SPO_APVEN_CITY=UPPER'
'SPO_APVEN_STATE=UPPER'
'SPO_APVEN_ZIP=UPPER'
'SPO_APVEN_COUNTRY=UPPER'
'SPO_APVEN_NOTES=UPPER'
'SPO_APVEN_CONTACT=UPPER'
'SPO_APVEN_CUSTOMERNUMBER=UPPER'
'SPO_APVEN_TERMS=UPPER'
'SPO_APVEN_FAX=UPPER'
'SPO_APVEN_PHONE=UPPER'
'SPO_APVEN_EMAIL=UPPER'
'SPO_FC_ID=UPPER'
'SPO_RECVD_DATE=UPPER'
'SPO_TOTALCOST=UPPER'
'SPO_SHIPCOUNTRY=UPPER'
'SPO_SHIPZIP=UPPER'
'SPO_SHIPSTATE=UPPER'
'SPO_SHIPADDR2=UPPER'
'SPO_SHIPCITY=UPPER'
'SPO_SHIPADDR1=UPPER'
'SPO_SHIPNAME=UPPER'
'SPO_NOTES=UPPER'
'SPO_SOURCE=UPPER'
'SPO_APVEN_ID=UPPER'
'SPO_DATE=UPPER')
FieldsDisplayWidth.Strings = (
'SPO_VENDOR_FREIGHT=67'
'SPO_APVEN_ID=51'
'SPO_SOURCE=104'
'SPO_NOTES=62'
'SPO_SALESPERSON=82'
'SPO_SHIPNAME=111'
'SPO_SHIPADDR1=106'
'SPO_SHIPADDR2=106'
'SPO_SHIPCITY=79'
'SPO_SHIPSTATE=53'
'SPO_SHIPZIP=62'
'SPO_SHIPCOUNTRY=54'
'SPO_SHIPTOUS=62'
'SPO_SHIPRESIDENTIAL=87'
'SPO_ORDEREDBY=82')
FieldsIndex.Strings = (
'SPO_ID'
'SPO_DATE'
'SPO_APVEN_ID'
'SPO_VENDOR_FREIGHT'
'SPO_POSTDATE'
'SPO_SOURCE'
'SPO_NOTES'
'SPO_SALESPERSON'
'SPO_SHIPNAME'
'SPO_SHIPADDR1'
'SPO_SHIPADDR2'
'SPO_SHIPCITY'
'SPO_SHIPSTATE'
'SPO_SHIPZIP'
'SPO_SHIPCOUNTRY'
'SPO_SHIPTOUS'
'SPO_SHIPRESIDENTIAL')
IB_Connection = formIBData.cnMain
SQL.Strings = (
'SELECT STOCKPO.*, '
' (select sum(spod_ordqty * spod_cost) from stockpod'
' where spod_spo_id = :ID) as POSUM'
'FROM STOCKPO'
'WHERE SPO_ID = :ID'
'')
DeleteSQL.Strings = (
'DELETE FROM STOCKPO STOCKPO'
'WHERE'
' SPO_ID = :OLD_SPO_ID')
EditSQL.Strings = (
'UPDATE STOCKPO STOCKPO SET'
' STOCKPO.SPO_ID = :SPO_ID, /*PK*/'
' STOCKPO.SPO_DATE = :SPO_DATE,'
' STOCKPO.SPO_APVEN_ID = :SPO_APVEN_ID,'
' STOCKPO.SPO_SOURCE = :SPO_SOURCE,'
' STOCKPO.SPO_NOTES = :SPO_NOTES,'
' STOCKPO.SPO_SHIPNAME = :SPO_SHIPNAME,'
' STOCKPO.SPO_SHIPADDR1 = :SPO_SHIPADDR1,'
' STOCKPO.SPO_SHIPADDR2 = :SPO_SHIPADDR2,'
' STOCKPO.SPO_SHIPCITY = :SPO_SHIPCITY,'
' STOCKPO.SPO_SHIPSTATE = :SPO_SHIPSTATE,'
' STOCKPO.SPO_SHIPZIP = :SPO_SHIPZIP,'
' STOCKPO.SPO_SHIPCOUNTRY = :SPO_SHIPCOUNTRY,'
' STOCKPO.SPO_SHIPTOUS = :SPO_SHIPTOUS,'
' STOCKPO.SPO_SHIPRESIDENTIAL = :SPO_SHIPRESIDENTIAL,'
' STOCKPO.SPO_ORDEREDBY = :SPO_ORDEREDBY,'
' STOCKPO.SPO_TOTALCOST = :SPO_TOTALCOST,'
' STOCKPO.SPO_INCOMING_RECVD = :SPO_INCOMING_RECVD,'
' STOCKPO.SPO_RECVD_DATE = :SPO_RECVD_DATE,'
' STOCKPO.SPO_FC_ID = :SPO_FC_ID,'
' STOCKPO.SPO_LOT = :SPO_LOT,'
' STOCKPO.SPO_APVEN_EMAIL = :SPO_APVEN_EMAIL,'
' STOCKPO.SPO_APVEN_COMPANY = :SPO_APVEN_COMPANY,'
' STOCKPO.SPO_APVEN_ADDR1 = :SPO_APVEN_ADDR1,'
' STOCKPO.SPO_APVEN_ADDR2 = :SPO_APVEN_ADDR2,'
' STOCKPO.SPO_APVEN_CITY = :SPO_APVEN_CITY,'
' STOCKPO.SPO_APVEN_STATE = :SPO_APVEN_STATE,'
' STOCKPO.SPO_APVEN_ZIP = :SPO_APVEN_ZIP,'
' STOCKPO.SPO_APVEN_COUNTRY = :SPO_APVEN_COUNTRY,'
' STOCKPO.SPO_APVEN_PHONE = :SPO_APVEN_PHONE,'
' STOCKPO.SPO_APVEN_FAX = :SPO_APVEN_FAX,'
' STOCKPO.SPO_APVEN_TERMS = :SPO_APVEN_TERMS,'
' STOCKPO.SPO_APVEN_CUSTOMERNUMBER = :SPO_APVEN_CUSTOMERNUMBER,'
' STOCKPO.SPO_APVEN_CONTACT = :SPO_APVEN_CONTACT,'
' STOCKPO.SPO_APVEN_NOTES = :SPO_APVEN_NOTES,'
' STOCKPO.SPO_FC_TERMS = :SPO_FC_TERMS,'
' STOCKPO.SPO_TOTALCHARGES = :SPO_TOTALCHARGES,'
' STOCKPO.SPO_CODFEE = :SPO_CODFEE,'
' STOCKPO.SPO_REMITCOD_NAME = :SPO_REMITCOD_NAME,'
' STOCKPO.SPO_REMITCOD_ADDR1 = :SPO_REMITCOD_ADDR1,'
' STOCKPO.SPO_REMITCOD_ADDR2 = :SPO_REMITCOD_ADDR2,'
' STOCKPO.SPO_REMITCOD_CITY = :SPO_REMITCOD_CITY,'
' STOCKPO.SPO_REMITCOD_STATE = :SPO_REMITCOD_STATE,'
' STOCKPO.SPO_REMITCOD_ZIP = :SPO_REMITCOD_ZIP,'
' STOCKPO.SPO_REMITCOD_COUNTRY = :SPO_REMITCOD_COUNTRY,'
' STOCKPO.SPO_BOL_NOTES = :SPO_BOL_NOTES,'
' STOCKPO.SPO_ATTENTION = :SPO_ATTENTION,'
' STOCKPO.SPO_INTERNALNOTES = :SPO_INTERNALNOTES,'
' STOCKPO.SPO_CASHCERTCHECK = :SPO_CASHCERTCHECK,'
' STOCKPO.SPO_CUSCHECK = :SPO_CUSCHECK,'
' STOCKPO.SPO_BROKER = :SPO_BROKER,'
' STOCKPO.SPO_STATUS = :SPO_STATUS,'
' STOCKPO.SPO_PROCESSING_STATUS = :SPO_PROCESSING_STATUS'
'WHERE'
' SPO_ID = :OLD_SPO_ID')
GeneratorLinks.Strings = (
'StockPO.SPO_ID=gen_SPO_id')
InsertSQL.Strings = (
'INSERT INTO STOCKPO('
' SPO_ID, /*PK*/'
' SPO_DATE,'
' SPO_APVEN_ID,'
' SPO_SOURCE,'
' SPO_NOTES,'
' SPO_SHIPNAME,'
' SPO_SHIPADDR1,'
' SPO_SHIPADDR2,'
' SPO_SHIPCITY,'
' SPO_SHIPSTATE,'
' SPO_SHIPZIP,'
' SPO_SHIPCOUNTRY,'
' SPO_SHIPTOUS,'
' SPO_SHIPRESIDENTIAL,'
' SPO_ORDEREDBY,'
' SPO_TOTALCOST,'
' SPO_INCOMING_RECVD,'
' SPO_RECVD_DATE,'
' SPO_FC_ID,'
' SPO_LOT,'
' SPO_APVEN_EMAIL,'
' SPO_APVEN_COMPANY,'
' SPO_APVEN_ADDR1,'
' SPO_APVEN_ADDR2,'
' SPO_APVEN_CITY,'
' SPO_APVEN_STATE,'
' SPO_APVEN_ZIP,'
' SPO_APVEN_COUNTRY,'
' SPO_APVEN_PHONE,'
' SPO_APVEN_FAX,'
' SPO_APVEN_TERMS,'
' SPO_APVEN_CUSTOMERNUMBER,'
' SPO_APVEN_CONTACT,'
' SPO_APVEN_NOTES,'
' SPO_FC_TERMS,'
' SPO_TOTALCHARGES,'
' SPO_CODFEE,'
' SPO_REMITCOD_NAME,'
' SPO_REMITCOD_ADDR1,'
' SPO_REMITCOD_ADDR2,'
' SPO_REMITCOD_CITY,'
' SPO_REMITCOD_STATE,'
' SPO_REMITCOD_ZIP,'
' SPO_REMITCOD_COUNTRY,'
' SPO_BOL_NOTES,'
' SPO_ATTENTION,'
' SPO_INTERNALNOTES,'
' SPO_CASHCERTCHECK,'
' SPO_CUSCHECK,'
' SPO_BROKER,'
' SPO_STATUS,'
' SPO_PROCESSING_STATUS)'
'VALUES ('
' :SPO_ID,'
' :SPO_DATE,'
' :SPO_APVEN_ID,'
' :SPO_SOURCE,'
' :SPO_NOTES,'
' :SPO_SHIPNAME,'
' :SPO_SHIPADDR1,'
' :SPO_SHIPADDR2,'
' :SPO_SHIPCITY,'
' :SPO_SHIPSTATE,'
' :SPO_SHIPZIP,'
' :SPO_SHIPCOUNTRY,'
' :SPO_SHIPTOUS,'
' :SPO_SHIPRESIDENTIAL,'
' :SPO_ORDEREDBY,'
' :SPO_TOTALCOST,'
' :SPO_INCOMING_RECVD,'
' :SPO_RECVD_DATE,'
' :SPO_FC_ID,'
' :SPO_LOT,'
' :SPO_APVEN_EMAIL,'
' :SPO_APVEN_COMPANY,'
' :SPO_APVEN_ADDR1,'
' :SPO_APVEN_ADDR2,'
' :SPO_APVEN_CITY,'
' :SPO_APVEN_STATE,'
' :SPO_APVEN_ZIP,'
' :SPO_APVEN_COUNTRY,'
' :SPO_APVEN_PHONE,'
' :SPO_APVEN_FAX,'
' :SPO_APVEN_TERMS,'
' :SPO_APVEN_CUSTOMERNUMBER,'
' :SPO_APVEN_CONTACT,'
' :SPO_APVEN_NOTES,'
' :SPO_FC_TERMS,'
' :SPO_TOTALCHARGES,'
' :SPO_CODFEE,'
' :SPO_REMITCOD_NAME,'
' :SPO_REMITCOD_ADDR1,'
' :SPO_REMITCOD_ADDR2,'
' :SPO_REMITCOD_CITY,'
' :SPO_REMITCOD_STATE,'
' :SPO_REMITCOD_ZIP,'
' :SPO_REMITCOD_COUNTRY,'
' :SPO_BOL_NOTES,'
' :SPO_ATTENTION,'
' :SPO_INTERNALNOTES,'
' :SPO_CASHCERTCHECK,'
' :SPO_CUSCHECK,'
' :SPO_BROKER,'
' :SPO_STATUS,'
' :SPO_PROCESSING_STATUS)')
KeyLinks.Strings = (
'StockPO.SPO_ID ')
RequestLive = True
Left = 284
Top = 67
ParamValues = (
'ID=')
end