Print Thread
Code Contents Don't List with Q-Quote Operator in Package Body
#50784 02/18/15 03:47 PM
Joined: Feb 2015
Posts: 14
G
Member
OP Offline
Member
G
Joined: Feb 2015
Posts: 14
Hi,

I have a package body that contains a generous amount of HTML and JavaScript code, which is included in functions/procedures using the Q-quote operator, most often using "%" as the quoting delimiter. Code compiles with no issues or warnings using sqlplus, and the code functions as anticipated. However, PL/SQL Developer's Code Contents list no functions or procedures for the package body. If I remove my Q-quoted code, the functions/procs appear in Code Contents again.

Using version 10.0.04.1708 01.90994 with Oracle 11g.

Thanks,
Brad

Re: Code Contents Don't List with Q-Quote Operator in Package Body
geekmuse #50788 02/18/15 05:46 PM
Joined: Aug 1999
Posts: 22,239
Member
Offline
Member
Joined: Aug 1999
Posts: 22,239
It should work. Can you send me an example?


Marco Kalter
Allround Automations
Re: Code Contents Don't List with Q-Quote Operator in Package Body
Marco Kalter #50792 02/18/15 06:27 PM
Joined: Feb 2015
Posts: 14
G
Member
OP Offline
Member
G
Joined: Feb 2015
Posts: 14
Not of my work-related code, as it's all NDA-bound and IP-protected. I can certainly create something that should do the trick, though it may take an evening or two for me to get something for you.

Last edited by geekmuse; 02/18/15 06:29 PM. Reason: afterthought
Re: Code Contents Don't List with Q-Quote Operator in Package Body
geekmuse #50794 02/18/15 08:25 PM
Joined: Feb 2015
Posts: 14
G
Member
OP Offline
Member
G
Joined: Feb 2015
Posts: 14
Marco,

I found the line in my code that was causing the issue.

Basically going from this:
Code
htp.p(q'% 
             -- a lot of javascript;
             var js = '%'||v_plsql_var||q'%';
             -- a lot more javascript;
        %');
to this:
Code
htp.p(q'% 
        --a lot of javascript;
      %');
htp.p('var js = '''||v_plsql_var||''''); 
htp.p(q'% 
        --a lot more javascript; 
      %');
solves the issue.

SQL*plus doesn't discriminate between either of the above cases; each compiles and produces expected output. However, only the latter snippet causes functions and procedures to be listed in PL/SQL Developer's Code Contents pane -- the first causes an empty list.

P.S.: The "--" comments in the q'' blocks are for visualization only; they would certainly break in multi-line PL/SQL code!

Last edited by geekmuse; 02/18/15 08:41 PM. Reason: PS for PL/SQL comments
Re: Code Contents Don't List with Q-Quote Operator in Package Body
geekmuse #51403 05/05/15 09:50 AM
Joined: Apr 2007
Posts: 96
Germany
B
Member
Offline
Member
B
Joined: Apr 2007
Posts: 96
Germany
I found another highliting issue, when used parentheses within quoted text
This works fine:
Code
SELECT q'[package.Procedure('valx');]' FROM dual 
If i use parentheses within text highliting fails:
- ";]" is highlited as code
- " FROM dual" is highlited as text
Code
SELECT q'[package.Procedure('val(x)');]' FROM dual

I could reproduce this issue in last version of PSD 11.0.2 and 10.0.5


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.138s Queries: 15 (0.088s) Memory: 2.5178 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-06-26 09:35:56 UTC
Valid HTML 5 and Valid CSS