# Sonar is not reading .PRC, .TRG,.VIW source of SQL type exetensions

**URL:** <https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, scanner\
**Created:** [August 19, 2020, 5:38am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739 "2020-08-19T05:38:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrinivasP](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@SrinivasP](https://community.sonarsource.com/u/SrinivasP)\
**Post date:** [August 19, 2020, 5:38am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/1 "2020-08-19T05:38:43Z")

</div>

Hi All,

I have SQL code base. This folders contains mix of files with extension .sql,.prc, .viw, .fnc, .trg etc. Sonar is able to read file with extension .sql, but unable to read extension .prc, .viw, .fnc, .trg.  
Currently I’m using PLSQl plugin with enterprise version.

In my directory I have 5000 store procedures but only 40 are getting read for scanning.  
The File name starting with dbo.sp\_ Only this files are getting read.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/a/ae20e0f84257118bd9c6eeb7bb03bcbad3f515d5.png)

Could anyone help me on this how to read the Store procedures, Triggers, functions all. I don’t see any warnings or errors in Jenkins console.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 19, 2020, 6:59pm UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/2 "2020-08-19T18:59:12Z")

</div>

Hi,

Assuming all these files really are PL/SQL, then all you have to do is edit the list of file extensions that PL/SQL analysis claims / recognizes. You can do that at either the project or global level. You’ll find it under ‘Languages’, then just pick PL/SQL in the language dropdown.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![SrinivasP](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@SrinivasP](https://community.sonarsource.com/u/SrinivasP)\
**Post date:** [August 20, 2020, 6:46am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/3 "2020-08-20T06:46:16Z")

</div>

Hi,

I have added the extensions in language settings and still Not reading all files here is the output of the Jenkins console.  
To scan all files I have converted .PRC, .TRG to .SQL and I have tried with PL\SQL didn’t worked.

```auto
INFO: 8755 files indexed... (last one was Database/Procedures/usp_MoveIntervalFiles_SQLV2K.sql)
INFO: 9303 files indexed
INFO: Quality profile for tsql: Sonar way
INFO: ------------- Run sensors on module Phar_Sql
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=106ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/windows/system32/config/systemprofile/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
 All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=50ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=31ms
INFO: Sensor cs-vf Checks [codescanlang]
INFO: Running CodeScanLang
INFO: Sensor cs-vf Checks [codescanlang] (done) | time=23ms
INFO: Sensor cs-js Checks [codescanlang]
INFO: Running CodeScanLang
INFO: Sensor cs-js Checks [codescanlang] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=30ms
INFO: Sensor T-SQL Sensor [tsql]
INFO: 335 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=158ms

```

The total 9303 files is indexed but only 335 files are analyzed and Is something went wrong? Could anyone help me on this.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 20, 2020, 6:04pm UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/4 "2020-08-20T18:04:09Z")

</div>

Hi,

> [@SrinivasP](#):
>
> I have added the extensions in language settings and still Not reading all files here is the output of the Jenkins console.  
> To scan all files I have converted .PRC, .TRG to .SQL and I have tried with PL\SQL didn’t worked.

It’s not clear to me what you’ve done and there’s not enough of the analysis log above to show me what’s going on. It seems that you _renamed_ the files in question? Here’s what I had in mind:

 ![Selection_999(226)](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/0/0cb98ffe3acc154822a50eccca46fcf732a271ba.jpeg)

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![SrinivasP](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@SrinivasP](https://community.sonarsource.com/u/SrinivasP)\
**Post date:** [August 21, 2020, 5:44am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/5 "2020-08-21T05:44:25Z")

</div>

Hi Ann,

In My repository total 9303 files are source file scripts and need to be analysed but sonar scanner it is not getting read only 355 files are getting analysed. Just want to know is anything missing from my end. The all files are .sql files and they are supposed to be scanned.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 21, 2020, 6:40pm UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/6 "2020-08-21T18:40:40Z")

</div>

Hi,

Maybe provide your code-formatted (````` on the line before and on the line after) analysis log?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![SrinivasP](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@SrinivasP](https://community.sonarsource.com/u/SrinivasP)\
**Post date:** [August 24, 2020, 3:59am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/7 "2020-08-24T03:59:46Z")

</div>

Hi Ann,

I got solution from Jeff.  
I have configured the suffixes as below.

`-Dsonar.tsql.file.suffixes= **/*.sql,** /*.prc, **/*.trg** /*.tsql`  
Tried in below format to pass the parameter and now able to scan all files.  
`-Dsonar.tsql.file.suffixes=.sql,.prc,.trg,.tsql`

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [August 31, 2020, 3:59am UTC](https://community.sonarsource.com/t/sonar-is-not-reading-prc-trg-viw-source-of-sql-type-exetensions/29739/8 "2020-08-31T03:59:53Z")

</div>

Closed on August 31, 2020, 3:59am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
