$dbproc->dbcmd($the_sql_cmd); # possibly add more commands to the SQL buffer with additional # dbcmd() calls # Send the command(s) to the server $dbproc->dbsqlexec; # Process all the results while($dbproc->dbresults != NO_MORE_RESULTS) { # Process any rows that might be returned: while(@data = $dbproc->dbnextrow) { ..... # do something with the data } }