cTableName = 's073_sites' cString = 'create table ' + cTableName + ' as '+ ; ' select inv_no , id from godlike.s073_qtrvars ' + ; ' group by inv_no , id ' nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK cString = 'alter table ' + cTableName + ; ' add ( cUpdatedBy varchar2(32) null )' nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK cString = 'alter table ' + cTableName + ; ' add ( tLastUpdate date null )' nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK cString = 'alter table ' + cTableName + ; ' add ( nRowID number(9) null )' nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK cString = 'create sequence ' + cTableName +'_uniq ' + ; ' increment by 1 start with 1 nocache ' nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK cString = 'create or replace trigger ' + cTableName + '_t1 ' + chr(13) + ; 'before insert or update on ' + cTableName +' for each row ' + chr(13) + ; 'declare ' + chr(13) + ; ' v_Id Number; ' + chr(13) + ; ' v_Count Number ; ' + chr(13) + ; 'begin ' + chr(13) + ; ' :cUpdatedBy := USER ; ' + chr(13) + ; ' :tLastUpdate := SYSDATE ; ' + chr(13) + ; 'if nRowID is Null or nRowID < 1 then ' + chr(13) + ; 'select ' + cTableName + '_uniq.nextval into vID from dual ; ' + chr(13) + ; ' :nRowID := v_Id ; '+ chr(13) + ; 'end if ' +chr(13) + ; 'end ;' + chr(13) nResult = sqlexec (gnHandle , cString) ? cString ? nResult && Returns 1 - OK?