11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsSET ^a(1)="[- - -]",^b(1)="[- - -]"WRITE !,"level:",$TLEVEL," ",^a(1)," ",^b(1)TSTARTLOCK +^a(1)SET ^a(1)="hello"WRITE !,"level:",$TLEVEL," ",^a(1)," ",^b(1)TSTARTLOCK +^b(1)SET ^b(1)="world"WRITE !,"level:",$TLEVEL," ",^a(1)," ",^b(1)TCOMMITWRITE !,"After TCOMMIT"WRITE !,"level:",$TLEVEL," ",^a(1)," ",^b(1)TROLLBACKWRITE !,"After TROLLBACK"WRITE !,"level:",$TLEVEL," ",^a(1)," ",^b(1)QUITThe following example transfers money from one account to another as a transaction:// Transfer funds from one account to anotherTransfer(from,to,amount) {TSTARTSET ^ACCOUNT(from,"Balance") = ^ACCOUNT(from,"Balance") - amountSET ^ACCOUNT(to,"Balance") = ^ACCOUNT(to,"Balance") + amountTCOMMITQUIT}See Also• TCOMMIT command• TROLLBACK command• $TLEVEL special variable• Using <strong>ObjectScript</strong> for Transaction Processing in Using <strong>Caché</strong> <strong>ObjectScript</strong>144 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!