Error writing SWAT input table (.wgn)

4,071 views
Skip to first unread message

Sopan Patil

unread,
Jan 22, 2014, 12:03:11 PM1/22/14
to arc...@googlegroups.com
Hi all,

I'm new to using SWAT model and am trying to set it up for a catchment in UK.  When writing the SWAT Input Tables, I get the following error (see attached image also):

'The INSERT INTO statement contains the following unknown field name: 'PR_W1_1'.  Make sure you have typed the name correctly, and try the operation again; IN, mWriteInputFiles.wgn'.

I've used 'WGEN_user' for the monthly weather database and selected 'Simulation' for all climate inputs.  I don't know what I'm doing wrong and would like to know how to solve this problem.  Any help would be greatly appreciated.

Many thanks,
Sopan
SWAT_error.png

Che Wer

unread,
Jan 23, 2014, 2:43:57 PM1/23/14
to arc...@googlegroups.com
Hello Sopan,

I just wanted to let you know I am having the exact same issue (using ArcGIS 10.1 and ArcSWAT 2012.10.1.13) when I get to this point in my project setup. At least one other person at my University also experiences the same issue.

Some findings:
I visited the ArcSWAT_WeatherDatabase in ...SWAT/ArcSWAT/Databases
PR_W1_1 is the name of a column in this database once you open one of the weather generators (I'm using WGEN_US_COOP_1980_2010). It follows PCPSKW12 and is followed by PR_W1_2.
From visiting the I/O documentation for CH12 (.wgn), I see that this skew coefficient is listed as PCPSKW(12) while our source of error is listed as PR_W(1,1). If you assume the parenthesis were not supposed to be there, you could change the column name in the database to PR_W11.
When I save these changes and attempt to use WGEN_US_COOP_1980_2010 in ArcSWAT setup, my error now reads:

The INSERT INTO statement contains the following unknown field name: 'PR_W1_2'. Make sure you have typed the name correctly, and try the operation again.:IN, mWriteInputFiles.wgn

It seems PR_W11 is accepted as a valid header. The only thing I can come up with is that somehow the extra "_" is not supposed to be in the column header? However, I would caution that, from this change, the program could now be reading numbers in the column formerly marked PR_W1_1 (changed to PR_W11) as the wet day probabilities for November even though I think they were originally intended for January. Realistically, I don't think this is a valid "fix", but it is the only findings I've come up with after playing around with this problem.

Also, if I go back to previously created .mdb databases for other projects (which include a table called .wgn), there is a column there called PR_W1_1 so clearly this header name has not been an issue in the past. Hopefully others will chime in.

Sopan Patil

unread,
Jan 23, 2014, 3:11:17 PM1/23/14
to arc...@googlegroups.com
Hi Che,

I got an answer from Nguyen Duy Liem a few hours ago via email, and it did resolve my issue.  Below is his solution:

Dear Sopan,

To fix it, you open table "wgnrng" within SWAT2012.mdb, add symbol "_" into columns PR_W1 and PR_W2 like the below figure:

Hình ảnh nội tuyến 1

I hope you succeed!
Liem

I hope this helps you too.

Best,
Sopan

Che Wer

unread,
Jan 23, 2014, 5:01:41 PM1/23/14
to arc...@googlegroups.com

This is great Sopan, thank you!

This worked great for me although, as a note for others, I did have to setup a new SWAT project after making the changes. If you stay in the same project after updating the database, you may continue to get the same error.

Adnan Rajib

unread,
Jan 27, 2014, 1:48:19 PM1/27/14
to arc...@googlegroups.com
Hi Sopan: Could you please forward the email from Nguyen? I am having the same problem but cant solve.
-Rajib

Sopan Patil

unread,
Jan 28, 2014, 5:07:29 AM1/28/14
to arc...@googlegroups.com
Hi Rajib,

I have already shared Liem's email answer in my previous post.  His answer is in red font.

Sopan

Flávio Carvalho

unread,
Jan 29, 2014, 9:23:59 AM1/29/14
to Sopan Patil, arc...@googlegroups.com

Sopan, could you explain better ? I tried your suggestion but it didnt work.
Best

--
You received this message because you are subscribed to the Google Groups "ArcSWAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arcswat+u...@googlegroups.com.
To post to this group, send email to arc...@googlegroups.com.
Visit this group at http://groups.google.com/group/arcswat.
For more options, visit https://groups.google.com/groups/opt_out.

Sopan Patil

unread,
Jan 29, 2014, 9:43:49 AM1/29/14
to arc...@googlegroups.com, Sopan Patil
Here's the solution that worked for me:
1) In your SWAT project folder, open the MS access file called SWAT2012.mdb.
2) In that file, there is a table called 'wgnrng'.  Open that table.
3) In the first column of that table (CRNAME), there are two entries 'PR_W1' and 'PR_W2'.  Change them to 'PR_W1_' and 'PR_W2_' respectively.
4) Save the file and close.  When you reopen your SWAT project and try writing the SWAT tables again, it should work well (it worked for me at least).

