Friday, July 8, 2005

Tip of the Day: Assigning Line Numbers for the SELECT Command

Did you know that you can assign the line numbers for the
SELECT command?

Use the (CVAL('ROWCOUNT')) function to achieve that goal.

Here's how:

01. Start R:BASE 7.x or R:BASE V-8 "Turbo" for Windows

02. CONNECT ConComp

03. At the R> Prompt:

    SELECT (INT(CVAL('ROWCOUNT'))) AS LineNo,Company=30, +
   (CustCity+','&CustState&CustZip) AS CityStateZip FROM Customer

    Notice the line counter!

04. If you would like to print that select statement output as PDF,
    use the following example:

    SET VAR vLines = (INT(CVAL('LINES')))
    SET LINES 0
    OUTPUT CustomerList.PDF PDF
    SELECT (INT(CVAL('ROWCOUNT'))) AS LineNo,Company=30, +
   (CustCity+','&CustState&CustZip) AS CityStateZip FROM Customer
    OUTPUT SCREEN
    SET LINES .vLines

   That will send the output as CustomerList.PDF using the
   "built-in" PDF capabilities of R:BASE OUTPUT command.

   Use the LAUNCH CustomerList.PDF command to view the results.

That's all there is to it!

Very Best R:egards,

Razzak.

Reply via email to