Microsoft Access can't append all the records in the append query - ms-access-2013

I found numerous threads online about my problem but the I'm very new to access and therefore it's hard to understand.
I'm having the following problem with my Access Database.
Microsoft Access set 0 fields to Null due to a type of conversion failure, and it didn't add 0 records to the table due to key violations, 0 records due lock violations, and 0 records due to validation rule violations. Do you want to run query anyway?
I'm using Acces 2013.And I have imported SharePoint List Data in Access 2013.
Here Following is My Query
INSERT INTO [Content Metadata Master] ([Content Name], [Metadata Name], [Value])
SELECT Content.Name as [Content Name], 'Author 1' as [Metadata Name] , [Gold Metadata].[Author 1] as Value1
FROM Content, [Gold Metadata]
WHERE ((([Gold Metadata].[Case Number])='OM-0057' And ([Gold Metadata].[Case Number])=[Content].[Name]));
Can anyone please help me explain in baby language how this problem occurs and how to resolve it without losing data.
Many Thanks,
Samadhan

Without knowing what the exact structure is of the data coming in, and the table accepting it, it's impossible to give a complete answer. But your problem is, "due to a type of conversion failure". This means that one or more of your values are not of the same type.
This means, you are trying to insert a string into a number field, or a date into a boolean, etc, etc...
Something is inconsistent between what you are pushing in, and what is trying to accept it.
Check the data types.

Related

How to solve (data source adapter error: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000) in cognos?

data source adapter error: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
I am getting this error in cognos.Basically I am working on report enhancement in cognos.I already have searched for solution on internet but provided solution is for oracle, i want solution to be in cognos as i am unable to access database or framework manager. Please let me know what should be the right approch to resolve that error.
enter image description here
I already have searched for solution on internet but provided solution is for oracle. I want the solution to be in cognos as i am unable to access database or framework manager.
Error you got is indeed raised by Oracle, but the question is whether it should be fixed in Oracle or elsewhere (Cognos?).
Generally speaking, this is what happened:
select whatever from some_table
where id in (1, 2, 3) --> this is the IN clause. In Oracle, it is limited
to 1000 elements
I guess that nobody literally types 1000+ elements into the IN list, but some dynamic piece of code might, concatenating value after value until you reach and pass the limit.
I don't know Cognos, but - if that's what really happens, a simple and effective option is to store values which are being used in IN list into a table, and then either JOIN that table to other table(s), or use it as a subquery.
For example:
select whatever from some_table
where id in (select id from a_new_table)
or
select whatever
from some_table a join a_new_table b on a.id = b.id
Presumably the filter is coming from a prompt and someone is selecting everything in the list in the prompt or close to it.
It might be a good idea to try to figure out why there are so many things being chosen. This would require investigation about the business purpose of the prompt.
It might be that our someone needs to see everything so the prompt should be set as optional, which would not generate the where predicate in the SQL.
It might be that the prompt needs to be generated on an attribute (column) which is at a higher grain of dimensional abstraction (i.e. countries rather than cities).
Simply being told fix it in Cognos is not a very helpful instruction and you need to approach the problem with a better understanding of the purpose of the report.

How to take a concat String from column as a Dictionary_Name in dictGet function

I build a dynamic Dictionary in ClickHouse DB. It will create the dictionary before the SQL commands execute. Also, the dictionary name was created at the same time.
The dictionary name was a combined string by date and table name. Because I don't want to keep so much data in the long-term dictionary, the short-term Dictionary could be a great help to release the memory after maybe an hour when no one is using it.
And the error happened.
When I use the dictionary in my SQL commands it is okay with solid commands.
e.g.
dictGet(CONCAT('2022-04-06', 'MyTableName'), 'GetBackColumnName',myKeyColumn) AS col_name
But when I change to using the column from Table, it was broken.
e.g.
dictGet(CONCAT(DATE_COL, 'MyTableName'), 'GetBackColumnName',myKeyColumn) AS col_name
And the error message shows up.
Illegal type String of the first argument of function dictGet,
expected a const string.
Does anyone know how to fix the issue?
My CH version is: 20.8.7.15
I try to find the resolution from the ClickHouse office report but nothing can fix this issue. And I tried lots of functions of String to figure out what happened.

