Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread GUID Field
Thu, Apr 18 2013 6:19 PMPermanent Link

Owen

I am running some SQL and exporting the results.  Our part number is stored in a GUID field.  How can I translate a GUID field so when I export the result set to a file I get a  number rather than a bunch of hexadecimal digits.  I am running the SQL from the Database System Utility.   
Fri, Apr 19 2013 4:17 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Owen


>I am running some SQL and exporting the results. Our part number is stored in a GUID field. How can I translate a GUID field so when I export the result set to a file I get a number rather than a bunch of hexadecimal digits. I am running the SQL from the Database System Utility.

I don't know of anything built into DBISAM. I'm curious what sort of number do you want and why?

Roy Lambert [Team Elevate]
Fri, Apr 19 2013 4:46 AMPermanent Link

Matthew Jones

I may be wrong, but I don't think Delphi has a 128 bit numeric type. Thus you can't
get it as a number ever. And DBISAM stores the GUID as up to 38 bytes, which is
essentially the text version. Thus you can actually store any string you want - it
just is able to store a GUID. Fundamentally, you need to handle the GUID as a
string.

/Matthew Jones/
Fri, Apr 19 2013 8:17 PMPermanent Link

Owen

I was pulling some data, running a SQL against our inventoryitem table.  It comes back with a result set like this:
{00045754-8C38-47E1-8E1A-C45A4E4DDEA6} = Item ID
HAR 7412.10 = UPC

The inventory ItemID is our internal partnumber that we use.  So, I was hoping to translate the field so it would display correctly as 11366.  I don't understand how the GUID translate into a number.  
Sat, Apr 20 2013 8:02 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Owen


>I was pulling some data, running a SQL against our inventoryitem table. It comes back with a result set like this:
>{00045754-8C38-47E1-8E1A-C45A4E4DDEA6} = Item ID
>HAR 7412.10 = UPC
>
>The inventory ItemID is our internal partnumber that we use. So, I was hoping to translate the field so it would display correctly as 11366. I don't understand how the GUID translate into a number.

The bad news is that it shouldn't be possible. GUIDs are generated sort of randomly from things like the MAC address of the computer and the time it was generated.

The most likely thing is that the actual part number is held elsewhere and that the GUID is used internally as a link. I would expect to see a lot more in an inventory item table than you show above so its possible that this is a transaction or pricing table.

Without the source code you have a significant problem. Your best start point is to look at all the tables and try and guess the relationships between them from the field names and the data.

Roy Lambert [Team Elevate]
Mon, Apr 22 2013 4:37 AMPermanent Link

Matthew Jones

> The inventory ItemID is our internal partnumber that we use.  So, I
> was hoping to translate the field so it would display correctly as
> 11366.  I don't understand how the GUID translate into a number.  

As Roy says, there is no relationship between the GUID and that number. There must
be a field with that somewhere else. You want to do a SELECT * FROM <yourtable> for
each table and see what the values are and the relationships between them.

/Matthew Jones/
Tue, Apr 23 2013 11:20 AMPermanent Link

Owen

Thanks everyone, I will dig a little deaper and try to find the itemID in another table.  
Image