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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:41:16+00:00 2026-06-01T13:41:16+00:00

I have a stored function CREATE OR REPLACE FUNCTION schedule(name in varchar2,pass in varchar2

  • 0

I have a stored function

 CREATE OR REPLACE FUNCTION schedule(name in varchar2,pass in varchar2 )
    begin
    select t.name,s.starttime from traininfo t,schedule s, trainslot ts 
    where t.trainid in( select ts.trainid from trainslot 
    where ts.slotid in (select s.slotid from schedule s 
    where s.source='dhaka'
    and s.dest='bogra' ))
    end

I want to return this result set using a cursor.

  • 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-01T13:41:17+00:00Added an answer on June 1, 2026 at 1:41 pm

    I don’t see where you are using either of the input parameters in your function. I’ll assume that is either intentional or an oversight because you’re simplifying the code. It also appears that your query is missing conditions to join between the traininfo, schedule, and trainslot tables in the outer query. It seems odd that your nested IN statements are turning around and querying the schedule and trainslot tables given this lack of join conditions. I don’t know whether this is a result of copy-and-paste errors or something that was missed in posting the question or whether these are real problems. I’ll make a guess at the query you’re intending to write but if my guess is wrong, you’ll have to tell us what your query is supposed to do (posting sample data and expected outputs would be exceptionally helpful for this).

    CREATE OR REPLACE FUNCTION schedule(name in varchar2,pass in varchar2 )
      RETURN sys_refcursor
    is
      l_rc sys_refcursor;
    begin
      open l_rc
       for select t.name, s.starttime
             from traininfo t,
                  schedule  s,
                  trainslot ts
            where t.trainid = ts.trainid
              and s.slotid  = ts.slotid
              and s.source  = 'dhaka'
              and s.dest    = 'borga';
      return l_rc;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have a routine/function/stored proc/whatever to archive particular accounts from our 'active'
I have a function that returns a date from a stored procedure, and it
I have a stored procedure. I want to call a function from it. Want
I have created following stored user defined it gets executed successfully. CREATE FUNCTION spherical_distance1(@a
If I have function names stored as strings in a Hashtable. Is there a
I have a stored procedure with the following header: FUNCTION SaveShipment (p_user_id IN INTEGER,
I have a VB.Net function which executes a Oracle Stored Proc and returns a
We have an Oracle type that's declared as such: CREATE OR REPLACE TYPE its_accountarray;
I have just written a stored procedure and stored function that serve to insert
Working solution: CREATE OR REPLACE FUNCTION my_search(tsq tsquery, translation_id integer, lang regconfig, count integer

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.