hits counter

April 2010


Tech Talk28 Apr 2010 01:10 pm

We just recently hit the following error from Sybase:

“There is insufficient heap memory to allocate -1562977772 bytes. Please increase configuration parameter ‘heap memory per user’ or try again when there is less activity on the system”

when trying to get the results out of Sybase as xml using the “for xml all” function. It works fine normally, until your result sets hit over 500 rows or so. This is due to the heap memory space which most people would be reluctant to change – the query returns your data, by default, as one big row and normally of type TEXT. To get around this, “for xml option “incremental=yes root=yes”" will set each row of results as a separate row coming back. This means that instead of a huge chunk of TEXT coming back, it’ll appear like a normal record set, but instead of the normal data, it’ll appear as xml data.

For more information on XML for Sybase head to http://manuals.sybase.com/onlinebooks/group-as/asg1251e/xmlb/@Generic__BookTextView/4521. The following section is taken from that page and helps explain the “incremental” option.

The result set that a for_xml_select statement returns depends on the incremental option:

incremental = no returns a result set containing a single row and a single column. The column datatype is text. The value of that text column is the SQLX-XML representation of the result of the basic select statement. This is the default option.

incremental = yes returns a result set containing a row for each row of the basic select statement. If the root option specifies yes (the default option), an initial row specifies the opening XML root element, and a final row specifies the closing XML root element.

For example, these select statements return two, one, two, and four rows, respectively:

select 11, 12 union select 21, 22
select 11, 12 union select 21, 22 for xml
select 11, 12 union select 21, 22 for xml option "incremental=yes root=no"
select 11, 12 union select 21, 22 for xml option "incremental=yes root=yes"

Written by Milton Lai.

Development and Personal11 Apr 2010 08:40 pm

It was my long weekend (yes, I realise the long weekend was last week) project to redo my main webpage, which just required a few more photos to be processed but its now all done (except for the software page and a few small user tweaks). The main thing I wanted was a full screen webpage, showing photos, a simple navigation area and a simple backend. I used Supersized for the main background section, jQuery Tools for the menus and a few transitional bits and pieces and a simple php web service to return the images that you want to see – randomised and appropriate for the screen size.
I did just need to push it out otherwise it’d hang around for way too long. I hope to link new photos that I blog up to that page dynamically in the future.
Written by Milton Lai