Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Missing expression

 
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • 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: 4175
47
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you so mutch for your response. I solve it, it was small comma befor "from"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!