# (14.051.637) Problems with PLSQL Formatter

**URL:** <https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333>\
**Category:** Toad for Oracle - Beta\
**Created:** [October 26, 2020, 10:18am UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333 "2020-10-26T10:18:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![c-bouillon](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@c-bouillon](https://forums.toadworld.com/u/c-bouillon)\
**Post date:** [October 26, 2020, 10:18am UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/1 "2020-10-26T10:18:16Z")

</div>

Hi,

PLSql formatter seems lost when using new syntax (since Oracle 18c) for initializing records and arrays like this:

DECLARE  
TYPE ints\_t IS TABLE OF INTEGER  
INDEX BY PLS\_INTEGER;

l\_ints ints\_t := ints\_t (1 =\> 55, 2 =\> 555, 3 =\> 5555);  
BEGIN  
FOR indx IN 1 .. l\_ints.COUNT  
LOOP  
DBMS\_OUTPUT.put\_line (l\_ints (indx));  
END LOOP;  
END;  
/

Regards.

Claude.

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [October 28, 2020, 1:05pm UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/2 "2020-10-28T13:05:39Z")

</div>

Support for this syntax (1 =\> 55, 2 =\> 555, etc.) our side is missing indeed.  
Thanks for letting us know.

Andre

---

<div class="post-metadata">

**Author:** ![c-bouillon](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@c-bouillon](https://forums.toadworld.com/u/c-bouillon)\
**Post date:** [October 29, 2020, 1:11pm UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/3 "2020-10-29T13:11:02Z")

</div>

Hi,

thank you for your reply,

just another example:

DECLARE  
TYPE species\_rt IS RECORD (  
species\_name VARCHAR2 (100),  
habitat\_type VARCHAR2 (100),  
surviving\_population INTEGER);

l\_elephant species\_rt  
:= species\_rt (species\_name =\> 'Elephant',  
surviving\_population =\> '10000',  
habitat\_type =\> 'Savannah');  
BEGIN  
DBMS\_OUTPUT.put\_line ('Species: ' || l\_elephant.species\_name);  
END;  
/

regards.

Claude

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [October 29, 2020, 4:16pm UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/4 "2020-10-29T16:16:24Z")

</div>

Hi Claude,

Hmm, your last example seems to parse and format fine in Toad 14.0.75.662, which has the same QP5 component 5.362 as yours. Are you sure there's a problem? If so then can you please provide details?

Thanks,  
Andre

---

<div class="post-metadata">

**Author:** ![c-bouillon](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@c-bouillon](https://forums.toadworld.com/u/c-bouillon)\
**Post date:** [October 30, 2020, 12:32pm UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/5 "2020-10-30T12:32:12Z")

</div>

Hi,

Yes you were right, this on parses correctly.

but these ones not:  
DECLARE  
TYPE by\_string\_t IS TABLE OF INTEGER  
INDEX BY VARCHAR2 (100);

```
l_stuff by_string_t := by_string_t ('Steven' => 55, 'Loey' => 555, 'Juna' => 5555);
l_index VARCHAR2 (100) := l_stuff.FIRST;

```

BEGIN  
DBMS\_OUTPUT.put\_line (l\_stuff.COUNT);

```
WHILE l_index IS NOT NULL LOOP
    DBMS_OUTPUT.put_line (l_index || ' => ' || l_stuff (l_index));
    l_index := l_stuff.NEXT (l_index);
END LOOP;

```

END;  
/

DECLARE  
TYPE by\_string\_t IS TABLE OF INTEGER  
INDEX BY VARCHAR2 (100);

```
l_stuff by_string_t := by_string_t (UPPER ('Grandpa Steven') => 55, 'Loey' || 'Juna' => 555, SUBSTR ('Happy Family', 7) => 5555);

l_index VARCHAR2 (100) := l_stuff.FIRST;

```

BEGIN  
DBMS\_OUTPUT.put\_line (l\_stuff.COUNT);

```
WHILE l_index IS NOT NULL LOOP
    DBMS_OUTPUT.put_line (l_index || ' => ' || l_stuff (l_index));
    l_index := l_stuff.NEXT (l_index);
END LOOP;

```

END;  
/

Best regards.

Claude.

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [October 30, 2020, 12:47pm UTC](https://forums.toadworld.com/t/14-051-637-problems-with-plsql-formatter/51333/6 "2020-10-30T12:47:46Z")

</div>

That's of a same kind as the first snippet indeed.  
Thanks for the examples, we've queued it. (QP-3755)

Thanks,  
Andre
