%SelectAll meta-SQL element

Syntax

%SelectAll(:num [ correlation _id])

Description

%SelectAll is shorthand for selecting all fields in the specified record, wrapping DateTime fields with %DateOut, %TimeOut, and so on.

The pseudocode looks like this:

Select(AllFields, :num correlation_id) from %Table(:num) prefix

This shortcut is only appropriate if the statement is being used in PeopleCode or Application Engine to read data into memory. Dynamic views should retain the internal database formats for DateTime fields.

Using %SelectAll with CreateSQL

You can use %SelectAll with the CreateSQL function without a record object. It must subsequently be executed with the record object with which you want to do the Select statement. Here is an example:

    &REC_PROJ_FUNDING = CreateRecord(Record.PROJ_FUNDING); /* free standing record
 object */ 
    /* Create SQL objects */ 
    &SQL_PROJ_FUNDING_SEL = CreateSQL("%SelectAll(:1)" /* bind this later */); 
        /* bind the %SelectAll */ 
        &SQL_PROJ_FUNDING_SEL.Execute(&REC_PROJ_FUNDING); 
    While &SQL_PROJ_FUNDING_SEL.Fetch(&REC_PROJ_FUNDING);
		/* Process row content ... /*
		End-While; 

You could also move the CreateRecord SQL statements out of the loop (and then move the close statements out of the loop too).