0

I'm having some issues selecting data from my tables based on their GUID after reading the values into variables in visual basic.

In my database the GUID is stored as a byte array.

I read the GUID from my database using

dim g as guid 
g = New Guid(CType(recData(0).Item(0), Byte()))

The issue I'm having it re-formatting it to select a row based on it.

Essentially, I'm not quite sure how to do the reverse of what I have done here. I've decoded the data to be used in visual basic, but now I'm not sure how to re-encode it to select based on the guid in my oracle database.

I have tried using g.toByteArray() but it does not appear to be correct.

Belgin Fish
  • 19,187
  • 41
  • 102
  • 131
  • Are you seeing the problem of this question? http://stackoverflow.com/questions/7289734/convert-from-oracles-raw16-to-nets-guid – topshot Jun 30 '16 at 17:53
  • 1
    No matter really though since if you pulled 77DB966B620D4FEBB9959D016E0BD590 as the GUID from Oracle you can just use that in the Select statement since Oracle will cast it to a string. For example, `SELECT * FROM MyTable WHERE MyPK = '77DB966B620D4FEBB9959D016E0BD590';` where MyPK is defined as RAW(16) in the table def. – topshot Jun 30 '16 at 18:00
  • I was overthinking the problem, this worked fine @topshot – Belgin Fish Jul 07 '16 at 13:02

0 Answers0