Index  Up  <<  >>  


[sql ...]

named: [sql hash] SQL [/sql identifier*]

A complete hash of hashes, suitable for eval by Perl, can be returned by this query. This tag pair encloses any valid SQL query, and returns the results (if any) as a string representing rows and columns, in Perl associative array, or hash, syntax. If placed in an embedded Perl area as:

 [perl]

    my $string =<<'EOF';
 [sql hash]select * from arbitrary where code <= '19'[/sql]

 EOF
    my $hash = eval $string;
    my $out = '';
    my $key;
    foreach $key (keys %$hash) {
        $out .= $key->{field1};
        $out .= "<BR>";
    }
    $out;

 [/perl]


Index  Up  <<  >>