Hope this helps.

Sopan

zcy...@qq.com

unread,
Feb 21, 2014, 11:16:40 PM2/21/14
to arc...@googlegroups.com, Sopan Patil
I met the same problem when running SWAT sample 1 and now it was solved, thank you for your sharing.

在 2014年1月29日星期三UTC+8下午10时43分49秒,Sopan Patil写道:

Dipangkar

unread,
Mar 14, 2014, 9:46:20 PM3/14/14
to arc...@googlegroups.com, Sopan Patil
Hi All,
Apparently there was indeed a problem in the data base and the solution worked for few of the members as well. However, even after fixing the problem and creating a new project the problem of "PR_W11" still persists and it does not write the input files.

Further more, I have even tried to work with my older database from previous model of SWAT2012.mdb and in this case also it refused to work

I hope some one can further shed some light on this..

Thanks
Dip
Message has been deleted

Dominic Libera

unread,
Apr 5, 2014, 4:04:02 PM4/5/14
to arc...@googlegroups.com, Sopan Patil
Hey everyone,  

I am having the exact same problem as Dip; after fixing the original problem now I get an error in writing the weather station files because "PR_W11" is an unknown field.

Evan Ross

unread,
Jun 5, 2014, 12:46:16 PM6/5/14
to arc...@googlegroups.com, sopan...@gmail.com
Did you find a solution to the problem of PR_W11?

PRASADSINH DALAVI

unread,
Jun 20, 2014, 2:32:57 AM6/20/14
to arc...@googlegroups.com
Hello Sopan I tried options mentioned by you, but it did not work. its giving error message as shown in this screenshot.
weather_error.JPG

Kerem Güngör

unread,
Jun 24, 2014, 7:44:49 PM6/24/14
to arc...@googlegroups.com
Hi Everyone,

I experienced the very same problem. Unfortunately, I could not find a solution so far. Here is what I noticed though: In my project, the [project name].mdb has a blank wgn table. I compared it with the same table from another functional ArcSWAT project of mine. The table should include the data of the weather station(s) used in weather data simulation. I manually filled wgn table of the problematic project; but, I kept on receiving the same error message mentioned in this thread. Also, I saw that all data I put in wgn table was deleted during the process. Maybe this can give an idea to the ArcSWAT support team and/or other SWAT users to come up with a solution.

Best Regards,

Kerem GUNGOR

Kerem Güngör

unread,
Jun 26, 2014, 10:20:49 PM6/26/14
to arc...@googlegroups.com
Hi Again,

I think I have the solution for the problem. If you update your database first and `write SWAT input tables` afterwards, no error message is given and all the SWAT tables are written. Actually SWAT team has already addressed this issues in the release notes: Please see http://swat.tamu.edu/media/99075/arcswat_version201210_015_releasenotes.pdf.

I attach an image file that describes the simple procedure I stated above.

Good luck in your modeling efforts,

Kerem GUNGOR
Solution.jpg

Onyeanwusi Kingsley

unread,
Jun 27, 2014, 1:46:40 PM6/27/14
to Kerem Güngör, arc...@googlegroups.com
please sir can you help me on how to carry out water quality analysis with swat, it is my problem now.


--
You received this message because you are subscribed to the Google Groups "ArcSWAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arcswat+u...@googlegroups.com.
To post to this group, send email to arc...@googlegroups.com.
Visit this group at http://groups.google.com/group/arcswat.
For more options, visit https://groups.google.com/d/optout.

Pipas Kumar

unread,
Oct 1, 2014, 1:57:09 PM10/1/14
to arc...@googlegroups.com
Hi sopan,

i saw ur post. i am facing d same problem. still not resolved.
pls suggest some solution.

screen shot attached.
file 2.PNG

RAJAT SHARMA

unread,
Oct 5, 2014, 3:02:38 AM10/5/14
to arc...@googlegroups.com
hello sopan,
               i am also facing problem in creating swat input databases tables,little bit different from you,i did as you suggested others in prevous suggestions but ,i am not able to overcome this error message can you suggest me how to resolve this error message.i am attaching screeenshots of my error message here.if anybody faces the same problem ,please suggest me how to overcome from this error message.

rajat kr sharma
DSC_0063[1].jpg
DSC_0064[1].jpg

David Salas

unread,
Nov 17, 2014, 2:02:18 PM11/17/14
to arc...@googlegroups.com
I have run into similar problems and I think it might be the SWAT2012.mdb.  I copied an old SWAT2012.mdb from a previous project into my SWAT folder and had some success.  I have no idea why this might be. 

good luck

David Salas

unread,
Nov 17, 2014, 6:04:48 PM11/17/14
to arc...@googlegroups.com
The latest release of ArcSwat says it corrects for this issue
Reply all
Reply to author
Forward
0 new messages