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
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
Hi,
Will SQL Server 2014 Support to Read BLOB.
As we see in oracle we have some concept called DBMS_LOB.
Where the byte array data are stored in a BLOB data type and based on the size we can read the data and convert it to the number or float or what ever data type.
In oracle there are some utilities are there utl_raw.cast_from to read or write the byte array.
Do SQL server is having those functions?
If not is SQL Server having plan to do so?

Thanks!

Wish u all Happy Christmas in advance.....!
Elliott Whitlow
Elliott Whitlow
SSCertifiable
SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)

Group: General Forum Members
Points: 6208 Visits: 5314
You can do some conversion from varbinary(max). But I guess the question is, what are you trying to do? What is your goal?

CEWII
Grant Fritchey
Grant Fritchey
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17580 Visits: 32260
I'm not an Oracle person, so my understanding here may be grossly inadequate, but the short answer is No.

The longer answer is, I think, that you're doing lots and lots of CLOB and BLOB storage in Oracle to get around limitations in the VARCHAR and VARBINARY fields. We don't have those same limitations within SQL Server. So, as was noted, you can use VARBINARY(MAX) or VARCHAR(MAX) to store large binary or text objects, but still have the full functions associated with those data types. There wouldn't then be a need for all the functions associated with DBMS_LOB.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
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
as i said i need to split byte-array based on the size.

say there are 3 columns in a table.
i am having the information in the byte array format
i need to extract those format and insert in to the table.
for first column 4 bytes second column 2 bytes third 8 bytes.
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: 45038 Visits: 39893
yuvipoy (12/14/2013)
as i said i need to split byte-array based on the size.

say there are 3 columns in a table.
i am having the information in the byte array format
i need to extract those format and insert in to the table.
for first column 4 bytes second column 2 bytes third 8 bytes.


What is the ultimate datatype of those 3 columns?

--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
Jeff Moden (12/14/2013)
yuvipoy (12/14/2013)
as i said i need to split byte-array based on the size.

say there are 3 columns in a table.
i am having the information in the byte array format
i need to extract those format and insert in to the table.
for first column 4 bytes second column 2 bytes third 8 bytes.


What is the ultimate datatype of those 3 columns?


So what ever it may be it may be Int , float, Bigint

or even varchar
String data conversion to a varchar data type in DB
the bytearray will be having float,smallint,bigint
or
the bytearray will be having float,smallint,String with 8 bytes
is there option to split based on the size...?
LutzM
LutzM
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 7001 Visits: 13559
can you provide a test scenario so we can better understand what you're trying to do?



Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
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: 45038 Visits: 39893
yuvipoy (12/15/2013)
Jeff Moden (12/14/2013)
yuvipoy (12/14/2013)
as i said i need to split byte-array based on the size.

say there are 3 columns in a table.
i am having the information in the byte array format
i need to extract those format and insert in to the table.
for first column 4 bytes second column 2 bytes third 8 bytes.


What is the ultimate datatype of those 3 columns?


So what ever it may be it may be Int , float, Bigint

or even varchar
String data conversion to a varchar data type in DB
the bytearray will be having float,smallint,bigint
or
the bytearray will be having float,smallint,String with 8 bytes
is there option to split based on the size...?




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.

--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
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.
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
Some thing like
http://www.java2s.com/Tutorial/Oracle/0660__Large-Objects/0080__CLOB.htm
Byte array to number

Thanks!
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