We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to check data from table in different schema instead of default [dbo] using seeInDatabase
seeInDatabase
Error during executing SQL query.
If I use as table name: account.Note:
account.Note
[PDOException] SQLSTATE[HY000]: General error: 208 Invalid object name 'account.Note'. [208] (severity 16) [(null)]
And when I provide table name with schema in this way: [account]. [Note]:
[PDOException] SQLSTATE[HY000]: General error: 102 Incorrect syntax near '='. [102] (severity 15) [(null)]
Example of using method:
$I->seeInDatabase('[account].[Note]', ['ID' => 1]);
class_name: ApiTester modules: enabled: - Asserts - \ApiHelper - REST: url: http://localhost:8074 depends: PhpBrowser - Db: dsn: "dblib:host=xxx.xxx.xxx.xxx;dbname=xxxxxx;charset=utf8" user: xxxxxxx password: xxxxxxxxx dump: 'tests/resources/db/db-schema.sql' populate: true # run populator before all tests
The text was updated successfully, but these errors were encountered:
https://github.com/Codeception/Codeception/blob/2.3/src/Codeception/Lib/Driver/SqlSrv.php
getQuotedName method adds quotes around all identifiers, so you could try to use $I->seeInDatabase('account].[Note', ['ID' => 1]); as a workaround.
$I->seeInDatabase('account].[Note', ['ID' => 1]);
You are the first person to use Codeception with MSSQL in years, so you are welcome to improve it.
Sorry, something went wrong.
No branches or pull requests
What are you trying to achieve?
I want to check data from table in different schema instead of default [dbo] using
seeInDatabase
What do you get instead?
Error during executing SQL query.
If I use as table name:
account.Note
:[PDOException] SQLSTATE[HY000]: General error: 208 Invalid object name 'account.Note'. [208] (severity 16) [(null)]
And when I provide table name with schema in this way: [account]. [Note]:
[PDOException] SQLSTATE[HY000]: General error: 102 Incorrect syntax near '='. [102] (severity 15) [(null)]
Details
The text was updated successfully, but these errors were encountered: