Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8759349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:46:48+00:00 2026-06-13T14:46:48+00:00

I am storing cache information from the cache server if application version is matching

  • 0

I am storing cache information from the cache server if application version is matching else I need to set cache details as NULL.

Currently I am doing it like this

UPDATE 
  cache_table 
SET
  _data = NULL 
WHERE _id = id AND _app_version != "current_version" 

Followed by select query

SELECT 
      _data 
    FROM
      cache_table 
    WHERE _id = id AND _app_version == "current_version" 

Is there a way I can do required update and select in one query without firing two query ?

Note: I don’t want to use MySQL procedure. No specific reason but don’t want to store application logic in DB so I can easily change database application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:46:49+00:00Added an answer on June 13, 2026 at 2:46 pm

    Generally UPDATE and SELECT are two distinct operations. The only way to combine them is with a stored procedure as you identify.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a way for cache images and html files in PhoneGap from my
I am storing bash scripts onto a CentOS server from PHP over SSH2 ;
I'm currently writing some code which will download images from my web server for
We have some part of our application that need to load a large set
In my app am creating some files and storing them in cache dir .
Storing credit card information securely and legally is very difficult and should not be
I'm building a web application, and I need to use an architecture that allows
I'm currently storing a bunch of .docx files in the GAE Blobstore. I recently
I'm trying to insert information from a form into a database table and then
I want to parse a XML file from a server on internet and save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.