Parameters:
CS_CMD_SUCCEED | The success of a command that returns no data |
CS_CMD_DONE | The results of a command have been completely processed. |
CS_CMD_FAIL | The server encountered an error while executing a command |
CS_ROW_RESULT | Regular row results |
CS_PARAM_RESULT | Parameter results |
CS_STATUS_RESULT | Stored procedure return status results. |
CS_COMPUTE_RESULT | Compute row results |
If the result type is neither CS_ROW_RESULT,CS_PARAM_RESULT, CS_STATUS_RESULT nor CS_COMPUTE_RESULT, then it returns nil
If the result type is neither CS_ROW_RESULT nor CS_PARAM_RESULT, then it returns nil
## exec sp_who ## query.sql("sp_who") ## gets the first row result ## res=query.top_row_result # res is a SybResult object ## print column names. ## print res.columns.join(','),"\n" --> spid,status,loginame,hostname,blk,dbname,cmd ## print row data ## res.rows.each{|r| print r.join(','), "\n"} --> 1,running ,sa , ,0 ,master ,SELECT 2,sleeping ,, ,0 ,master ,NETWORK HANDLER 3,sleeping ,, ,0 ,master ,DEADLOCK TUNE 4,sleeping ,, ,0 ,master ,MIRROR HANDLER 5,sleeping ,, ,0 ,master ,HOUSEKEEPER 6,sleeping ,, ,0 ,master ,CHECKPOINT SLEEP ## using column number ## print res.nthrow(0,1),"\n" --> "running " ## Using column name ## print res.nthrow(5,"cmd"),"\n" --> "CHECKPOINT SLEEP"
Returns: