Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: MSSQL Binary Field Max Size

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default MSSQL Binary Field Max Size

    Hi All!

    What is the maximum size I can safely make a binary field... I only have two of these fields in just one table in the whole application.


    Thank you!
    Oscar

  2. #2
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,124

    Default Re: MSSQL Binary Field Max Size

    I use 16336

    When you are reading into that field you have to read only 16334 bytes in... I don't know why but there is some reason

  3. #3
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,124

    Default Re: MSSQL Binary Field Max Size

    Code:
    Get_Attribute DF_FIELD_LENGTH of R1BIN.FILE_NUMBER 3 to iMaxChunkSize  // this is 16336
     Move (iMaxChunkSize-2) to iMaxChunkSize
                                      
    
    Repeat
                            Set_Channel_Position iChIn to (iPos)
                            If ((iLength-iPos)<iMaxChunkSize) Move (iLength-iPos) to iReadLength
                            Else Move iMaxChunkSize to iReadLength
                         
                            Read_Block channel iChIn MyDoc iReadLength
                            Clear R1BIN 
                            Reread
                               Move iNumber to R1BIN.FILEREP
                               Move (SYSTEM.LAST_FBINARY+1) to R1BIN.Number
                               Move (SYSTEM.LAST_FBINARY+1) to SYSTEM.LAST_FBINARY
                               //Move MyDoc to FBINARY.CONTENT
                               Set_Field_Value R1BIN.File_Number (RefTable(R1BIN.Content)) to MyDoc
                               Move iReadLength to R1BIN.LEngth
                                  SaveRecord SYSTEM R1BIN
                            
                            Unlock
                            
                            Move (iPos+iReadLength) to iPos
                            
                         Until (iPos>=iLength)

  4. #4
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    3,464

    Default Re: MSSQL Binary Field Max Size

    16K is just the default value for LOB/Binary long columns for the DF driver.

    This is to avoid allocating too much memory for the global buffers. But you can just increase it , if you want, by specifying the value in the .int file for the desired column .

    Using newer DF version, you dont even need to increase string argument_size anymore. you can use the uchar array to retrieve the binary information.

    in .int file :

    Code:
    ...
    FIELD_NUMBER 5 
    FIELD_LENGTH 5000000      // 5 Mbi  (the size you have defined in the database) 
    ...
    Samuel Pizarro

  5. #5
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,124

    Default Re: MSSQL Binary Field Max Size

    Thanks Samuel

    Did not know this

  6. #6

    Default Re: MSSQL Binary Field Max Size

    Hi Samuel,

    Thank you for that info... do you know what would be the largest number i could use there? I curreently have 20,000,000 but the first user uploaded a 32.8MB file and of course was unreadable when downloaded.

    I just want to use the biggest number I could without breaking things.

    Regards,
    Oscar

    Quote Originally Posted by Samuel Pizarro View Post
    16K is just the default value for LOB/Binary long columns for the DF driver.

    This is to avoid allocating too much memory for the global buffers. But you can just increase it , if you want, by specifying the value in the .int file for the desired column .

    Using newer DF version, you dont even need to increase string argument_size anymore. you can use the uchar array to retrieve the binary information.

    in .int file :

    Code:
    ...
    FIELD_NUMBER 5 
    FIELD_LENGTH 5000000      // 5 Mbi  (the size you have defined in the database) 
    ...

  7. #7
    Join Date
    Feb 2009
    Posts
    5,100

    Default Re: MSSQL Binary Field Max Size

    You might want to have a good read of this before asking that question

    https://docs.dataaccess.com/dataflex...plications.htm

    Ignore that it is talking about web applications it mostly applies to Windows too in terms of multiple buffers etc
    Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill

  8. #8

    Default Re: MSSQL Binary Field Max Size

    Quote Originally Posted by Focus View Post
    You might want to have a good read of this before asking that question

    https://docs.dataaccess.com/dataflex...plications.htm

    Ignore that it is talking about web applications it mostly applies to Windows too in terms of multiple buffers etc
    Very interesting reading... thank you... it does mention that the minimum is 16KB... but couldn't find anything about a maximum that I can assign... Do I have to assume that there is no maximum as long as I have enough ram in the system to hold the buffers?

    Regards,
    Oscar

  9. #9
    Join Date
    Feb 2009
    Posts
    5,100

    Default Re: MSSQL Binary Field Max Size

    It was more to warn you it's not just one buffer, it is many and you need to do the calculations based on number of DD's and buffer records that use that large field

    Also don't forget the 2GB limit on all 32bit applications for everything they need

    Note as I said these buffer calculations apply to Windows and Web
    Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill

  10. #10

    Default Re: MSSQL Binary Field Max Size

    Quote Originally Posted by Focus View Post
    It was more to warn you it's not just one buffer, it is many and you need to do the calculations based on number of DD's and buffer records that use that large field

    Also don't forget the 2GB limit on all 32bit applications for everything they need

    Note as I said these buffer calculations apply to Windows and Web
    I see... FYI... I tested wtih 200000000 and the program just gave an out of memory... with 100000000 it took a few screens without running into the same issue. I will have to figure out other way to do it... the client wants the files on the database and not on the file system anywhere. I might just create a C# to deal with the saving and retrieving the files... not sure yet.

    Thank you!,
    Oscar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •