UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Example In the following example, the transaction process aborts if var is 0: 1-875 UniBasic Commands Reference TRANSACTION START THEN PRINT "Transaction started." ELSE PRINT "Transaction start failed, STATUS = ":STATUS(): STOP READU var FROM file.var, record1 var += 2 IF var = 0 THEN TRANSACTION ABORT; GOTO ERR: WRITE var TO file.var, record1 TRANSACTION COMMIT THEN PRINT "Transaction committed." ELSE PRINT "Transaction Aborted, STATUS = ":STATUS(); STOP Related Commands UniBasic TRANSACTION COMMIT, TRANSACTION START
TRANSACTION COMMIT Syntax TRANSACTION COMMIT {THEN statements [END] | ELSE statements [END]} Description The UniBasic TRANSACTION COMMIT command concludes the active transaction. UniData writes all pending writes to the appropriate files. You must specify a THEN clause or an ELSE clause. You can specify both clauses. UniData performs the following steps during a transaction commit: Disables the interrupt key. Writes all updates. Releases all record locks locked inside the transaction. Executes the THEN clause if it exists. Enables the interrupt key. Warning: When including WRITE statements within a transaction, you must code an ON ERROR clause that takes appropriate action to notify the user and stop the transaction. If the transaction is not aborted by the ON ERROR clause, processing continues, and the transaction will commit inappropriately. TRANSACTION COMMIT 1-876
- Page 894 and 895: For complete details about the SQLS
- Page 896 and 897: 1-854 UniBasic Commands Reference C
- Page 898 and 899: Parameter Description tablename Nam
- Page 900 and 901: TYPE Smallint Not null 1-858 UniBas
- Page 902 and 903: SQLTables Syntax status = SQLTables
- Page 904 and 905: Return Values The following table d
- Page 906 and 907: Parameters The following table desc
- Page 908 and 909: SQRT Syntax SQRT(num.expr) Descript
- Page 910 and 911: SSUB Syntax SSUB(x, y) Description
- Page 912 and 913: STOP Syntax STOP [expr] Description
- Page 914 and 915: STR Syntax STR(str.expr, num.expr)
- Page 916 and 917: STRS Syntax STRS(dyn.array, expr) D
- Page 918 and 919: If the response status indicates th
- Page 920 and 921: SUBROUTINE Syntax SUBROUTINE sub.na
- Page 922 and 923: SUBROUTINE (Update Trigger) Syntax
- Page 924 and 925: Tip: The UniBasic STATUS function r
- Page 926 and 927: SUBROUTINE (Delete Trigger) Syntax
- Page 928 and 929: Tip: The UniBasic STATUS function r
- Page 930 and 931: Related Commands UniBasic DEL, INSE
- Page 932 and 933: Examples In the following example,
- Page 934 and 935: In the next example, SWAP does not
- Page 936 and 937: Parameter Description 1-894 UniBasi
- Page 938 and 939: Parameter Description 1-896 UniBasi
- Page 940 and 941: TAN Syntax TAN(num.expr) Descriptio
- Page 942 and 943: TIMEDATE Syntax TIMEDATE( ) Descrip
- Page 946 and 947: Parameters The following table desc
- Page 948 and 949: TRANSACTION START Syntax TRANSACTIO
- Page 950 and 951: TRIM Syntax TRIM(str.expr[,char[,ty
- Page 952 and 953: Related Commands UniBasic TRIMB, TR
- Page 954 and 955: TRIMF Syntax TRIMF(str.expr) Descri
- Page 956 and 957: Example In the following example, t
- Page 958 and 959: Parameters The following table desc
- Page 960 and 961: UNLOCK Syntax UNLOCK [num.expr] Des
- Page 962 and 963: UPCASE Syntax UPCASE(string.expr) D
- Page 964 and 965: Related Commands UniBasic PAUSE Uni
- Page 966 and 967: STATUS Function Return Values After
- Page 968 and 969: Related Commands UniBasic CLOSESEQ,
- Page 970 and 971: 1-903 UniBasic Commands Reference
- Page 972 and 973: Related Commands UniBasic CLOSE, DE
- Page 974 and 975: UniData SQL SELECT - For informatio
- Page 976 and 977: Parameter Description Example In th
- Page 978 and 979: Parameter Description Example In th
- Page 980 and 981: The following table describes the r
- Page 982 and 983: Parameters The following table desc
- Page 984 and 985: WRITEU Syntax WRITEU expr {ON | TO}
- Page 986 and 987: Return Value Description Example In
- Page 988 and 989: Parameters The following table desc
- Page 990 and 991: The following example is taken from
- Page 992 and 993: Parameters The following table desc
Example<br />
In the following example, the transaction process aborts if var is 0:<br />
1-875 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
TRANSACTION START<br />
THEN PRINT "Transaction started."<br />
ELSE PRINT "Transaction start failed, STATUS = ":STATUS(): STOP<br />
READU var FROM file.var, record1<br />
var += 2<br />
IF var = 0 THEN TRANSACTION ABORT; GOTO ERR:<br />
WRITE var TO file.var, record1<br />
TRANSACTION COMMIT<br />
THEN PRINT "Transaction committed."<br />
ELSE PRINT "Transaction Aborted, STATUS = ":STATUS(); STOP<br />
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
TRANSACTION COMMIT, TRANSACTION START