Cannot use the Insert query for putting bulk data using dbfit in fitnesse

368 views
Skip to first unread message

priya

unread,
May 23, 2012, 1:45:03 PM5/23/12
to dbfit
Hi All,

I am using the dbfit library for all the database operations -
delete,update,select (all using the Execute command). But I need to
insert Bulk data for loading the database table.I am writing the
following test in
Fitnesse:


!define COMMAND_PATTERN {%m %p}
!define TEST_RUNNER {C:\Users\Shardul\Desktop\Fitnesse\dbfit-complete
\dotnet2\FitServer.exe}

!define PATH_SEPARATOR {;}
!path C:\Users\Shardul\Desktop\Fitnesse\dbfit-complete\dotnet2\*.dll


|Execute|!-INSERT INTO [SampleDB].[dbo].[Customer] (CustomerID,
CustomerName) VALUES (6,'Test');-!|

!|Insert|[SampleDB].[dbo].[Customer]|
|CustomerID|CustomerName|
|1|ABC|
|2|DEF|
|3|GHI|
|4|JKL|

Note:
The inserts with the Execute fixture are working fine but the bulk
data rows using the Insert fixture result in following error:

System.ApplicationException: Cannot read columns/parameters for object
[[SampleDB]].[[dbo].[Customer]] - check spelling or access privileges

Can anyone please help me resolving th error ?

MatMan

unread,
Jun 30, 2012, 4:39:29 PM6/30/12
to db...@googlegroups.com
I've sometimes seen this occur when using SQL Server.
 
Sometimes a 3 part object name works fine and sometimes the error below is observed. I'll try to debug this. May be permissions in the DB.
 
Try setting up the default database and default schema for the user and removing these from the object name in your test page.
 
I'll report back soon.

MatMan

unread,
Jul 8, 2012, 8:40:33 AM7/8/12
to db...@googlegroups.com
Ok. You need to have the default database for the user you're logging into the DB with set to "SampleDB" (from your example).
 
It's a bug in DbFit really, it should query SampleDB.sys.columns but it just queries sys.columns to get the table column metdata.
 
One to fix...
Reply all
Reply to author
Forward
0 new messages