• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Missing expression

 
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


In SQL Developer, I do all the queries in one package and in the Dao class, I call only the package
When I run the app. in the Eclipse, I Have this exception:

Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
ORA-06512: at "AU_MANAGEMENT.AUM_PACKAGE", line 480
ORA-06512: at line 1


FUNCTION SEARCH_DIR
   (
     P_D_NO       NUMBER,
     P_TITLE    VARCHAR2,
     P_STATUS   NUMBER,
     P_TYPE     NUMBER
   )
   RETURN T_DIR_SEARCH_RETURN
 IS
   V_QUERY_TEXT VARCHAR2(5000);
   V_DIR_SEARCH_RETURN T_DIR_SEARCH_RETURN;
 BEGIN
   V_QUERY_TEXT :=
   'SELECT   D_ID,                                                    
D_NO,                                                                                                        
D_TITLE,                                                                                                      
STATUS.S_DESCRIPTION STATUS_DESCRIPTION,                                                    
TYPE.T_DESCRIPTION TYPE_DESCRIPTION,                                                                                                      
(SELECT COUNT(*)  FROM DIR_FOLLOWUP DIR_FOLLOWUP WHERE DIR_FOLLOWUP.D_ID = DIR.D_ID),                                                                                            
USER.U_NAME USER_NAME,
FROM  DIRECTION DIRECTION,  STATUS STATUS, TYPE TYPE, USER USER                                                                                    
AND   DIRECTION.D_STATUS_CODE = STATUS.S_CODE                                            
AND   DIRECTION.D_TYPE_CODE =   TYPE.T_CODE                                            
AND   DIRECTION.D_CREATED_USER_ID = APPL_USER.U_SEQ';

V_QUERY_TEXT := V_QUERY_TEXT || ' ORDER BY D_NO ';
   OPEN V_DIR_SEARCH_RETURN FOR V_QUERY_TEXT;  >> This is line 480
   RETURN V_DIR_SEARCH_RETURN;
 END;


This is line 480:
OPEN V_DIR_SEARCH_RETURN FOR V_QUERY_TEXT;

can you help me please, if you have any idea.

Thank you in advance.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does that query work if you copy and paste it into SQLDeveloper?
Include the ORDER BY.
 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so mutch for your response. I solve it, it was small comma befor "from"
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic