Adding Current_Timestamp to HANA table
Hi,
We have tables that are replicated from SAP using SLT.
We are trying to add a column to that table, so we can capture insert/update datetime every time a record is inserted or updated in the table.
We have two options currently:
1. We can add the physically add the column to the table and use the transformation from SLT server to update/insert the date with current_timestamp.
2. Adding trigger to the tables - We were told by SAP that this was not a good practice for replicated tables.
Instead of configuring in SLT server, we are trying to see if we can do this using virtual column like "Alter Table xxx Generate Always As
current_timestamp).
Apparently we cannot use Current_Timestamp in Generated As columns.
My question is does anyone know any work around where we can assign current_timestamp to virtual columns?
Or is there any way I can accomplish this other than using virtual columns?
I cannot use default in a column as it needs to update for both insert and update.
Thank you for your help.
Hyun
Guys,
what is the use case here?
Why is it even relevant to know the server time when a record had been inserted by SLT?
Be very clear about that this is not an application level timestamp.
It doesn't tell you when the record was changed in the application nor when it was valid for the application.
So, what is behind the mysterious scenario to have a column that is automagically filled with the DB server timestamp of when a record is gets inserted/updated in a table?
- Lars
Similar Messages
-
Importing data- using xml file into HANA Table
Hi,
We are using (HDB STUDIO ) - revision 60.......
Is it possible to import data using XML file into HANA table (Master,Fact tables)?
(Without using any intermediate adapters for conversion of data.....)
Can any one suggest us........
Thank you.Hi user450616
I am a bit confused about what you are trying to achieve.
Are you:
1. importing a CSV file into APEX
2. adding an extra column to the Oracle Table
3. populating the extra column with the CSV filename?
Let us know if this is what you are trying to do.
Cheers,
Patrick Cimolini -
I have created a HANA Table from a excel file . Now I want that this table should not be modified by anyone else except me. I tried this by adding the table in object privileges and then selecting the checkboxes Insert,Update,Delete with option No--> Grantable to others. But this is giving me a error that
Grantor and grantee cannot be same .
Thanks,
Nikhil.Hi Nikhil,
I concur with Krishna comments and there was typo in my earlier post,it should be like:
Mostly, if you have created the table in your User like Nikhil_schema. It will be not visible to other users.
Alternatively, if SQL privilege like NO update can be also set the USER_B. In this case USER_B,will never able to update any table in HANA.
Regards
Santosh. -
Adding data to multiple tables using one form in Access 2010?
Hi All,
I have a access database with two tables and I want to create a single form to enter data into that tables.
How to adding data to multiple tables using one form in Access 2010?
I don't have to much knowledge of access database?
Please help me
Thanks
BalajiYou really don't enter identical data into 2 tables. You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables).
Maybe you need to read this.
http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
Think about it this way... What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change. WHOOPS!! Now, you've got a BIG problem. For instance, you have a customer
named Bill Gates. In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039. Now you have 2 addresses for Bill. Why would
you want that??? Which is right? No one knows. If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
and which is wong...and then update the one that is wrong.
Post back with specific questions.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
How to see Added Row in a table
Hi
i have taken atable with visible row count 5 and ihave taken a button to add new row for that i have written code in action of that button,when ever a new row is added that added row below the 5th row, to see that added row ishould click on UP button of table,*what i want i as soon as new row added 1st row of table should go up and remaing 5 rows should appear(2,3,4,5,6 rows) ,suppose if i click on add row 2nd row should go up and remaingrows should appear(3,4,5,6 rows).please help me out of this problem
Thanks
KishoreHi Kishore,
Try this.
public void onActionAddRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionAddRow(ServerEvent)
int row = wdContext.nodeCustomer().size();
IPrivateTestCompView.ICustomerElement custElm = wdContext.createCustomerElement();
custElm.setCname("");
custElm.setCno("");
custElm.setCsal("");
wdContext.nodeCustomer().addElement(custElm);
//for swap the rows
for(int i=1;i<=row;i++)
wdContext.nodeCustomer().swapElements( 0, i );
//@@end
Regards,
Mithu -
Update beans after adding columns to DB tables
I am trying to use JDeveloper 10G , Studio Edition Version 10.1.3.0.4.3673
I am having difficulty finding out how to update CMP Entity Beans
after adding columns to DB tables.
I have found descriptions of how to do these from four sources.
None of these methods work.
They all refer to menu options, buttons or fields that aren't in the JDevb IDE.
List of options that don't exist :
"Synchronize with Database"
"attributes"
"Add from table"
"New from Table"
"Fields Tab"What version of EJBs are you using?
The only option I know of for EJBs will be to generate the bean from the table again, or manually add the field to the EJB.
The "Synchronize with Database" operation is there for ADF Business Components but not for EJBs. -
Adding a Row to Table, ComboBox as a TableCellRenderer Problem !!
Hell All:
I have a JTable with one of the Cell as ComboBox. Initially I draw the JTable with Three Rows and the
the ComboBox in the Second Column works fine. I see each comboBox has different Items. The ComboBox also has a Renderer (as I am customizing the Item's Text )
Here is the snippet from my Code.
==========================
// UIEditSubAllocation.ALT_ACCOUNT = 2;
// Get the Viewindex.... to get the correct column
int viewIndex = this.m_suballocTable.convertColumnIndexToView(UIEditSubAllocation.ALT_ACCOUNT);
// get the Table Column...
TableColumn altActColumn = this.m_suballocTable.getColumnModel().getColumn(UIEditSubAllocation.ALT_ACCOUNT);
// Create Three ComboBox..
JComboBox[] altActCell = new JComboBox[3];
for (int i =0;i< 3;++i) // adding Three Rows of Table Data...
String [] alternateAccounts = new String[4];
for(int j = 0; j < alternateAccounts.length; j++) // Each Alternate Accounts i.e combobox has 4 items..
alternateAccounts[0] = "Tom";
alternateAccounts[0] = "Vic";
alternateAccounts[0] = "Tracy";
alternateAccounts[0] = "Andy";
altActCell[i] = new AltAccountComboBox(alternateAccounts,this.m_suballocTable);
} // End of adding Three Rows
altActColumn.setCellRenderer(new AltAccountTableCellRenderer());
if (viewIndex >= 0)
ComboBoxEditor altActCellEditor = new ComboBoxEditor(altActCell);
altActColumn.setCellEditor(altActCellEditor);
The CombBoxEditor code is...
ublic class ComboBoxEditor extends DefaultCellEditor
* Constructs a ComboBoxEditor that uses an array of items of type object.
* @param items - an array of items of type object
public JComboBox[] m_comboBox;
public ComboBoxEditor(JComboBox[] box)
super(box[0]);
m_comboBox = box;
for(int i = 0; i < box.length; i++)
m_comboBox.setEditable(false);
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
if(row >= this.m_comboBox.length)
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
return m_comboBox[row];
But when I click a Button (in a Panel) which adds a Row (with No values for the ComboBox ).. to the Jtable .. The Row Gets added fine.. but the JComboBox comes with Values from the First Row's ComboBox. I Don't want any Values in the JComboBox for the new added Row. Can someone tell me
how do I remove the Items from the ComboBox.
I will really appreciate for any help...
Thanks
-PankajHi ,
as per my opinion one approach would be that ,
you create a custom table region same as standard one using Jdeveloper and create other required fields also using jeveloper ,and then put this region in extend property of existing standard table region .
thanks
Pratap -
Two billion record limit for non-partitioned HANA tables?
Is there a two billion record limit for non-partitioned HANA tables? I've seen discussion on SCN, but can't find any official SAP documentation.
Hi John,
Yes there is a limit for non-partitioned tables in HANA. In the first page of this document says: SAP HANA Database – Partitioning and Distribution of Large Tables
A non - partitioned table cannot store more than 2 billion rows. By using partitioning, this
limit may overcome by distributing the rows to several partitions. Please note, each partition must not contain more than 2 billion rows.
Cheers,
Sarhan. -
Can't use filter when accessing hana table through link from another table in sapui5
Hi all,
Have a strange one and I was wondering if someone had come across this before.
Hana table structure
entity SalesOrder {
key element name : String;
element contact : Association[0..*] to Contact via backlink order;
entity Contact {
element location: Location;
element order : Association to SalesOrder;
==
each sales order has a number of contacts.
In javascript, if I bind on list of contacts directly then I can use the filter
oRowRepeater.bindRows("/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);
and if I enter link i returns the number of entries
Contact/$count?$filter=location eq 'Germany'
But if I get contacts through the sales order it doesn't allow me to use the filter,
oRowRepeater.bindRows("/SalesOrder('mike')/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);
I can return the contacts same as accessing them directly and i can get the information such as
new sap.ui.commons.TextView({text: "{location}"}) same as before but only difference is that i can't filter.
When I try the following I get error
/SalesOrder('mike')/Contact/$count?$filter=location eq 'Germany'
Error
"message": {
"lang": "en-US",
"value": {
"type": "ODataInputError",
"message": "Bad Request URL: U"
When I open Chrome Developer Tools I see the following error
SalesOrder/contact/$count?$filter=location%20eq%20%27EMEA%27 400 (Bad Request)
Basically the $count doesn't work if you access contacts indirectly even though the link is there.
Is this a bug or am I doing something wrong?
Hana is sp8, I am up to date with almost everything.
Many thanks,
Matthewfor the reading/writing from oracle to access, you could do something like this:
for table in oracle/access with fields of id(number), name(varchar/text):
Connection oconn = //connect to Oracle
Connection aconn = //connect to access
//create the insert statement into access table
PreparedStatement apstmt = aconn.prepareStatement("INSERT INTO accesstable (id, name) values (?,?)");
//select all the results neeed from oracle table
Statement ostmt = oconn.createStatement();
ResultSet rs = ostmt.executeQuery("select id, name from oracletable where...");
while ( rs.next() )
apstmt.setLong(1, rs.getLong(1));
apstmt.setString(2, rs.getString(2));
apstmt.addBatch();
//if your driver doesn't support batching, just use this:
//apstmt.executeUpdate();
//use this only if you use batch statements
apstmt.executeBatch();
rs.close();
stmt.close();
apstmt.close();
oconn.close();
aconn.close(); -
How to Export/Import HANA table data.
Hello,
I try EXPORT HANA table.
I try to export a table by using the HANA Studio on the client PC.
but does not work.
the following steps:
HANA Studio
<table> > Export > Select tables for export > Next >
Error message : "Choose a location"
There is the question
Export possible? HANA database table by using client PC(HANA Studio).
Best regards,
HosoyaHi Hosoya,
Which version of the HANA server/studio you are using? I checked in Revision 24 and was able to do the table export as follows:
Quick Launch>Export>SAP HANA Studio>Tables>'Select the server'>'Select the table'>Export table options
In Export Table options screen we can specify either the Server Location as 'Export Tables on Server' or to the client location
as 'Export tables to current client'
Note: The server and studio I use are on different servers.
Regards, Rahul -
Adding a panel above table headers
I would like to add a panel with controls on it to a JTableHeader, so that it is a part of the table. The panel and its controls serve as a filter for the table. Adding it to the table would make vertical and horizontal scrollbars more natural, as the scroll bars would be added also if the panel is too long, and not only if the table and its headers are too long.
Thank you for your help.
Michala) Create your table.
b) Create a panel for your "header component".
c) Add your control component and the table header to this panel (the JTable API shows you how to get the TableHeader)
d) Create another panel.
e) add your header panel and the table to this panel
f) add this panel to the scrollpane. -
Query to get the last added record in a table for a particular id
T
Hi,
I have 2 tables A, B
Table A has id,name
Table B had parentid(foreignkey referring to ID in above table), record_type,created_timestamp
I want to get the last added record_type from Table B for all the ids present in Table A.Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. I know this is
a skeleton, but could you at least try to do good programming? Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums. And sample data also helps.
I have 2 tables: Alphas, Betas
CREATE TABLE Alphas
(alpha_id CHAR(10) NOT NULL PRIMARY KEY,
alpha_name VARCHAR(25) NOT NULL);
Why was that DDL so hard you could not write it? But your narrative about the second table does not tell us if it has a key. I will guess that it is also alpha_id, but thanks to your rudeness, that is all we can do.
CREATE TABLE Beta
(alpha_id CHAR(10) NOT NULL PRIMARY KEY
REFERENCES Alphas (alpha_id),
record_type CHAR(2) NOT NULL,
creation_timestamp DATETIME2(0) DEFAULT CURRENT_TIMESTAMP
NOT NULL,
>> I want to get the last added record_type from Table Beta for all the ids present in Table A.<<
Think about this. Since Beta.alpha_id is a FOREIGN KEY to Alphas, all of its rows will have a match to Alpha. The SQL engine does this for you!
SELECT *
FROM (SELECT alpha_id, record_type, creation_date,
MAX(creation_date) OVER () AS creation_date_max
FROM Betas)
WHERE creation_date = creation_date_max;
--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 -
Adding data in internal table using extracted data
Hi Experts,
Good day!
I have a requirements in our historical data of material price which adding data that are not existing based on data extracted from standard tables such as A004 and KONP.
Now, i need to use the VALIDFROM (DATAB) value as basis for the latest price.
To make it more clear, see the example below:
Extracted data:
Material Number Valid From Valid to Price
100101 01/01/2008 02/01/2008 100.00
100101 02/02/2008 04/02/2008 100.00
100101 04/03/2008 08/01/2008 200.00
100101 08/02/2008 01/31/2009 300.00
100102 05/02/2008 07/01/2008 10.00
100102 07/02/2008 10/31/2008 15.00
100102 11/01/2008 01/31/2009 20.00
Output:
Material Number Calmonth Price
100101 01/2008 100.00
100101 02/2008 100.00
100101 03/2008 100.00
100101 04/2008 200.00
100101 05/2008 200.00
100101 06/2008 200.00
100101 07/2008 200.00
100101 08/2008 300.00
100101 09/2008 300.00
100101 10/2008 300.00
100101 11/2008 300.00
100101 12/2008 300.00
100101 01/2009 300.00
100102 05/2008 10.00
100102 06/2008 10.00
100102 07/2008 15.00
100102 08/2008 15.00
100102 09/2008 15.00
100102 10/2008 15.00
100102 11/2008 20.00
100102 12/2008 20.00
100102 01/2009 20.00
Text that are in bold are the added data. What is the best code to do with this?
How can i come up with this output? Help me please
Thanks and Godbless,
nipsHi Nips,
Logic shud b sumthing on similar lines
lv_count = 1.
Loop at itab into watab.
if lv_count > 12.
lv_count = 1.
endif.
if watab-date+0(2) = lv_count.
append watab to gt_output.
continue.
else.
concatenate lv_count sy-datum+4(4) into watab-date.
append watab to gt_output.
endif.
endloop.
Best regards,
Prashant -
Newly added column in a table not displayed in a related form
I added a new column (DNAMECONT as varchar2) in a table I created a Form on. I added this new field in my Form as a text field, and on the customized tab of the form wizard, this following code is displayed as expected :
<TR><TD><#DCONTRACTOR.LABEL#></TD><TD><#DCONTRACTOR.ITEM#></TD></TR>
But I cannot view it once I run my form.
did I forget to do something or is there something I did wrong?
Thank you for your help.
BertrandSorry to interupt, as far as I understand, if you add extra column to a table after the form is built and you want to add this new column in your form. When you add new item in your form, the name you give to the item should exactly match the column name of your new column of the table. Now, you said you added a new column called DNAMECONT, but the
html shown in form wizard is <#DCONTRACTOR.LABEL#>, <#DCONTRACTOR.ITEM#>, two names do seem to match. Is that the problem?
null -
Reading the Data from dynamically added rows of a table...
Hi,
I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code). I have to fech these data into an internal table. But I can read only the first row data..
Also While adding rows dynamically the same data is repeating for the consecutive rows..
I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
1) How to solve repeatative data while adding rows..?
2) How to read dynamically added row data during runtime into internal table..?
Thanks,
Surya.Discussed @ SDN lot of time before. Have a look at any of below threads:-
Dynamic table in interactive form...
Make dynamic tables in Adobe Interactive forms
Adding Rows dynamically upon clicking the button
How to get values to WebDynpro ABAP from dynamic table?
Chintan
Maybe you are looking for
-
Im missing the weather icon on my iPad just like the one on the iPhone. What can I do pelease help?
-
i cannot connect my ipad with my itunes.... it seems my AppleMobileDeviceService is not functioning... in addition it has an Error Signature: szAppName : AppleMobileDeviceService.exe szAppVer : 17.66.0.47 szModName : kernel32.dll szModVer
-
Hi every body, I have string in following format String s= "root, new Object[]{Folder1,SubA,SubB},Folder2,new Object[]{Folder3,SubC,SubD}, new Object[]{Folder4, new Object[]{SubE,SubSubA}}";And I want to convert in following form Object[] hierarchy=
-
I am trying to decide if i should get the MBP or the MB
i am trying to decide if i should get the MBP or the MB
-
LOAD UNIT OF COMPONENT IS VERY LARGE (GENERATION LIMIT)
We are experiencing this meesage when compiling an ABAP WEB DYNPRO Application: "LOAD UNIT OF COMPONENT IS VERY LARGE (GENERATION LIMIT)" When Checking the Generation Limits In the Context menu, I have determined our size of Generated Load in bytes i