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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:32:16+00:00 2026-05-23T22:32:16+00:00

I am able to get a similiar function working in TSQL but I am

  • 0

I am able to get a similiar function working in TSQL but I am a relative newbie to PL/SQL, I’m hopeing someone can explain to me why this function declaration will not compile.
t_interval_list_table is a table type of objects t_interval which has a single attribute of varchar2(20). Interval_Get_udf just returns a formatted string of type varchar(2)

create or replace
FUNCTION  fn_ExplodeIntervals (
  startTime IN timestamp,
  endTime IN timestamp,
  inputInterval IN int)
  RETURN t_interval_list_table   AS  intervalList t_interval_list_table := t_interval_list_table()
BEGIN

 with SET0 as( select 1 from dual union all select 1 from dual)
   , SET1 as ( select 1 from SET0 s1, SET0 s2)
   , SET2 as ( select 1 from SET1 s1, SET1 s2)
   , SET3 as ( select 1 from SET3 s1, SET3 s2)
   , SET4 as ( select 1 from SET4 s1, SET4 s2)
   , ControlSet AS (SELECT ROW_NUMBER() OVER(ORDER BY (SELECT 1 from Dual)) rid  FROM SET4)

  select t_interval(Interval_Get_udf(TO_TIMESTAMP(startTime, 'dd/mm/yyyy') + rid/24 , 1))
  into intervalList
  from ControlSet;

  RETURN intervalList;

END fn_ExplodeIntervals;
  • 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-23T22:32:17+00:00Added an answer on May 23, 2026 at 10:32 pm

    You probably can simplify the query in your PL/SQL procedure:

    SELECT t_interval(Interval_Get_udf(TRUNC(startTime) + ROWNUM/24 , 1))
    BULK COLLECT INTO intervalList
    FROM dual 
    CONNECT BY LEVEL <= 65536
    

    That might get rid of the error.

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

Sidebar

Related Questions

I was able to get this working is SSRS 2008, but do to the
I'm able to get cells to format as Dates, but I've been unable to
How can I get a variable that contains the currently executing function in Python?
I need to be able get a single specific attribute from an element with
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default
Has anyone been able to get a variable record length text file (CSV) into
I am not able to get my jwysiwyg and Jhtmlarea text editors to work
I am able to get the feed from the spreadsheet and worksheet ID. I
I am able to get the list of 'authored' blogs for a particular user

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.