sql - need help making a dynamic query for oracle -


So I can be identified only runtime that need to select records from tables it is what got me , But I'm a bit stuck. Pointing on any help, suggestions or how to do it in a simple / right way would be greatly appreciated.

  DECLARE TABLE_NAME VARCHAR2 (255); QUERY_STR VARCHAR2 (1000); Select Start When UPPER (APP.MODULE_LONG_NAME) 'PLEDGE% in the beginning of' 'PLEDGE_HDR' the ELSE 'CONTACT_HDR' REQST_HDR RH TABLE_NAME the inner end LRT.REQST_TYPE_ID = RH.REQST_TYPE_ID LKUP_REQST_TYPE LRT. APP_MODULE_MSTR APP.MODULE_ID = LRT.MODULE_ID on APP; QUERY_STR: = 'SELECT * FROM' || TABLE_NAME || '- More filtering'; -SOMMEHOW Show results for QUERY_STR in table form ending;   

Update - As I could not find any solution to work, finish while I just use COALESCE because my query to only two tables to be based on the way Were. Thanks for everyone.

Try something like:

  Change make or functions or the Chunen_a_fnkshn_nam returns SYS_REFCURSOR TABLE_NAME VARCHAR2 (255); QUERY_STR VARCHAR2 (1000); Res sys_refcursor; Select Start when UPPER (APP.MODULE_LONG_NAME) like 'PLEDGE%' like 'PLEDGE_HDR' ELSE 'CONTACT_HDR' REQST_HDR from Roh infringer start in TABLE_NAME at end LRT.REQST_TYPE_ID = RH.REQST_TYPE_ID LKUP_REQST_TYPE LRT. APP_MODULE_MSTR APP.MODULE_ID = LRT.MODULE_ID on APP; QUERY_STR: = 'SELECT * FROM' || TABLE_NAME || '- More filtering'; Reopen for QUERY_STR; Return ridge; End;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -