Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Will SQL Server 2014 Support to Read BLOB (Byte Array) Expand / Collapse
Author
Message
Posted Monday, December 16, 2013 12:51 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:58 PM
Points: 36,794, Visits: 31,253
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1523108
Posted Monday, December 16, 2013 12:54 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:58 PM
Points: 36,794, Visits: 31,253
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1523109
Posted Tuesday, December 17, 2013 9:29 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 2:31 AM
Points: 332, Visits: 1,123
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.
Post #1523930
Posted Tuesday, December 17, 2013 10:49 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:58 PM
Points: 36,794, Visits: 31,253
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1523944
Posted Thursday, December 19, 2013 7:04 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:18 AM
Points: 7,056, Visits: 6,822
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.

Post #1524564
Posted Monday, December 23, 2013 1:45 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 2:31 AM
Points: 332, Visits: 1,123
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
Post #1525437
Posted Monday, December 23, 2013 1:54 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 2:31 AM
Points: 332, Visits: 1,123
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..!
Post #1525440
Posted Monday, December 23, 2013 5:15 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:58 PM
Points: 36,794, Visits: 31,253
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1525479
Posted Thursday, December 26, 2013 4:31 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 2:31 AM
Points: 332, Visits: 1,123
Pasting couple of rows is not a problem but what is the logic...?
Post #1525943
Posted Thursday, December 26, 2013 5:02 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:58 PM
Points: 36,794, Visits: 31,253
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1525944
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse