# TOAD and PL SQL Error

**URL:** <https://forums.toadworld.com/t/toad-and-pl-sql-error/8958>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [November 11, 2009, 9:53am UTC](https://forums.toadworld.com/t/toad-and-pl-sql-error/8958 "2009-11-11T09:53:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardo.russo79\_312](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@riccardo.russo79\_312](https://forums.toadworld.com/u/riccardo.russo79_312)\
**Post date:** [November 11, 2009, 9:53am UTC](https://forums.toadworld.com/t/toad-and-pl-sql-error/8958/1 "2009-11-11T09:53:52Z")

</div>

Hi all, I’m using TOAD 9.5.0.31 (commercial!) and TNSNAMES for my connection is

```auto
----------------------------------------------------------
SOFTWARE\ORACLE\KEY_ORACLIENT10G_HOME1
ORACLE_HOME_NAME: OraClient10g_home1
ORACLE_HOME: C:\oracle\product\10.2.0\client_1
ORACLE_SID:
NLS_LANG: ITALIAN_ITALY.WE8MSWIN1252
SQLPATH: C:\oracle\product\10.2.0\client_1\dbs
LOCAL:
C:\oracle\product\10.2.0\client_1\Bin exists.
C:\oracle\product\10.2.0\client_1\Bin is in PATH.
Client DLL: C:\oracle\product\10.2.0\client_1\Bin\oci.dll
Client Version: 10.2.0.1.0
Home is valid.
----------------------------------------------------------

```

If I try to compile a package with a cursor declared as

```auto
----------------------------------------------------------
PROCEDURE xxxxx
AS
--
c_native_sys_ref_cur sys_refcursor;
BEGIN
OPEN c_native_sys_ref_cur FOR
WITH yyyy AS
....
----------------------------------------------------------

```

TOAD doesn’t accept the select format. It prefers

```auto
----------------------------------------------------------
PROCEDURE xxxxx
AS
--
c_native_sys_ref_cur sys_refcursor;
BEGIN
OPEN c_native_sys_ref_cur FOR
SELECT *
from (WITH yyyy AS
....
)
----------------------------------------------------------

```

However If I try to compile the package in the first format using theSQL Editor (C:\oracle\product\10.2.0\client\_1\BIN\sqlplusw.exe), thepackages works and it is compiled!

```auto
----------------------------------------------------------
SQL*Plus: Release 10.2.0.1.0 - Production on Mer Nov 11 08:29:38 2009
 
Copyright (c) 1982, 2005, Oracle. All rights reserved.
 
 
Connesso a:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
----------------------------------------------------------

```

How to set TOAD options?  
Thanks, Riccardo

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [November 11, 2009, 9:53am UTC](https://forums.toadworld.com/t/toad-and-pl-sql-error/8958/2 "2009-11-11T09:53:52Z")

</div>

WITH syntax support I think came in a later version of Toad.

Can you upgrade off of 9.5, maybe up to v9.7 or v10?
