Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Pages: 1
Bonjour,
Dans une DataWindows, lors de la création d'une nouvelle ligne, je souhaite mettre en "Initial Value" le résultat d'une séquence. La syntaxe semble être : Séquence NOMDEMASEQUENCE. Mais cela ne fonctionne pas. Est-ce que quelqu'un connait la syntaxe?
Cordialement,
Cédric
Hors ligne
Bonjour et sur ce forum.
Avec Oracle il n'y a pas la notion d'auto-increment sur les PK et il faut effectivement utiliser une séquence. A ma connaissance, tu ne pourras pas coder cela directement dans le DWO, il te faudra un peu de code à côté.
Jette un coup d'œil à cette discussion : http://pbadonf.fr/forum/viewtopic.php?pid=23320#p23320
Hors ligne
Merci pour ta réponse rapide.
Ok pour le code, mais où se met-il?
Je te donne un exemple de mon code source si ça peut aider :
release 10; datawindow ( units=0 timer_interval=0 color=67108864 processing=0 print.orientation=0 print.margin.left=4 print.margin.right=4 print.margin.top=4 print.margin.bottom=4 print.paper.size=0 print.paper.source=0 selected.mouse=no) header(height=0 color="536870912" ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=1312 color="536870912" ) table(column=(type=decimal(0) key=yes update=yes updatewhereclause=yes initial="select SEQ_ID_DEM.nextval from dual;" name=id_dem dbname="id_dem" ) column=(type=datetime update=yes updatewhereclause=yes name=date_dem dbname="date_dem" ) column=(type=char(15) update=yes updatewhereclause=yes name=code_type_dem dbname="code_type_dem" values="" ) column=(type=datetime update=yes updatewhereclause=yes name=reporting_date dbname="reporting_date" values="" ) column=(type=decimal(0) update=yes updatewhereclause=yes name=workspace_id dbname="workspace_id" values="" ) column=(type=decimal(0) update=yes updatewhereclause=yes name=priorite dbname="priorite" ) column=(type=decimal(0) update=yes updatewhereclause=yes initial="0" name=cooperation_tool dbname="cooperation_tool" values=" 1/ 0" ) column=(type=char(64) update=yes updatewhereclause=yes name=user_dem dbname="user_dem" ) column=(type=char(64) update=yes updatewhereclause=yes name=email_user_demande dbname="email_user_demande" ) column=(type=char(12) update=yes updatewhereclause=yes initial="ENCOURS" name=code_etat dbname="code_etat" ) retrieve="select id_dem, date_dem, code_type_dem, reporting_date, workspace_id, priorite, cooperation_tool, user_dem, email_user_demande, code_etat, SEQ_ID_DEM.nextval As next_id_dem from ipt_demandes_traitements where 1=2" update="ipt_demandes_traitements" updatewhere=0 updatekeyinplace=yes ) text(name=code_type_dem_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="40" height="52" width="462" text="Code Type Dem:" ) column(name=code_type_dem tag="select code_type_dem as code, lib_type_dem as description from ipt_ref_type_dem" band=detail id=3 x="517" y="40" height="64" width="1225" color="33554432" border="0" alignment="0" format="[general]" dddw.allowedit=no dddw.autohscroll=no dddw.autoretrieve=yes dddw.useasborder=no dddw.datacolumn=code dddw.displaycolumn=description dddw.hscrollbar=no dddw.hsplitscroll=no dddw.imemode=0 dddw.limit=15 dddw.name=dddw_generic_titled dddw.nilisnull=no dddw.percentwidth=227 dddw.lines=20 dddw.required=no dddw.showlist=no dddw.vscrollbar=yes criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=10 ) text(name=reporting_date_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="176" height="52" width="462" text="Reporting Date:" ) text(name=workspace_id_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="264" height="52" width="462" text="Workspace Id:" ) text(name=date_dem_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="352" height="52" width="462" text="Date Dem:" ) column(name=date_dem band=detail id=2 x="517" y="352" height="64" width="503" color="33554432" border="0" alignment="2" format="dd mmm yyyy" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=20 ) text(name=priorite_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="440" height="52" width="462" text="Priorite:" ) column(name=priorite band=detail id=6 x="517" y="440" height="64" width="196" color="33554432" border="0" alignment="1" format="[general]" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=30 ) text(name=cooperation_tool_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="528" height="52" width="462" text="Cooperation Tool:" ) column(name=cooperation_tool band=detail id=7 x="517" y="528" height="48" width="59" color="33554432" border="0" alignment="1" format="[general]" checkbox.lefttext=no checkbox.scale=no checkbox.threed=yes checkbox.text="" checkbox.on="1" checkbox.off="0" criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=40 ) text(name=user_dem_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="616" height="52" width="462" text="User Dem:" ) column(name=user_dem band=detail id=8 x="517" y="616" height="64" width="1486" color="33554432" border="0" alignment="0" format="[general]" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=64 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=45 ) text(name=email_user_demande_t band=detail font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" background.mode="2" background.color="536870912" color="33554432" alignment="1" border="0" x="37" y="704" height="52" width="462" text="Email User Demande:" ) column(name=email_user_demande band=detail id=9 x="517" y="704" height="64" width="1486" color="33554432" border="0" alignment="0" format="[general]" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=64 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=46 ) column(name=reporting_date pointer="Arrow!" tag="?" band=detail id=4 x="521" y="172" height="64" width="1225" color="33554432" border="0" alignment="0" format="[general]" dddw.allowedit=no dddw.autohscroll=no dddw.autoretrieve=yes dddw.useasborder=no dddw.datacolumn=reporting_date dddw.displaycolumn=reporting_date dddw.hscrollbar=no dddw.hsplitscroll=no dddw.imemode=0 dddw.limit=15 dddw.name=dddw_reporting_days dddw.nilisnull=no dddw.percentwidth=100 dddw.lines=5 dddw.required=no dddw.showlist=no dddw.vscrollbar=yes criteria.required=no criteria.override_edit=no crosstab.repeat=no background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=11 ) column(name=workspace_id pointer="Arrow!" tag="select workspace_id as code, name as description from workspaces" band=detail id=5 x="521" y="256" height="72" width="1224" color="33554432" border="0" alignment="0" format="[general]" dddw.allowedit=no dddw.autohscroll=no dddw.autoretrieve=yes dddw.useasborder=no dddw.datacolumn=code dddw.displaycolumn=description dddw.hscrollbar=no dddw.hsplitscroll=no dddw.imemode=0 dddw.limit=100 dddw.name=dddw_generic_titled dddw.nilisnull=no dddw.percentwidth=0 dddw.lines=10 dddw.required=no dddw.showlist=no dddw.vscrollbar=yes criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="0" background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=12 ) column(name=id_dem visible="1" pointer="Arrow!" band=detail id=1 x="1960" y="4" height="64" width="1486" color="33554432" border="0" alignment="0" format="[general]" protect="0" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=64 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=yes edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=1 ) column(name=code_etat visible="1" pointer="Arrow!" band=detail id=10 x="1960" y="88" height="64" width="1486" color="33554432" border="0" alignment="0" format="[general]" protect="1" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=64 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=yes edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.color="1073741824" font.charset="0" font.face="Tahoma" font.family="2" font.height="-8" font.italic="0" font.pitch="2" font.strikethrough="0" font.weight="400" font.underline="0" tabsequence=10 ) htmltable(border="0" cellPadding="1" cellSpacing="1" generateCSS="no" noWrap="no" ) htmlgen() xhtmlgen() cssgen() xmlgen() xsltgen() jsgen() export.xml(metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 ) export.xhtml()
PS : C'est du code qui est généré depuis un outil de finance, Il se sert de Powerbuilder pour créer des interface.
Hors ligne
il faut ajouter ce code au moment où tu fais un InsertRow dans la DW
NB : pour les bouts de code PB : (je fais la modif dans ton post, tu pourras l'éditer pour regarder comment ça fonctionne )
Hors ligne
Pages: 1