简体   繁体   中英

How to get value from Stored Procedure with string return type using JPA?

I have a Stored procedure stored in my database and I want to access its return value using JPA or any other function without using query. How can I do it?

Its something like this:

 BEGIN                                                                                             
         SELECT prefix ||                                                                      
                 coalesce(to_char(curdt, date_prefix_pattern),'') ||                               
                 trim(to_char(num, num_pattern)) AS id                                             
         INTO rec                                                                                  
         FROM crud_id_patterns                                                                     
         WHERE pattern_id = patternId;                                                             
                                                                                                   
         return rec.id;                                                                            
 END; 

I think this @Procedure example may help you

https://www.baeldung.com/spring-data-jpa-stored-procedures

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM