I'm extremely new to AX and am starting with something very simple. I need to increase the size of a column named Invoice. In the AOT, the StringSize property on the column is greyed out so I cannot change it there.
In SQL Server (2005) the column is a nvarchar(20) so I'm thinking AX might just be using whatever DataType is defined in the db.
If I attempt to increase the size of the column in SQL Server it tells me that the table would need to be dropped and re-created.
What is the best way to increase a column size in AX?
To increase the capacity of the column you would normally change the StringSize property on the InvoiceId extended data type.
However, in this case the InvoiceId extended data type extends from the Num extended data type and you will need to make the change there. This size increase will also affect all other extended datatypes that extend Num.
This extended datatype can be found in the AOT at \Data Dictionary\Extended Data Types\Num.
Related
I have a Teradata table which contains LOB objects in different columns.
When I do a query, it pops up window to ask where to save the LOB objects as txt files onto my disk.
LOB Information (due to my SOF level, I cannot display the screenshot)
My question is, is it possible to display the content of these LOB objects inline(inside the cells)?
I found the solution:
Changed Configuration
(Due to my SOF level, I cannot show image directly in my post)
Changing the "Handle the BLOB/CLOB size" to smaller values solved my problem partially.
The reason why it's partially is because the LOB Information pop-up still there.
If you want this for viewing in Teradata SQL Assistant only (it can't display arbitrarily wide columns):
If the strings in the CLOB columns are short enough, cast them to varchar in your query:
select id, cast(clarge as varchar(1000)) as WhatIsInCLob
from ...
If the values can exceed varchar limits (depends on the character set of the CLOB, and session character settings, but easily thousands of chars), then use SUBSTRING to limit the output:
select id, cast(substring(clarge,1,4000) as varchar(4000)) as WhatIsInCLob
from ...
There is more specific limit information here: https://docs.teradata.com/r/Teradata-SQL-Assistant-for-Windows-User-Guide/October-2018/Getting-Started/Limitations
I have table like
(1st photo)
table
What I should do to take this value to while select in x++?
(2c photo)
value
The short answer is you would need to take the return from the lookup, find the value in the table via the returned value (key), and take the Name field.
So this would be the data in your case for the first result:
InventLocation::find('11').Name
This is what's called a lookup. When you do a lookup, there are multiple methods that AX will determine what values to display. The one you're looking at is a lookup based upon the Extended Data Type relation.
EDT - In this case \Data Dictionary\Extended Data Types\InventLocationId
Table - which has a reference table of \Data Dictionary\Tables\InventLocation
Primary Key - which has an alternate primary key of \Data Dictionary\Tables\InventLocation\Indexes\InventLocationIdx, which I believe in this case determines the return value
AutoLookup - and the AutoLookup located at \Data Dictionary\Tables\InventLocation\Field Groups\AutoLookup determines which fields are displayed to the user as information.
If you want a custom lookup to return the InventLocation.Name field, you should look at the different methods available to you. This blog post is an excellent start to see different methods: https://kashperuk.blogspot.com/2009/04/lookup-methods-tutorial-custom-list.html
In Teradata DB, generally expectation would be to get the data size for a table, but for my task I need to identify size of a View. This view contains joins from 3 different tables and all I could identify is the count of the View - 757747
Should I directly use this count and apply formula to determine it size?. If so what would be formula, is it sum(currentperm) I am confused, please advise
I want to show the string value as one of the measure value. When a fact table has a integer value and string value respectively and also has some foreign table's keys. Then I could show the integer value as a measure value, but I couldn't show the string value as a measure. Because Measure element in schema of cube (written in XML) doesn't allow that a measure value doesn't have 'aggregator'(It specify the aggregate function of measure values). Of course I understood that we can't aggregate some string values. But I want to show the string value of the latest level in hierarchy.
I read following article. A figure (around middle of this page) shows a cube that contains string value as a measure value. But this is an example of Property value of Dimension table, so this string value isn't contain in fact table. I want to show the string value that contains in fact table.
A Simple Date Dimension for Mondrian Cubes
Anyone have some idea that can be shown the string value as a measure value? Or I have to edit Mondrian's source code?
I have had the same problem and solved it by setting the aggregator attribute in the measure tag to max.
e.g.
\<Measure name="Comment" datatype="String" column="comment" caption="Comment" aggregator="max"/\>
Why does it need to be a measure?
If no aggregation would naturally be applied to it and you just want the string value, it is a dimension, not a measure. Trying to force it to be a measure is not the best approach.
I think the figure you reference is just showing a drillthrough, and that the only actual
measure is Turnover. The report layout is slightly misleading in terms of dimensions and measures.
You can just use the fact table again in the schema as a dimension table if for some reason you don't want to split this out into a separate physical table.
Sounds like the string may be high cardinality to the integer, possibly 1:1. Depending upon the size of your cube, this might or might not be a performance challenge. But don't try to make it a measure.
Good luck!
How to create a primary key as A1/D-M/100000 in SQL Server 2005 in Visual Studio 2008 ?
Use varchar(20) as column type and generate the primary key value from the code.
Your request is not possible in SQL Server as requested, which makes me want to tell you to do some more reading.
However, you can achieve something similar by creating a primary key in Visual Basic, and storing that value in a char or varchar field in SQL, as suggested by Adrian Godong's answer.
That said, what I would do if this were my database, is create a normal PK using int or bigint (depending on how many rows I'm planning to store), and using a second column as char or varchar, with an appropriate index, to store the Ax/D-M/xxxxxx values.
What you are wanting to do is mix business rules with SQL Server's database rules, and that's a very bad idea. SQL does not care what your data looks like, so you should not force it to do so. Your business rules may change down the line, and this would be much easier to accommodate if you do a proper PK to start with, that does not rely on some arbitrary naming convention.
What parts of that key are fixed, which change from row to row??
E.g. where does the "A1" or the "D-M" come from? Are they the same for all rows? Do they change from row to row??
If those parts are fixed, and only the big number in the middle needs to change, you could:
define a column of type ID INT IDENTITY(100000,1) for the number
define a computed column like this:
ALTER TABLE dbo.YourTable
ADD YourPKField AS 'A1/D-M/' + CAST(ID AS VARCHAR(6)) PERSISTED
In that way, SQL Server would auto-increment your ID field, and YourPKField would contain the values:
A1/D-M/100000
A1/D-M/100001
A1/D-M/100002
A1/D-M/100003
....
and so on - automatically, without you doing anything more.
Use an INT IDENTITY(100000,1) as your Primary key.
Add the calculated (displayed) key wherever you need it (queries...). It's decoration, and as such, it's part of the front-end, not of your data.