SAP BODS - Getting PK violation from a Table Comparison

I want to read from a table, change a couple column values for a few lines in a query, then update those lines on the same table.
I'm using SAP BODS, and that's what I tried:
I was about to insert images but just found out I can't insert images until 10 rep.
Anyway, I created a DataFlow where I have the same table as source and target.
A query to filter (using where) and change values (using mapping). And then a Table Comparison (where I expected those lines to be set to update, in this particular case), set table name on first entry, then PK in 'input primary key' and then the two columns I want to change in 'Compare columns'. No other changes from default that I can recall.
Got no warnings on 'validate all', and on execution I receive an ORA-00001 for the PK.
So ... I thought the Table Comparison would try to update, but seems like it's trying to insert instead. I want to know what I'm doing wrong and how could I get the job to do those updates. Thanks in advance.
Ps. I did search SO before asking and didn't find anything relevant.
Ok
So, turns out I just found what's going on a few minutes after posting the question.
Wasn't sure if I should answer my own question and took a look at this Etiquette for answering your own question
and decided to come back here and answer my own question.
For some reason I got stuck thinking that it was something to do with the Table Comparison trying to insert a line with a PK that's already there, instead of doing the update I wanted.
But after going back to the job to take another look at the issue, it occurred to me that maybe the problem could be a duplicate in the incoming data set. Made a few adjustment to filter those, and voilĂ .

Filtering Quotes by InventTable

I'm trying to build a report in AX 2009 (SP1, currently rollup 6) with a primary data source of the SalesQuotationLine table. Due to how our inventory is structured, I need to apply a filter that shows only certain categories of items (in this case, non-service items as defined in the InventTable). However, it seems that there is a problem in the link between the SalesQuotationLine and InventTable such that only two specific items will ever display.
We have tested this against the Sales Quotation Details screen as well, with the same results. Executing a query such as this:
...will only show quotes that have one of the specific items mentioned earlier. If we change the Item Type to something else (for example to Item), the result is an empty set. We are also getting this issue on one of our secondary test servers, which for all intents is a fresh install.
There doesn't seem to be any issues with the data mapping from the one table to the other, and we are not experiencing this issue with any other table set. Is this a real issue, or am I just missing something?
After analyzing the results from a SQL Profile run during the execution of the query, it seems the issue was a system bug. When selecting a table to join to the SalesQuotationLines, you have two options: 'Items' and 'Items (Item Number)'. Regardless of which table you select the query executes with, it joins the InventTable with the relation "SalesQuotationLines.ProjTransCode = InventTable.ItemId".
After comparing the table to other layers in the system, I found the following block of code removed from the createLine method (in the SYP layer):
if (this.ProjTransType == QuotationProjTransType::Item)
{
this.ProjTransCode = this.ItemId;
}
Since the ProjTransCode is no longer being populated, the join does not work except on certain quote lines that do have the ProjTransCode populated.
In addition, there is no directly defined relation to the InventTable - the link is only maintained via an Extended Data Type that is used on the SalesQuotationLine.ItemId field. Adding this relation in manually solved the problem.

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Please help, I have been trying to fix this error for the better part of 8 hours so far. I have a report in Crystal Reports that just started throwing this error. I changed a field in the View that is attached to the report, so I opened up my XSD file in VS2010 and renamed the current DT to ViewTracker0 and then pulled in the ViewTracker view. I added my queries from the old DT, ensured that there is no primary key, double checked that each length of the fields were the same as the db, checked to make sure that each column name is named to match the DB. I can preview my data fine in the XSD, as well as in SQL I can run my queries and everything is returned correctly. When I run my report, it dies everytime with this error.
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
What do I need to check next.
Have you tried verifying the database within the Crystal Reports designer, then running the report?
Try traversing GetErrors(), described here:
http://www.fransson.net/blog/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/

Resources