Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [TheStone] Searching Text Fields that aren't NULL

Quote Reply
Re: [TheStone] Searching Text Fields that aren't NULL In reply to
Hi Stone,

In Reply To:
There is no way to accomplish NOT NULL issue through your search engine. But you can create a plugin to handle it .....

Thanks for your suggestion! I am definitely planning to write this plugin. Could you give me a few more tips as I have no idea how to do it... Crazy

  • Should it be a PRE-search_results plugin?

  • Can I modify the state in a way that it checks whether a specific column is NULL or NOT NULL? Or should I do all calculations myself and call GT::Plugins->action ( STOP )?

  • If I can change the state in some way, which variables do I have to change?

  • If I would do the search myself, should I copy all code in Dbsql::Home::search_results(), SQL::Table::_query() and SQL::Base::build_query_cond() and make some modifications in SQL::Base::build_query_cond()? Seems like a lot of work for a small change. Frown

I hope answering these questions does not take you more time then writing the plugin yourself...Blush

In Reply To:
.....by using GT::SQL::Condition->new('field_name', '=', undef ) command.
Are you sure this works? I thought this would translate in 'field_name = NULL' . I thought the correct SQL would be 'field_name IS NULL'. I use
Code:
GT::SQL::Condition->new('field_name', 'IS', \'NULL' )

http://www.bookings.org
Subject Author Views Date
Thread Searching Text Fields that aren't NULL jayland 3920 Sep 28, 2002, 2:41 PM
Post Re: [jayland] Searching Text Fields that aren't NULL
jaspercram 3684 Nov 12, 2002, 5:02 AM
Thread Re: [jayland] Searching Text Fields that aren't NULL
604 3684 Nov 12, 2002, 1:17 PM
Post Re: [TheStone] Searching Text Fields that aren't NULL
jaspercram 3667 Nov 13, 2002, 7:16 AM
Post Re: [TheStone] Searching Text Fields that aren't NULL
jaspercram 3690 Nov 13, 2002, 8:18 AM
Thread Re: [jayland] Searching Text Fields that aren't NULL
jaspercram 3693 Nov 13, 2002, 7:41 AM
Post Re: [jaspercram] Searching Text Fields that aren't NULL
jayland 3657 Nov 13, 2002, 8:18 PM