0

I'm trying to run some simple update statements on Cache 2008. Loging into the web portal. I'm able to run queries like:

update testspace.clients 
set requires_attention = 'Yes'
, notes = 'testsdfsd'
where id = '1||CPL62549.001'

The web portal runs and looks like it updated things but when I do a select statement requires_attention is updated but notes isn't.

Both fields are of type string. The only difference is notes is MAXLEN = 32700.

I've tested this on other columns in other tables. Any string column with MAXLEN = 32700 wont let me update it. Seems odd. Perhaps this is a coincidence and something else is going on. Seems strange that I can update some fields of a record but not others.

any ideas?

I'm new to cache but have experience with SQL Server, Oracle, MySQL, etc.

Vlasec
  • 5,500
  • 3
  • 27
  • 30
AaronS
  • 425
  • 1
  • 5
  • 10

1 Answers1

1

Strings in Cache are limited to 32000 characters. Setting the MAXLEN to a number greater than that is going to cause problems.

Set the MAXLEN to 32000 and it should be fine.

Brandon Horst
  • 1,921
  • 16
  • 26
  • Well that's odd. At my new shop table creation is normally done through the UI. When I set the fields to be "scrolling text" that is the value the UI puts in them. I had tried changing the values but it didn't seem to do anything. I'll try again. – AaronS Jul 09 '13 at 22:25
  • Well that can't be all there is to it. I decided to start from scratch and am working through the tutorial in the cache studio documentation. Class AaronPhoneBook.Person Extends %Persistent [ SqlTableName = Person ] { Property Name As %String; Property Notes As %String(MAXLEN = 32000); Property Notes2 As %String(MAXLEN = 37000); } insert AaronPhoneBook.Person (Name, Notes, Notes2) VALUES ('test', 'tests1', 'test2') select * from AaronPhoneBook.Person update AaronPhoneBook.Person set notes = 'test4' , notes2 = 'test5' where id = 1 all works like it should. – AaronS Jul 09 '13 at 22:48
  • yuk I guess formatting didn't work. Anyway created object with two fields one 32000 on 37000. I was able to do insert and update just like I would have thought. There must be something else going on. – AaronS Jul 09 '13 at 22:53
  • Make sure you purge cached queries after changing a class. Do $system.OBJ.Purge() in the correct namespace – Brandon Horst Jul 09 '13 at 22:59
  • 1
    Rather unrelated comment: why are you doing a new development on a 5 year old product? Why don't you use the current version? – kazamatzuri Jul 10 '13 at 17:04
  • Sorry but still not working even after "Do $system.OBJ.Purge()" Any other ideas on what could be blocking updates on only certain columns? – AaronS Jul 10 '13 at 19:00
  • kazamatzuri - This isn't a new database. I'm working at a new job with an old database. Just trying to add a new table. Upgradeing is a project on the todo list but that's for another day. – AaronS Jul 10 '13 at 19:02