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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:50:01+00:00 2026-05-20T03:50:01+00:00

I am trying to use a named rowtype that is being returned in a

  • 0

I am trying to use a named rowtype that is being returned in a stored procedure, and putting those columns into a view.
The end goal would be a view like this:

select * from view_tmp
table_f1  table_f1_val
table_f2  1
table_f3  2
f1        f1_val
f2        f2_val
f3        v3_val

The problem I am running in to is with the stored procedure being run once for every field I’m pulling back.

create view view_tmp (table_f1,table_f2,table_f3, f1, f2, f3) as (
select  a.table_f1,a.table_f2,a.table_f3,
        feat_proc_tmp(a.table_f1,a.table_f2).f1,
        feat_proc_tmp(a.table_f1,a.table_f2).f2,
        feat_proc_tmp(a.table_f1,a.table_f2).f3
from table_tmp a)

This runs feat_proc_tmp 3 times which is not good (data wise and performance wise)
My procedure returns a rowtype, so how can I access these differently to get the data into the view without running it 3 times? This is as close as I can get with my attempt but this won’t go into a view (maybe it can and I can’t figure it out?):

select *,feat_proc_tmp('1',1) from table_tmp
table_f1      table_f1_val
table_f2      1
table_f3      2
(expression)  ROW('f1_val','f2_val','v3_val')

Here’s the SQL to recreate:

drop row type features_tmp restrict;
drop procedure feat_proc_tmp;
drop table table_tmp;
drop view view_tmp;
create row type features_tmp (
f1 varchar(255),
f2 varchar(255),
f3 varchar(255)
);
create procedure feat_proc_tmp (Ipass char(10), product_id int)
returning features_tmp;
RETURN ROW('f1_val','f2_val','v3_val')::features_tmp;
end procedure;
create table table_tmp (
        table_f1 char(16),
        table_f2 int,
        table_f3 int
);
insert into table_tmp values ('table_f1_val',1,2);
create view view_tmp (table_f1,table_f2,table_f3, f1, f2, f3) as (
select  a.table_f1,a.table_f2,a.table_f3,
        feat_proc_tmp(a.table_f1,a.table_f2).f1,
        feat_proc_tmp(a.table_f1,a.table_f2).f2,
        feat_proc_tmp(a.table_f1,a.table_f2).f3
from table_tmp a)

This is on Informix v11. One thought I had would be to join the procedure as a table and then pull from that but I can’t find a format that will work here-:

select a.*,b.* from table_tmp a CROSS JOIN TABLE (feat_proc_tmp('1',1)) b

returns the b.* as a ROW() so if I try

select a.*,b.f1 from table_tmp a CROSS JOIN TABLE (feat_proc_tmp('1',1)) b

Then column f1 not found in any table in the query happens.

  • 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-20T03:50:01+00:00Added an answer on May 20, 2026 at 3:50 am

    I appear to have stumbled on a bug in 11.5 FC6W2, if I do this on FC6 or FC4, the stored procedure only executes one time in my first example. So an upgrade solved my issue.

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

Sidebar

Related Questions

I'm trying to use WCF named pipes in a web site, and it's failing
Iam trying to use a UserControl named CheckBoxControl as value for the ExpandControlID/CollapseControlID attributes
I'm trying to use a class named CFindWnd . Unfortunately it's written in C
I've been trying to reduce implicit type conversions when I use named constants in
I am trying to use a component which named as A C# IP Address
I have inherited a medium sized database that we are trying to use with
I'm trying to use class names to change the color of a link after
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table

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.