Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Will SQL Server 2014 Support to Read BLOB (Byte Array)


Will SQL Server 2014 Support to Read BLOB (Byte Array)

Author
Message
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45079 Visits: 39910
yuvipoy (12/15/2013)
Jeff Moden (12/15/2013)
There's a reason why these things are called "BLOBS". Splitting fixed length, fixed field blobs is nearly trivial if you know the "record layout" but when you add VARCHAR or any other variable length datatype to the mix, it isn't going to work unless there's an embedded delimiter in the data or something that identifies the start of each field for every row.


There are no embedded delimiter only byte size is there.
Only byte len is the starting point of every column.
Based on the BYTE sizeneed to split the BLOB.


Ok... so where is that information stored and is it stored for every row so you can do variable length columns?

Shifting gears, it would really be nice if you took a look at the first link under "Helpful Links" in my signature line below

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45079 Visits: 39910
yuvipoy (12/15/2013)
Some thing like
http://www.java2s.com/Tutorial/Oracle/0660__Large-Objects/0080__CLOB.htm
Byte array to number

Thanks!


I don't actually see anything helpful in there for this... especially since I'm doing my damnedest to forget everything I ever learned about Oracle. :-)

Like I said, see the first link in my signature line below

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
yuvipoy
yuvipoy
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 1312
Ok... so where is that information stored and is it stored for every row so you can do variable length columns?

The information will be stored in a BLOB table as byte arrays (junk characters) need to convert it to the original format.
If you put some thing like this in Oracle
Select utl_raw.cast_to_varchar2(utl_raw.CAST_FROM_BINARY_INTEGER(87987)) from dual;
you will be getting the o/p something as

W'
The above is the input for me. i need to read and convert back them.
convert to original format as 87987.
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45079 Visits: 39910
yuvipoy (12/17/2013)
Ok... so where is that information stored and is it stored for every row so you can do variable length columns?

The information will be stored in a BLOB table as byte arrays (junk characters) need to convert it to the original format.
If you put some thing like this in Oracle
Select utl_raw.cast_to_varchar2(utl_raw.CAST_FROM_BINARY_INTEGER(87987)) from dual;
you will be getting the o/p something as

W'
The above is the input for me. i need to read and convert back them.
convert to original format as 87987.


Perhaps this is due to a language barrier problem. Maybe giving Oracle examples will help someone else but it doesn't help me at all. And I also can't help at all unless I know what the field lengths of the data are and what datatypes there will be. And that's only for the fixed fields. There has to be something for each and every row that identifies the starting position for all fields if any variable length data is preset.

Do you have such data? If so, would you mind sharing it with us so we can try to help you with your problem?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
David Burrows
David Burrows
SSCertifiable
SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)

Group: General Forum Members
Points: 7965 Visits: 9417

DECLARE @test varchar(max)
SET @test = CHAR(1)+CHAR(87)+CHAR(179)
SELECT CAST(CAST(SUBSTRING(@test,1,3) as varbinary(3)) as int)




Far away is close at hand in the images of elsewhere.

Anon.


yuvipoy
yuvipoy
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 1312
Similiar thing for flaot values can we get..!
for decimal values is it is possible...

Select utl_raw.cast_to_varchar2(utl_raw.CAST_FROM_BINARY_FLOAT(.2635)) from dual;

>†éy
yuvipoy
yuvipoy
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 1312
David Burrows (12/19/2013)

DECLARE @test varchar(max)
SET @test = CHAR(1)+CHAR(87)+CHAR(179)
SELECT CAST(CAST(SUBSTRING(@test,1,3) as varbinary(3)) as int)



how do u made CHAR(1)+CHAR(87)+CHAR(179) on which factor u decide if it is a dynamic one then how will u do
how to do it for vice versa...

Thanks for your suggestion..!
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45079 Visits: 39910
yuvipoy (12/23/2013)
David Burrows (12/19/2013)

DECLARE @test varchar(max)
SET @test = CHAR(1)+CHAR(87)+CHAR(179)
SELECT CAST(CAST(SUBSTRING(@test,1,3) as varbinary(3)) as int)



how do u made CHAR(1)+CHAR(87)+CHAR(179) on which factor u decide if it is a dynamic one then how will u do
how to do it for vice versa...

Thanks for your suggestion..!


If you would post a couple of rows of data and tell us what they contain, this could be all over in a minute or two. ;-)

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
yuvipoy
yuvipoy
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 1312
Pasting couple of rows is not a problem but what is the logic...?
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45079 Visits: 39910
yuvipoy (12/26/2013)
Pasting couple of rows is not a problem but what is the logic...?


Post the couple of rows and tell me what's in them and then we'll see what we can do. ;-)

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search