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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:53:06+00:00 2026-06-04T17:53:06+00:00

I have a stored procedure which is executing a dynamic select query. The query

  • 0

I have a stored procedure which is executing a dynamic select query. The query string is large. The following is the stored procedure


create or replace
procedure My_SP
(
procRefCursor out sys_refcursor,
--My other input variables here
)
is

dynSqlComplete varchar2(8000) := 'n/a';

begin

  dynSqlComplete := 'Large query here';

  open procRefCursor for dynSqlComplete;

end;

When I run this sp it shows the following error

ORA-00600: internal error code, arguments: [qcscbAddToSelLists], [], [], [], [], [], [], [], [], [], [], []

so I reduced the size of dynSqlComplete variable to varchar2(5000) and then ran the stored procedure. I got the following error:

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

I have tried many things in vain and also I do not want to add them here because it will misguide.

— EDIT — 6 Jun 2012

Hi All,

I was able to pin point the problem but I am not yet able to solve it. I tried to run the query part by part and I found the query which was throwing an error. It contained START WITH and when i commented it the query started to work. I have given the code below and commented out the code which is giving error.


      SELECT RowNum AS RowNumber1,
      GR.*,
      --LEVEL AS LineageLvl,
      VDE.*
    FROM
      (SELECT *
      FROM group_relations  left outer join relation_classifier_instances RC on 
      rc.relation_id = group_relations.Group_relation_id  WHERE group_relation_type_id IN
      (19,20,32,38,42,43)  and (rc.relation_id is null) 
      ) GR
    LEFT OUTER JOIN Vendor_Feed_data_elements VDE
    ON GR.Group_Relation_Type_Id = 19
    AND GR.Primary_GroupField_Id = VDE.Vendor_Data_Element_Id
      /* Code which is giving the error
      START WITH
      (
        VDE.Vendor_Data_Element_Id IS NOT NULL  )
      CONNECT BY nocycle prior GR.RELATED_GROUPFIELD_ID = GR.PRIMARY_GROUPFIELD_ID*/

  • 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-04T17:53:07+00:00Added an answer on June 4, 2026 at 5:53 pm

    You can try using a clob a CLOB in 11g, something like (untested):

    declare
      l_sql clob;
      l_str1 varchar2(32767);
      l_str2 varchar2(32767);
    begin
      dbms_lob.createtemporary(l_sql, false);
    
      l_str1 := 'some large SQL chunk';
      l_str2 := 'and the rest of large SQL chunk';
    
      l_sql := l_str1;
      dbms_lob.writeappend(l_sql, length(l_str2), l_str2);
    
      execute immediate l_sql;
    
      dbms_lob.freetemporary(l_sql);
    
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure which returns a ref cursor as follows: CREATE OR
I have a stored procedure which basically does something like select top 1 expiryDate,
I have a messy stored procedure which uses dynamic sql. I can debug it
I have a stored procedure in which i want to create a user defined
I have the following stored procedure which will generate mon to sun and then
I have a mysql stored procedure which is giving me the following error:- #1064
I have a data access layer which returns DataSets/DataTables by executing Stored Procedure. Everything
I have a parameterized stored procedure which is executing a view and return the
I have written a stored procedure which retrieves more than 7000 rows. While executing
I have a stored procedure when I am executing this query in SQL Server

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.