I am not sure what you are asking. If you want the column to have a default value when you retrieve the data you can set it in the SQL. In PB 6.5 you can set an initial value in the "Column Specifications" menu item under Row. In PB 7 and 8 "Column Specifications" is in the View menu item. Depending on what version of PB you are using there are other ways. If you still need help let me know what version of PowerBuilder you are using and what you want to do and I will try to help.
You need to scan the System tables in your RDBMS to find the default values for the columns using some embded-SQL. In Oracle, the name of the table/view that stores this info is: ALL_TAB_COLUMNS (you need to figure our the System table/view name for other RDBMSs). So, your SQL should look something similar to this:
//////////////////////////////////////////////////////////
SELECT DATA_DEFAULT INTO :<var>
FROM ALL_TAB_COLUMNS
WHERE OWNER = <owner> AND
TABLE_NAME = <table> AND
COLUMN_NAME = <col>
USING SQLCA ;
//
IF SQLCA.SQLCode = 0 THEN
dw.Object.<col>.[ row ] = <var>
END IF ;
//////////////////////////////////////////////////////////
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.