?
Solved

SQL statements, WHERE with a wild card

Posted on 2003-03-16
5
Medium Priority
?
208 Views
Last Modified: 2010-03-05
I am trying to apply some modifications to ikonboard, a perl message board script. It has a few driver modules that handle flatfile databases or mysql databases. In it are subroutines for update, select, query, etc

and update looks somewaht like this:

   $db->update( TABLE  => 'member_profiles',
          WHERE => 'POST_FONT_COLOR < > ikonboard',
          VALUES => { TEST => $iB::IN{'TEST'} },
                       );
IThe subroutine then takes these values and puts together an SQL statement. Now i want to update an entire column with the same value but this ikonboard subroutine does not support that and requires a WHERE feild. I am wondering now, whether there is a way to say, WHERE => is everything in the column. I tried using the operator < > but it didnt work.

Any suggestions?
0
Comment
Question by:sganjam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 1

Expert Comment

by:zerofill
ID: 8150274
Try
where => '%'
0
 
LVL 1

Expert Comment

by:zerofill
ID: 8150338
Or
WHERE => 'POST_FONT_COLOR < > string_that_will_not_be_in_database_in_any_case_098346573'

In my previuos post I mean
where => 'coloumn like "%"'
or something like this.
I am not familiar with this method of generating queries (=>) but the real query generetaed to database must be something like this:
update sometable set somecoloumn="blabla" where somecolumn like "%";

Hope this help
0
 

Accepted Solution

by:
erigone earned 300 total points
ID: 8152289
Choose a condition which is always true e.g. "where 1 = 1"
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9699398
Nothing has happened on this question in over 7 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by erigone.

Please post any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question