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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:56:49+00:00 2026-05-25T16:56:49+00:00

Hey folks im getting a sql error all the way at the bottom right

  • 0

Hey folks im getting a sql error all the way at the bottom
right before the execute statement at the end of the code block:

stmt := v_first_sql || stmt || v_order_by_sql || v_last_sql;

any ideas of what Im doing wrong?

thanks

FUNCTION search_data
(                      
    p_start_ind     IN NUMBER,
    p_end_ind       IN NUMBER,
    p_cols_sort_by IN char_tab,
    p_sort_orders     IN char_tab,                                                     
    p_sor_number        IN VARCHAR2,
    p_tcn           IN VARCHAR2,
    p_sock             IN NUMBER,
    p_work_id    IN NUMBER,
    p_sap              in NUMBER


)
RETURN bean_list
IS
    stmt                VARCHAR2(4000);
    result              bean_list;
    v_jp_ids            VARCHAR2(50);
    v_first_sql         VARCHAR2(512); 
    v_row_count         NUMBER;               
BEGIN
   v_row_count := p_end_index - p_start_index + 1;

   v_first_sql := 'BEGIN ';
   v_first_sql := v_first_sql || ' SELECT item_search( id, mwslin,sor_code, fyear, wyear,';
   v_first_sql := v_first_sql || '  sock,  tcn, non, nomen,sap';
   v_first_sql := v_first_sql || ' row_count )';
   v_first_sql := v_first_sql || ' BULK COLLECT INTO :bind_var1';       
   v_first_sql := v_first_sql || ' FROM';
   v_first_sql := v_first_sql || ' (';
   v_first_sql := v_first_sql || ' SELECT /*+ FIRST_ROWS(' || TO_CHAR(v_row_count) || ') */ ';
   v_first_sql := v_first_sql || ' ROWNUM rnum, a.*'; 
   v_first_sql := v_first_sql || ' FROM';
   v_first_sql := v_first_sql || ' (';
   v_first_sql := v_first_sql || ' SELECT ob.*, COUNT(*) OVER () AS row_count';
   v_first_sql := v_first_sql || ' FROM';
   v_first_sql := v_first_sql || ' (';   

        v_order_by_sql := ' ) ob ' || temp_pkg.get_number_by( p_columns_sort_by, p_sort_orders );
          v_last_sql := ' ) a';
   v_last_sql := v_last_sql || ' WHERE rownum <= ' || TO_CHAR(p_end_index);
   v_last_sql := v_last_sql || ' )';
   v_last_sql := v_last_sql || ' WHERE rnum >= ' || TO_CHAR(p_start_index);
   v_last_sql := v_last_sql || ' ORDER BY rnum;';
   v_last_sql := v_last_sql || ' END;';




    stmt := v_first_sql || stmt    
 EXECUTE IMMEDIATE stmt USING OUT result;

 RETURN result;

END search_data;
  • 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-25T16:56:50+00:00Added an answer on May 25, 2026 at 4:56 pm

    The parentheses in YOUR code appear to be balanced, so clearly the problem is in the text introduced by

    temp_pkg.get_order_by( p_columns_sort_by, p_sort_orders )
    

    This function must be returning unbalanced parens.

    By the way, unless you’ve gone to great lengths to sanitize the input, this is a SQL injection attack waiting to happen.

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

Sidebar

Related Questions

Hey folks. I'm looking for the best way to do something simple in symfony.
Hey folks, ok so this is my problem, I need to display HTML code
Hey I am getting this error: error: conversion to non-scalar type requested Here are
Hey all, just wondering what the best way to add this capability was. I
Hey Folks,I have pasted my code here. Dialog.inform contains a 'long' value which is
Hey folks, I have the following piece of code from C++. for (int i=0;
Hey all, I'm using this code to change my sIFR (version 3) H1 and
Hey folks, beneath is a piece of code i used for a school assignment.
Hey folks, I am trying to import a database (.sql) file using phpmy admin
Hey folks - I'm writing a pretty simple iPhone application. The data comes from

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.