Tsqlt with XML Schema collection - tsqlt

I am currently working on a table schema that has a column that refers to an XML schema collection. After faking the table in my unit test and running the test I got an error message: 'Collection specified does not exist in metadata'.
I have tried to create xml schema collection before faking. but this still causes an error.
Anyone have idea.
Thanks in advance!

Related

Can we create and use Temporary tables in DataStage?

Is it possible to create and/or use temporary tables in the ODBC connector stage of the DataStage?
I'm trying to update the data using a #Temp table in the join statement immediately after populating the Temp table.
I had looked according to the error form the job's log file but couldn't understand what it says,
Error message:
Unrecognized argument: variant='3.5\',
library=ccodbc,
version=1.0,
variantlist=\'V1;3.5::ccodbc\',
versionlist=\'1.0\',
name=ODBCConnector
}'
SAX parser exception thrown: The input ended before all started tags were ended. Last tag started was 'before' (CC_PropertySet::fatalError, file CC_PropertySet.cpp, line 2,266)
Got a solution!
Yes, we can use #Temp tables of SQL Server in DataStage ODBC stage, the query was absolutely perfect but the thing is DataStage couldn't prase the SQL Query. It considered it as DataStage parameter (since parameters in DataStage were bounded with #ParameterName#) So the DataStage compiler consider it as a incomplete parameter and thrown the error as above.
Solution: Use [ #Temp_Table ] to solve the issue.

DynamoDB throws an error when trying to get the item count

I'm trying to get the total number of items in a Dynamodb table. Given below is the C# code that I use.
context = this.DynamoDBContext;
var someClassReuslts = context.Scan<SomeClass>(null);
int itemCount = someClassReuslts .Count<SomeClass>();
When I try to execute this it throws below error
"Unable to convert [Amazon.DynamoDBv2.DocumentModel.Document] of type Amazon.DynamoDBv2.DocumentModel.Document to System.String"
Is it a mismatch of a property in the data type of the "SomeClass" Vs the actual items properties in the DB? Can someone please help?
Found the issue here. I use two different programs to insert data to dynamo db and read data from dynamo db. Both of these programs are supposed to use the same "SomeClass" but unfortunately I had one of the properties altered in the "SomeClass" that I use to read the data (or run the count query) from Dynamo db. Once I fix the data type mismatch. it works fine now.

Not able to insert again after System.Data.UpdateException >> Unique Key

I was working with LINQ in my asp.net application. I've putted a Unique Key on two columns of the 'ColorDV' table. When trying to add a duplicated value like 'ss' I've got the result:
System.Data.UpdateException: An error occurred while updating the
entries. See the inner exception for details. --->
System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint
'TITLE_AR_ColorDV'. Cannot insert duplicate key in object
'dbo.ColorDV'. The duplicate key value is (ss). The statement has been
terminated.
but the problem is that after this exception i can't insert any record in any of the tables, because of the same exact exception. I wonder if LINQ is trying to perform the same previous insert each time.
Please how can I solve this problem?
When you add an object to the ObjectContext, that object stays within the list of objects being submitted to the database, so yes that is the problem. Remove the object and continue, or if an edit try to use the Refresh method on the context to refresh the contents of the object to the original state.
This has an additional approach; can't personally say it works though.

Get data from a Dataset by parameter in WHERE clause

I'm following a tutorial where they explain how to add a Dataset to your ASP.NET web application and how to add a parameter to a SQL query. But it's not really working for me the way they are doing it in the tutorial.
I've added a Dataset to my App_Code folder. In the dataset i made a connection to a database in SQL Server. Now i can get data from my database by giving the dataset a SQL query. In the tutorial they do something like this:
SELECT TOP 20 [ProductID]
,[Name]
,[ProductNumber]
,[MakeFlag]
,[FinishedGoodsFlag]
,[Color]
,[SafetyStockLevel]
FROM [Production].[Product]
WHERE (Color = :Color)
The point in this example is the :Color part. That is how they let it know where to add the parameter. But when i use this query in my Dataset it gives me a warning:
Error in WHERE clause near ':'. Unable to parse query text.
After that he is able to actually add a parameter to the Dataset through the Properties window and test preview his data. That doesn't work for me since it already starts to complain when i add my query.
What can i do to solve this problem?
Parameters in Sql-Server have a # in front:
WHERE (Color = #Color)
Configuring Parameters and Parameter Data Types

Can not make generateChangeLog working in liquibase to export data from existing database

I read some similar questions, but I still can not figure out how to export data or schemas from an exiting database using liquibase. The database i am using is sqlite, and I always got problem.
java -jar liquibase-1.9.3.jar --driver=org.sqlite.JDBC --classpath=lib/sqlite-jdbc-3.7.2.jar --changeLogFile=test.data --url=jdbc:sqlite:test.db --diffTypes="data" generateChangeLog
the error is: Migration Failed: no such column: 'DECIMAL_POINTS'
I just have a testing table with 2 fields: ID (integer type), and name (VARCHAR type).
Can somebody help? Thanks.
I couldn't find more examples about using liquibase with sqlite database. So, I tested and figured out by myself, and commented below:
You need to pick up right jdbc engine for liquibase, when I changed sqlitejdbc engine from sqlite-jdbc-3.7.2.jar to sqlitejdbc-v056.jar (http://www.zentus.com/sqlitejdbc/), it works. So it is important to pick up right one.

Resources