Support selecting reference type scalar value

There are many TODOs... :<

  * Error checkes are missing.
  * Blob types are only supported.
  * Make code clear!!!