Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to insert a field into existing categories with some default value?

Quote Reply
How to insert a field into existing categories with some default value?
How to insert a field into existing categories with some default value kind of "default value xyz"?

I've tried:

Category > Properties > Add Column > Column Name = Extra > Not Null = YES > Default = default value xyz > Form Type = TEXT ... etc.

but I can't see only a new field, "Extra" in all existing categories without "default value xyz"?

Any suggestion? Thanks in advance.
Quote Reply
Re: [katakombe] How to insert a field into existing categories with some default value? In reply to
Hi,

Existing categories won't be updated with the "default"

You need to run a query.

Something like (be sure to backup your DB first, in case it doesn't do what you want :P)

UPDATE glinks_Category SET New_Field = 'bla' WHERE New_Field IS NULL;

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to insert a field into existing categories with some default value? In reply to
Hello Andy!

He he ... It worked! (as usual Wink)

Many thanks again Andy!
Quote Reply
Re: [katakombe] How to insert a field into existing categories with some default value? In reply to
The only thing I've noticed is that I must add a description in Description field if I want to change some other, standard Category field, but that's not a big problem ..