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

  • SEARCH
  • Home
  • 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 6557705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:06:30+00:00 2026-05-25T13:06:30+00:00

IBM Informix Dynamic Server Version 11.50.FC6 I was working on a small stored procedure

  • 0

IBM Informix Dynamic Server Version 11.50.FC6

I was working on a small stored procedure that would take name fields from a table and parse them into “user names” with a maximum of 8 chars.

This is the code I was trying:

CREATE PROCEDURE build_jics_user (pid INT)
    RETURNING CHAR(8) AS username;
    SELECT LOWER((SUBSTR(firstname,0,1))||(SUBSTR(lastname,0,7))) username
    FROM id_rec
    WHERE id = pid;
END PROCEDURE;

The error returned when executed is:

  659: INTO TEMP table required for SELECT statement.
Error in line 5
Near character position 15

I don’t understand what the point of summoning a temporary table is, and I also couldn’t find any similarly simple examples online that would work without error.

Does anyone know what I’m missing?

  • 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-05-25T13:06:31+00:00Added an answer on May 25, 2026 at 1:06 pm

    What you want to say is this:

    CREATE PROCEDURE build_jics_user (pid INT)
        RETURNING CHAR(8);
        DEFINE username CHAR(8);
        SELECT LOWER((SUBSTR(firstname,0,1))||(SUBSTR(lastname,0,7))) INTO username
          FROM id_rec
          WHERE id = pid;
        RETURN username;
    END PROCEDURE;
    

    … and execute it like this:

    EXECUTE PROCEDURE build_jics_user(42);
    

    UPDATE

    If the purpose of this is to be a function, where it’s required inside some other SQL, then you might do the following:

    CREATE FUNCTION jics_user(fname VARCHAR(255), lname VARCHAR(255))
        RETURNING CHAR(8);
        RETURN LOWER(SUBSTR(fname,0,1) || SUBSTR(lname,0,7));
    END FUNCTION;
    

    … and execute it like this:

    SELECT id, firstname, lastname, jics_user(firstname, lastname) AS jics_user, ...
      FROM id_rec;
    

    There’s no real technical difference between a PROCEDURE and a FUNCTION, it’s more an assertion as to how it’s used.

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

Sidebar

Related Questions

I'm having trouble creating this stored procedure on IBM Informix Dynamic Server Version 10.00.FC9
IBM Informix Dynamic Server Version 11.50.FC6 I am trying to execute a simple stored
Server: IBM Informix Dynamic Server Version 11.70.FC1GE Client: IBM Data Server Driver package 5765-F41
Using IBM Informix Dynamic Server Version 10.00.FC9 The error I'm getting is: 1226: Decimal
Using IBM Informix Dynamic Server Version 10.00.FC9 I'm looking to set multiple field values
I have 2 fields I'm working with that are stored as smallint military structured
I connected to the Informix server using RazorSQL, created a stored procedure and tested
I am using IBM DB2 with Toad. I have a stored procedure that I
I need to call a stored procedure multiple times, I'm using informix. I would
I try to connect to informix server 11.5 using using IBM.Data.Informix (located in C:\Program

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.