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 8505709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:23:49+00:00 2026-06-11T02:23:49+00:00

I am creating a procedure where I’m supposed to look for the last date

  • 0

I am creating a procedure where I’m supposed to look for the last date of an exam.
So I created a local variable for this because I will need this date in other things as well. However, when I do a simple SELECT of this local variable, I get the message:

Unknown column ‘last_exam’ in ‘field list’.

Code:

DECLARE latest_exam date;

  SELECT DATE(MAX(ex_date))
    INTO latest_exam
    FROM vets
   WHERE an_id = p_animal_id
GROUP BY an_id;

SELECT latest_exam, and a bunch of other stuff. ;

In the select, do I need to include a FROM clause? I didn’t think so because I figured latest_exam is within the procedure.

  • 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-11T02:23:50+00:00Added an answer on June 11, 2026 at 2:23 am

    you’re not assigning the result of your select in the variable.

    Do this

    select latest_exam = date(max(ex_date))..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a stored procedure that will take in one parameter: @CommonImportID This
I am creating a stored procedure to which I want to pass as variable
I'm creating a stored procedure that will create 3 triggers (insert, update, delete) given
When creating the following procedure I receive this error message: ERROR 1064 (42000): You
I'm having trouble creating this stored procedure on IBM Informix Dynamic Server Version 10.00.FC9
Okay basically I am creating a stored procedure that will return data for our
Anybody tell me what's wrong with creating this stored procedure. CREATE PROC ImportData AS
I found the following stored procedure from here , while creating this stored procedure
I am creating stored procedure in which I need to build a temporary table
I am creating as stored procedure that brings back a bunch of data that

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.