11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

In the following example, the program segment executes a UniData SQL statement<br />

and stores the output in an internal result file called SQL_INPUT. The<br />

READNEXTTUPLE statement then reads the records stored in SQL_INPUT until<br />

the last record item is read. The process converts the attribute marks to spaces and<br />

prints each record read.<br />

1-634 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

OUT.COMMAND = "SELECT NAME, ADDRESS, CITY"<br />

OUT.COMMAND := " FROM CLIENTS TO SQL_INPUT; "<br />

EXECUTESQL OUT.COMMAND<br />

DONE = 0<br />

BPIOCP<br />

LOOP<br />

READNEXTTUPLE CLIENT.REC FROM "SQL_INPUT" ELSE<br />

DONE = 1<br />

END<br />

UNTIL DONE DO<br />

CONVERT @AM TO " " IN CLIENT.REC<br />

CONVERT @VM TO","IN CLIENT.REC<br />

PRINT CLIENT.REC<br />

REPEAT<br />

END<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

EXECUTE, EXECUTESQL<br />

UniData SQL<br />

SELECT – For information, see Using UniData SQL.

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

Saved successfully!

Ooh no, something went wrong!