UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
WRITEU Syntax WRITEU expr {ON | TO} [file.var,] record.ID.expr [ON ERROR statements] Description The UniBasic WRITEU command writes a record to a file without releasing locks. WRITEU writes regardless of lock status. Note: UniBasic locks are advisory only. For more information, see Developing UniBasic Applications. Warning: Do not use UniBasic READ and WRITE commands to open or modify binary data in DIR-type files (for example, BP). Doing so can corrupt data in the file. Instead, use OSREAD or OSBREAD after executing the UniBasic NOCONVERT command. Updating Alternate Key Indexes Remember the following points about alternate key indexes when you code WRITEU statements: 1-917 UniBasic Commands Reference Alternate key indexes that are currently enabled are automatically updated when you write a record. If you execute the ECL command DUP.STATUS ON, and then write a record that creates a duplicate alternate key, WRITEU sets the STATUS return value to 10. If the NO.DUPS keyword was specified when the alternate key index was created, UniBasic will not write a record that would create a duplicate index key. Instead, the ON ERROR clause executes (or the program aborts if ON ERROR is not coded) and the STATUS function returns a value of 10. RFS does not support NO.DUPS.
Parameters The following table describes each parameter of the syntax. Parameter Description expr Specifies an expression to write to the file. ON | TO file.var, Specifies a file to receive the expression. If you do not specify a file.var, UniData writes to the default file. If no default file is open, a fatal WRITEU error occurs. A default file is one for which no file variable is assigned in the OPEN statement. record.ID.expr Specifies a record to receive the expression. ON ERROR statements Specifies statements to execute if the WRITEU statement fails with a fatal error (such as the file is not open, an I/O error occurs in the write process, or the record contains a duplicate alternate index key). If the transaction is not aborted by the ON ERROR clause, processing continues, and the transaction could commit inappropriately. WRITEU Parameters STATUS Function Return Values After you execute WRITEU, the STATUS function returns one of the values described in the following table. Return Value Description 0 Successful write. 1 System error, such as a damaged file. STATUS Function Return Values WRITEU 1-918
- 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 944 and 945: Example In the following example, t
- 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 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
- Page 994 and 995: C:\Program Files\Adobe\FrameMaker8\
- Page 996 and 997: C:\Program Files\Adobe\FrameMaker8\
- Page 998 and 999: C:\Program Files\Adobe\FrameMaker8\
- Page 1000 and 1001: C:\Program Files\Adobe\FrameMaker8\
- Page 1002 and 1003: C:\Program Files\Adobe\FrameMaker8\
- Page 1004 and 1005: C:\Program Files\Adobe\FrameMaker8\
- Page 1006 and 1007: C:\Program Files\Adobe\FrameMaker8\
- Page 1008 and 1009: C:\Program Files\Adobe\FrameMaker8\
- Page 1010 and 1011: C:\Program Files\Adobe\FrameMaker8\
- Page 1012 and 1013: C:\Program Files\Adobe\FrameMaker8\
- Page 1014 and 1015: C:\Program Files\Adobe\FrameMaker8\
- Page 1016 and 1017: C:\Program Files\Adobe\FrameMaker8\
- Page 1018 and 1019: C:\Program Files\Adobe\FrameMaker8\
- Page 1020 and 1021: C:\Program Files\Adobe\FrameMaker8\
- Page 1022 and 1023: C:\Program Files\Adobe\FrameMaker8\
- Page 1024 and 1025: C:\Program Files\Adobe\FrameMaker8\
- Page 1026 and 1027: C:\Program Files\Adobe\FrameMaker8\
- Page 1028 and 1029: C:\Program Files\Adobe\FrameMaker8\
- Page 1030 and 1031: C:\Program Files\Adobe\FrameMaker8\
- Page 1032 and 1033: C:\Program Files\Adobe\FrameMaker8\
WRITEU<br />
Syntax<br />
WRITEU expr {ON | TO} [file.var,] record.ID.expr [ON ERROR statements]<br />
Description<br />
The <strong>UniBasic</strong> WRITEU command writes a record to a file without releasing locks.<br />
WRITEU writes regardless of lock status.<br />
Note: <strong>UniBasic</strong> locks are advisory only. For more information, see Developing<br />
<strong>UniBasic</strong> Applications.<br />
Warning: Do not use <strong>UniBasic</strong> READ and WRITE commands to open or modify<br />
binary data in DIR-type files (for example, BP). Doing so can corrupt data in the file.<br />
Instead, use OSREAD or OSBREAD after executing the <strong>UniBasic</strong> NOCONVERT<br />
command.<br />
Updating Alternate Key Indexes<br />
Remember the following points about alternate key indexes when you code WRITEU<br />
statements:<br />
1-917 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
Alternate key indexes that are currently enabled are automatically updated<br />
when you write a record.<br />
If you execute the ECL command DUP.STATUS ON, and then write a<br />
record that creates a duplicate alternate key, WRITEU sets the STATUS<br />
return value to 10.<br />
If the NO.DUPS keyword was specified when the alternate key index was<br />
created, <strong>UniBasic</strong> will not write a record that would create a duplicate index<br />
key. Instead, the ON ERROR clause executes (or the program aborts if ON<br />
ERROR is not coded) and the STATUS function returns a value of 10. RFS<br />
does not support NO.DUPS.