Practical limitations to user defined table
Hi all,
I am thinking of setting up a user defined table which will have 5 columns and around 45,000 rows. It will be used in a simple formatted search to retrieve the value in column 5 when the values in columns 3 and 4 match an item code and an invoice header code on an invoice.
Will a table of this size slow things down significantly?
Regards, David.
Hi David,
It shouldn't be that slow, but if you're worried about performance, you can also add indexes (keys in SBO) to the UDT.
For that go to User-Defined Field - Managment (I'm using SBO 2007), select the table and press the button Keys. Make sure no one else is connected for you to add the index (not even an add-on), otherwise you'll get an error.
Hope this helps,
Ian
Similar Messages
-
How do i declare a user defined table type sproc parameter as a local variable?
I have a procedure that uses a user defined table type.
I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
,@startDate NVARCHAR(50)
,@endDate NVARCHAR(50)
AS
BEGIN
DECLARE @local_accountList AS integer_list_tbltype
DECLARE @local_startDate AS NVARCHAR(50)
DECLARE @local_endDate AS NVARCHAR(50)
SET @local_accountList = @accountList
SET @local_startDate = @startDate
SET @local_endDate = @endDate
CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
[n] [int] NOT NULL,
PRIMARY KEY CLUSTERED
[n] ASC
)WITH (IGNORE_DUP_KEY = OFF)
GOWhy are you asking how to be an awful SQL programmer?? Your whole approach to SQL is wrong.
We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language?
The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL.
The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it.
There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name.
In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Dear Experts,
I would appriciate your advice on the sales budget screen that I am currently woking on.
the screen contains a matrix with a cfl on the product group column and a couple of columns stand for sale figures for each month.
this screen will be called form the BP form. so i would pass the selected BP code to my form.
I am not sure whether a user defined table is the answer to this job.
if i add productGroup,productCode,cardcode,Jan,Feb, ... user defined fields to this table then the system will add Code and Name fields automatically to this table, if the userdeined table is the right way to go for this job, what values i should held for the code and name fields considering both of these fields are stand alone primary key fields.
Many thanks.
Maryam.I usually load the same value into both fields, but since the code field is only eight bytes its kind of limiting. If you don't have any information to load in the table that would be unique, like a date or year field, (or your product code if its less than 9 bytes & will be unique) then a sequential number works fine. There are threads on this forum that show different ways to do it, but one way is basically to select max(code) from the table, convert the value to numeric, add one to it and then use it as the value for both fields.
Here's a link to a thread I posted with some code on the specifics of assigning the next sequential number as code and name:
[Re: Unique Value in Code and Name]
Edited by: John Chadwick on Sep 18, 2009 2:53 PM -
Dealing with User Defined Tables with the DI Server
I have a general question about the best way of working with the data in user defined tables using the DI Server. It appears from previous posts that it is not possible to use the standard methods such as UpdateObject. Also since update/insert and delete statements or explicitly forbidden using the ExecuteSQL method then how do we interact with the data in the tables?
Do we need to code our own data access layer for this type of access and is this a good practice?
Is this type of functionality going to be available in a future release of the DI Server?
ThanksUsing SQL for Update/Insert/Delete is not forbidden on UDTs (at least non-UDO UDTs; UDO UDTs are somehow in a gray area since they carry internal fields + e.g. inserts require further manipulation in B1 tables...)...
I.e. using ExecuteSQL to add data into UDTs is OK for DI Server...
HTH,
Frank -
Guys.. How can i insert my data to my user defined table (Master Document), i have write code:
Set oUserTable = oCompany.UserTables.Item("TR_MD_FAKPAJAK")
oUserTable.Code = "1"
oUserTable.Name = "TORO"
oUserTable.UserFields("U_field1").Value = "toro"
oUserTable.UserFields("U_field2").Value = "toro"
oUserTable.UserFields("U_field3").Value = "toro"
oUserTable.UserFields("U_field4").Value = "toro"
oUserTable.UserFields("U_field5").Value = "toro"
Dim retval As Long
retval = oUserTable.Add
If retval <> 0 Then
oCompany.GetLastError lErrCode, sErrMsg
MsgBox lErrCode & " " & sErrMsg
Else
MsgBox "Masuk"
End If
my question is, when i run always display error "-4002 To Generate This Document, first defined the numbering series in Administration Module",
any idea guys ??
ThxHi Ria,
Unfortunately you cannot insert data in to a UDO table using the DI API (by marking your table as a 'Master Document' table you have made your UDT part of a UDO). It is one of the current limitations with working with UDOs. All data must be entered through the UI (ie manually).
If you just want to store data in a UDT then it is best to create the table as 'No object'. You can then use the DI API to read and write data to your table. However, you do lose the UDO functionality (eg no automatic saving or searching etc).
Kind Regards,
Owen -
How to pop-up a text box for a grid item on a user defined table?
Hello,
I have a user defined table with a grid & one of the columns is for comments. What I'm trying to do is to pop up a text box when double clicking in the column field. This would be the same as the Item Details column in the Sales Order ittems grid.
Thanks,
RonPlease post your question on SDK forum. Only SDK could meet your need.
Thanks,
Gordon -
Print Layout to User Defined Table
Hello guyz..
I want a make preprinted for my user query from user defined table where the header information is from another query.
I guess, the base template User Report (system) can only show the repetitve data from one query but the header area is not,
could you help, showing the header information from another query ??
Thanks RegardsRia
The word is that you cannot use the PLD with user defined tables (i wish it was possible). So in any case to do that you have to use third party tools such as Crystal Reports and Reporting Services -
How to create a Foreign key relationship between 2 user defined tables...
Hi Folks,
I have created two user defined tables... Where in i want to create foriegn key relationship between the 2 tables.... Can anyone guide the step by step procedure to do this scenario...
Any help would be highly appreciated...
ThanksHi
1. In the 2nd table call the field of the 1st table which is a primary key.
2. Give the same field and dataelement name.
3. Select that field and then click on the foreign key field icon which is beside Search Help button.
4. Then give short text, and the 1st table name.
5. Then in the below box give the 2nd table name and 2nd table field name which you have called from 1st table.
6. Then click on copy, then u will be able to see Check table name and check table field name beside foreign key table name.
7. Then again click on copy.
Regards
Haritha. -
How to fill the records from a User Define Table to PO item Grid
Hi To all,
I need to fill data from User Define table records into Purchase Order Item Grid.
I created an UDF Filed in PO - Header Part - "PRS"(Filed Name)
By using Formatted Search in itemcode column, i called a query,
"Select itemcode, qty from (@user define tablename) where PRS = $http://OPOR.U_PRS"
For eg:
Output from querry
ItemCode Qty
ABC 1
DEF 2
DFG 7
SDGD 9
By using formatted search it is filling only first data in to itemcode column in PO Grid.
Please help, how can i fill ALL the data in to my PO Grid?
Thanks in Advance
SAGARThe easisest way is to create datasource and the result bind to grid.
Datasource:
oDBDataSource = oForm.DataSources.DBDataSources.Add("@usertablename")
Dim xoConditions As SAPbouiCOM.Conditions
Dim xoCondition As SAPbouiCOM.Condition
xoConditions = New SAPbouiCOM.Conditions
xoCondition = xoConditions.Add
xoCondition.BracketOpenNum = 1
xoCondition.Alias = "u_zn"
xoCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
xoCondition.CondVal = "cond"
xoCondition.BracketCloseNum = 1
oDBDataSource.Query(xoConditions)
binding (example for matrix, in grid is simillar)
oMatrix.Clear()
Dim cols As SAPbouiCOM.Columns
Dim column As SAPbouiCOM.Column
cols = oMatrix.Columns
column = cols.Item("colX")
column.DataBind.SetBound(True, "@usertable", "u_x")
oMatrix.LoadFromDataSource()
hoep it helps
Petr -
Error creating user defined tables: Ref count (-1120)
Hi all !
I have to create user defined tables per code, so I wrote <b>2 main functions</b>, first <i>to create a table</i> (with TableName,TableType and TableDescription properties)and and <i>second to add fields</i> (to a certain table which is sent as parameter).
I call these functions to create multiple tables. For the first 6 tables it works totally ok. But beginning from the 7th table it gives that "<b>Ref count for this object is higher then 0.</b> " (-1120) error. All parameters are ok just as the first 6 tables.
Found such an explanation like below in help files.
<i>The DI API allows only one instance of a meta data object at a time. This maintains data integrity by preventing any manipulation of a business object while modifying the object's user fields. Therefore, verify that no other DI object is active except the meta data object.</i>
But why do I get such an error after sixth call of the function (but not beginning from the second table )?Gül,
Have you tried doing some grbage collection?
Search for a topic: "Add Usertables and Fields while having a recordset"
HTH
Juha -
Error while adding records in user defined table
Dear all,
I am adding a record in user defined table using .add() method. the code is given below. while adding it raises the following error
"-1[Microsoft] [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '-3 @BG_MAILSETTINGS' to data type int. (CINF). "
All the fields are varchar date type.
Dim oUDT As SAPbobsCOM.UserTable
oUDT = oCompany.UserTables.Item("BG_MAILSETTINGS")
With oForm.DataSources.UserDataSources
oUDT.Code = "1"
oUDT.Name = "SMTPSERVER"
oUDT.UserFields.Fields.Item("U_SERVER").Value = .Item("EDTSMTPSVR").ValueEx
oUDT.UserFields.Fields.Item("U_EMAIL").Value = .Item("EDTFEMAIL").ValueEx
oUDT.UserFields.Fields.Item("U_PORT").Value = .Item("EDTSMTPPRT").ValueEx
oUDT.UserFields.Fields.Item("U_USERNAME").Value = .Item("EDTSMTPUSR").ValueEx
oUDT.UserFields.Fields.Item("U_PASSWORD").Value = .Item("EDTSMTPPWD").ValueEx
oUDT.UserFields.Fields.Item("U_AUTHENT").Value = .Item("CMBSMTPAUT").ValueEx
K = oUDT.Add
If K <> 0 Then
oCompany.GetLastError(iErrCode, sErrMsg)
MsgBox(CStr(iErrCode) & "-" & sErrMsg, vbCritical, "Error")
Exit Sub
End If
End with
Could any one please say the solution for this.
Many thanks,
Manikandan.
Edited by: Rui Pereira on Dec 23, 2008 3:49 PMDear Manikandan P,
Is there any change and check in stored procedure SBO_SP_TransactionNotification?
Best Regards
Jane Jing
SAP Business One Forums team
Edited by: Rui Pereira on Dec 23, 2008 3:56 PM -
DI error when binding user defined table
Hi,
I am using matrix. Im binding a User defined table '@NEW' to a Datasource
oForm.DataSources.DBDataSources.Add("@NEW")
I also bind the fields to column of the matrix as given below
oColumn = oColumns.Item("CodeNo")
oColumn.DataBind.SetBound(True, "@NEW", "U_CodeNo")
When the table @New contains no records i get error while binding the fields to the matrix.
I tried the same using STANDARD SAP tables.I am not getting any error and it works fine.
Can anyone help me?Hi,
I am using matrix. Im binding a User defined table '@NEW' to a Datasource
oForm.DataSources.DBDataSources.Add("@NEW")
I also bind the fields to column of the matrix as given below
oColumn = oColumns.Item("CodeNo")
oColumn.DataBind.SetBound(True, "@NEW", "U_CodeNo")
When the table @New contains no records i get error while binding the fields to the matrix.
I tried the same using STANDARD SAP tables.I am not getting any error and it works fine.
Can anyone help me? -
Creating user defined table in SBO-COMMON
Hello experts,
I'd like to create a user defined table in SBO-COMMON. I'll tell you why:
I have successfully created a SAP B1 addon which adds freight costs to an order if the total amount is under a certain threshold. We have 2 administrations running, a live one and a test administration. We have put the connectionstring to determine the expense code of the freight costs in the exe.config-file of the addon.
We want to be able to point the addon from one administration to the other by modifying only one value, a centralized value, independent of SAP administration. The most proper way to do that in my opinion is to put it in SBO-COMMON and the only logical way to do that is a user defined table in SBO-COMMON.
Is there such a way?
My alternative is to abuse another database on the server and just add the info there, but I'd prefer to store it in SBO-COMMON.
Thanks for your time!
VincentUDT cannot be created in sbo-common. You may create new db and work with table in this db (but it will be not UDT, but standard sql table), or create new company db only for this purposes and create UDT there.
-
Error while linking user defined table to user defined field using vb6.0
Hi,
I am creating a userdefined field on a SAPB1 table(PDN1) using vb 6.0
I am trying to link this field to a user defined table.
When i do that i get the following error:
"The field 'Related table' should consist of 8 alphanumeric chracters with no valid or default values"
When i try to do the same thing from SAPB1(not using code) there is no such problem.
My vb code is as follows:
Set oUserFieldsMD = oCmp.GetBusinessObject(oUserFields)
oUserFieldsMD.TableName = "PDN1"
oUserFieldsMD.Name = "OB_Locn"
oUserFieldsMD.Description = "WH Location"
oUserFieldsMD.Type = db_Alpha
oUserFieldsMD.EditSize = 30
lRetCode = oUserFieldsMD.Add
If lRetCode <> 0 Then
oCmp.GetLastError lErrCode, sErrMsg
MsgBox sErrMsg
GoTo Err_
End If
If Not oUserFieldsMD.GetByKey("PDN1", 0) Then
MsgBox "Error"
GoTo Err_
End If
oUserFieldsMD.LinkedTable = "OB_TEST"
lRetCode = oUserFieldsMD.Update
Your help will be much appreciated.
Thanks.Great Sébastien!
Looks like we could not survive here one day without your contribution
Best regards,
Frank
PS: For readers of this thread who don't understand why
EditSize
must be "8":
This is the size of the
Code
field in the user-defined table to which the new field OB_Locn (in the DB it will be U_OB_Locn) is linked to...
So, it should be preferrably of the same size. -
Syntax error when creating a user-defined table type in SQL Server 2012
Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
CREATE TYPE ReportsTableType AS TABLE
( reportId INT
, questionId INT
, questionOrder INT );
Results:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS'.Hope these posts could help,
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
Regards, Dineshkumar,
Please Mark as Answer if my post answers your question and
Vote as Helpful if it helps you
Maybe you are looking for
-
Kingston Value Ram modules on PM dual core 2.0Ghz
I have a powermac dual core 2.0 with 512mb non-ECC RAM. I'm searching for memory to upgrade my mac but the only kingston memory modules that i find in every local store i visited match the Part Number KVR533D2N4/X (X = 512, 1, 2, 4), that corresponds
-
Selecting using a field that stores a column_name to be used in the where
I have a table REPORTING_CRITERIA with fields and field values: gl_criteria1 = 'cc.segment5' from_value1= '1123' to_value1= '1130' gl_criteria2 = 'cc.segment5' from_value2 = '1140' to_value2 = '1150' I am trying to run a select where I pull records w
-
ITunes is not fixing itself need help
I cannot use iTunes on my PC using windows vista home, I cannot remove it or try to do another install. I cannot reinstall using the disk or updates to install, remove, or repair it: Whenever I install via the download from Apple.com, the install sto
-
How to find/create SSO userid and password for oracle forms
hi all, I have applied sso to one of my forms application by creating entries in the formsweb.cfg file. ssoMode=true ssoDynamicResourceCreate=true now single-sign-n has been applied to the forms application.What will be the user-id password that must
-
Hi there In the Stock Requirements List, some of my parts have more than one PO and an additional Requisition. The POs have the exception message '20 - Cancel Process'. Seemingly MRP creates more Reqs despite the fact that a PO exists already. No cha