Wednesday, October 5, 2011

Powerbuilder Object Naming Standards

Listed below, only that i seldom used in my PB application for my quick reference :-
What about the rest?...hmmm...here's a link for more detail,
He's one of my favourite 'Guru'.

OBJECT PREFIX
ArrayBounds ab_
CheckBox cbx_
CommandButton cb_
Datastore ds_
Datawindow dw_
DatawindowChild dwc_
DragObject drg_
DropDownListBox ddlb_
DropDownPictureListBox ddplb_
dwObject dwo_
EditMask em_
Function f_
Graph gr_
GroupBox gb_
HScrollBar hsb_
Line li_
ListBox lb_
ListView lv_
ListViewItem lvi_
MailFileDescription mfd
MailMessage mm_
MailRecipient mr_
MailSession ms_
MDIFrame mdi_
Menu m_
MultiLineEdit mle_
NonVisualObject nvo_
OLEObject oo_
Oval ov
Picture p_
PictureButton pb_
PictureListBox plb_
Pipeline pl_
RadioButton rb_
Rectangle rec_
RichTextEdit rte_
RoundRectange rr_
SingleLineEdit sle_
StaticText st_
Structure str_
Tab tab_
TabPage tabpage_
Transaction tr_
Treeview tv_
TreeviewItem tvi_
UserObject uo_
VerticalScrollBar vsb_
Window w_
WindowObject wo_

Tuesday, October 4, 2011

Powerbuilder Variable Naming Standards - Datatypes

Variable Declaration prefix Standard :-

argument a
Global g
Instance i
Local l
Shared s

DataType prefix :-
VARIABLE TYPEPREFIXGLOBALINSTANCELOCAL
Anyaga_varnameia_varnamela_varname
Blobblbgblb_varnameiblb_varnamelblb_varname
Booleanbgb_varnameib_varnamelb_varname
Charactercgc_varnameic_varnamelc_varname
Datedgd_varnameid_varnameld_varname
DateTimedtgdt_varnameidt_varnameldt_varname
Decimaldecgdec_varnameidec_varnameldec_varname
Doubledbgdb_varnameidb_varnameldb_varname
Integerigi_varnameii_varnameli_varname
Longlgl_varnameil_varnamell_varname
Realrgr_varnameir_varnamelr_varname
Stringsgs_varnameis_varnamels_varname
Timetmgtm_varnameitm_varnameltm_varname
Unsigned Integeruigui_varnameiui_varnamelui_varname
Unsigned Longulgul_varnameiul_varnamelul_varname

Sunday, October 2, 2011

Oracle SQL Multiple Rows Return One Row


//Data table DRIVERHP :-

STAFNO | CONTACTNO
---------------------------------
STAF1 11122
STAF1 44455
STAF2 33344
STAF3 66677
STAF3 88888
STAF3 99988

//works on 10g
//the Select Statement 1 :-

SELECT F.STAFNO, RTRIM(XMLAGG(XMLELEMENT(J, F.CONTACTNO,', ')).EXTRACT('//text()'),', ') AS CONTACTNOS
FROM DRIVERHP F
GROUP BY F.STAFNO

//select statement 2 :-
SELECT F.STAFNO, WM_CONCAT(F.CONTACTNO) AS CONTACTNOS
FROM  DRIVERHP F
GROUP BY F.STAFNO

//SQL output :-

STAFNO | CONTACTNOS
---------------------------------------------------------------------
STAF1 11122, 44455
STAF2 33344
STAF3 66677, 88888, 99988