Skip to Main Content
  • Questions
  • SP2-0734 when try to execute line begins with "#" character

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Carlos.

Asked: June 23, 2016 - 11:36 pm UTC

Last updated: June 24, 2016 - 3:15 am UTC

Version: 11.2.0.1.0

Viewed 1000+ times

You Asked

Hi,
I need to execute script (package body) that contents a line with first character "#", for example:
...
...
htp.p('
<script>
<style>
#tbTabs tr td table Port
...
...

When execute line "#tbTabs tr td table Port", this raises the error:
SP2-0734: unknown command beginning "tbTabs tr ..." - rest of line ignored.

Is there any configuration or command that I need to set to avoid this error?

Regards,
Carlos Agapito.

and Connor said...

"#" is the special character to allow running of SQLPlus commands, eg

SQL> select *
  2  #desc scott.emp
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ----------------------
 EMPNO                                                 NOT NULL NUMBER(4)
 ENAME                                                          VARCHAR2(10)
 JOB                                                            VARCHAR2(9)
 MGR                                                            NUMBER(4)
 HIREDATE                                                       DATE
 SAL                                                            NUMBER(7,2)
 COMM                                                           NUMBER(7,2)
 DEPTNO                                                         NUMBER(2)

  2  from scott.dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

4 rows selected.



Control it with "sqlprefix"

SQL> set sqlprefix ~
SQL> select *
  2  ~desc scott.emp
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- -----------------
 EMPNO                                                 NOT NULL NUMBER(4)
 ENAME                                                          VARCHAR2(10)
 JOB                                                            VARCHAR2(9)
 MGR                                                            NUMBER(4)
 HIREDATE                                                       DATE
 SAL                                                            NUMBER(7,2)
 COMM                                                           NUMBER(7,2)
 DEPTNO                                                         NUMBER(2)



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library