- John Murphy
- PowerBuilder
- Sunday, 24 May 2020 01:08 PM UTC
I think this is a bug but I thought I post it here first it case I'm just wacky.
I am using SQLCA.SyntaxFromSQL to build a DW on the fly. Since all the key fields were included it makes the dw updatable. This works fine except in the case where there is a SQL computed field. It marks the field as updatable and also sets it as the "identity" column. PB does not seem to have a problem with it but my program is trying evaluate DB updates before they happen and this messes it up.
ls_syntax = SQLCA.SyntaxFromSQL(ls_sql, 'Style(Type=Grid)', ls_error)
dw_dynamic.Create(ls_syntax, ls_error)
release 19;
datawindow(units=0 timer_interval=0 color=1073741824 processing=1 print.margin.bottom=96 print.margin.left=110 print.margin.right=110 print.margin.top=96 print.preview.buttons=no )
table(
column=(type=char(2) update=yes key=yes updatewhereclause = yes name=corp dbname="corp")
column=(type=char(2) update=yes key=yes updatewhereclause = yes name=branch dbname="pmf.branch")
column=(type=char(20) update=yes key=yes updatewhereclause = yes name=product_no dbname="pmf.product_no")
column=(type=char(50) update=yes updatewhereclause = yes name=description dbname="pmf.description")
column=(type=decimal(4) update=yes updatewhereclause = yes name=total_cost dbname="pmf.total_cost")
column=(type=decimal(6) update=yes identity=yes updatewhereclause = yes name=new_cost dbname="new_cost")
retrieve="SELECT TOP(100) pmf.corp, pmf.branch, pmf.product_no, pmf.description, pmf.total_cost, pmf.total_cost * 1.10 AS ~"new_cost~" FROM pmf WHERE pmf.corp = '01' AND pmf.branch = '00' AND pmf.total_cost > 100"
update="pmf" updatewhere=1)
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.