New To FitNesse - How can i verify that my database query has successful run - fitnesse

I am using dbFit.Oracle.
I am using FitNesse to write an acceptance test making API calls.
How can I verify that my Oracle db query in the test case has run successfully? I am trying to update some column in the database, but no success.
Or are there any preconditions I need to take care of before running the query?
This is my query:
|update | d3_account |
|Statement_preference_type= |SOURCE_ACCOUNT_ID|
|PAPER | | IDAP111112000|

By default DbFit is using autocommit=false mode. You need to set it to true
or explicitly run commit command using DBFIt

Related

CREATE USER... fails on Azure SQL Edge running in Docker (MacBook Air M1)

I have an Azure SQL Edge running in Docker, but I'm not able to create new database users. CREATE USER gives following error:
"You can only create a user with a password in a contained database."
If I try to change containment using ALTER DATABASE TestDB set containment=PARTIAL; there's no success either. Error says: "The sp_configure value 'contained database authentication' must be set to 1 in order to alter a contained database. You may need to use RECONFIGURE to set the value_in_use. ALTER DATABASE statement failed."
I've also tried EXEC sp_configure 'contained database authentication', 1;, but it is giving: "The specified option 'contained database authentication' is not supported by this edition of SQL Server and cannot be changed using sp_configure."
Is there something else, I could try, or is this what it should be, and I should just use database as sa? Any help would be much appreciated.

Snowflake ODBC ruby - How do i set session variable?

I need to run ALTER SESSION SET USE_CACHED_RESULT = FALSE before executing my query.
I am using sequel and ruby-odbc gem
When executing multiple query in single go its giving below error
Sequel::DatabaseError (ODBC::Error: 0 (8) A)
Any way i can get this to work, my end goal is that my sql queries should always ignore the cache

String-based queries like [executeUpdate] are currently not supported in integration test environment

I am trying to run test cases in an integration test environment.
In service, executeUpdate has been used:
def update1 = Abc.executeUpdate("update Abc a set a.changeStatus = :status,a.remarks=:remarks where a.id =:id",[status: "Verified",id:1,remarks:remarks])
But while running the integration test of the service I get the following error:
java.lang.UnsupportedOperationException: String-based queries like
[executeUpdate] are currently not supported in this implementation of
GORM. Use criteria instead.
I am using Grails 2.4.2.

Is there a way to execute SQL functions directly using rails dbconsole

When you fire up rails dbconsole you can easily execute commands such as:
select * from users limit 1;
However some commands require using Postgres functions such as now() or timezone(zone, timestamp)
How can you evaluate Postgres functions without needing to select data?
It would be nice to be able to play with some of these functions without having to wrap them into a select statement.
=> now()
# now | 2013-11-18 22:32:48.814876+00
How can I do this directly from dbconsole?
The Rails database console is purely a way to interface with the specified database's command line. It doesn't provide any Rails wrappers or convenience methods – you're limited to whatever the database language provides. In PostgreSQL, the correct query to retrieve the current timestamp with timezone is as follows:
SELECT now();

ActiveRecord: Name already in use within the application, where?

I'm attempting to generate a scaffold but generating it I receive the following error:
rails generate scaffold foo
invoke active_record
The name 'Foo' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
Is there a command to find out exactly where this name is being used within my application?
I don't think there is a way to find the file or source of any object/class/module. Also rails has open class concept so the class can be defined or refined in many files so we can not track the same.
but you can check if the name is exist for any object by following
Module.constants.include? "Foo"
Using rubymine, there are a few ways you can do this. There is a "find usages" command that will find all location where a method, variable, etc. are used. There is a "jump to declaration" which in your case would be useful. It will jump to the spot where something is defined. (a class, module, variable, method). there is also a powerful search feature. In this case, search in path would allow you to search the entire application (including external gems being used). You can force case sensitivity on your search to only yield class / module names etc.
Szuper tricky! For me the model name was stuck in memory in the Spring cache system. Had to kill the spring process to free it up.
Look for this when you attempt the command:
Running via Spring preloader in process 57104
Expected string default value for '--serializer'; got true (boolean)
invoke active_record
The name 'Admin' is either already used in your application or reserved
by Ruby on Rails. Please choose an alternative and run this generator
again.
If you see that Spring comment, try looking for spring in your processes and killing:
ps -ef | grep spring
find the id:
501 54701 30654 0 1:43PM ?? 0:04.83 spring app | server | started 8 mins ago | development mode
501 30654 1 0 Tue03PM ttys000 0:03.82 spring server | server | started 142 hours ago
and kill
kill 30654
Thats just one of the given possibilities! Foo is a reserved Word. Ruby also reserves words that arent used as a Model/Module name already. For example you also cant create a model called Configuration eaven there is no class thats clled Configuration.

Resources