Govinda Sai

Govinda Sai

45 Articles Published

Articles by Govinda Sai

Page 4 of 5

How to remove a specific element from a JSON Array in Java?

Govinda Sai
Govinda Sai
Updated on 19-Feb-2020 15K+ Views

You can remove an element from the JSONArray object using the remove() method. This method accepts an integer and removes the element in that particular index.Exampleimport org.json.JSONArray; public class RemoveFromJsonArray { public static void main(String args[]) throws Exception { String [] myArray = {"JavaFX", "HBase", "JOGL", "WebGL"}; JSONArray jsArray = new JSONArray(); for (int i=0; i < myArray.length; i++) { jsArray.put(myArray[i]); } System.out.println(jsArray); jsArray.remove(3); System.out.println("After deleting ::"+jsArray); } }Output["JavaFX","HBase","JOGL","WebGL"] After deleting ::["JavaFX","HBase","JOGL"]

Read More

How to read a 2d array from a file in java?

Govinda Sai
Govinda Sai
Updated on 19-Feb-2020 11K+ Views

A 2d array is an array of one dimensional arrays to read the contents of a file to a 2d array –Instantiate Scanner or other relevant class to read data from a file. Create an array to store the contents.To copy contents, you need two loops one nested within the other. the outer loop is to traverse through the array of one dimensional arrays and, the inner loop is to traverse through the elements of a particular one dimensional array.Create an outer loop starting from 0 up to the length of the array. Within this loop read each line trim and ...

Read More

Using method getBPLIST() to get list of all orders in SAP Business One

Govinda Sai
Govinda Sai
Updated on 14-Feb-2020 572 Views

I would suggest using recordset with DI API −SAPbobsCOM.Recordset rs = ((SAPbobsCOM.Company)oCompany.GetDICompany()).GetBusinessObject(BoObjectTypes.BoRecordset); rs.DoQuery("SELECT DocEntry, DocNum, DocDate, TaxDate, CardCode, CardName, DocTotal FROM OPOR ORDER BY DocDate ASC"); while (!rs.EoF) { int DocEntry = rs.Fields.Item("DocEntry").Value; //OR DocEntry = rs.Fields.Item(0).Value; rs.MoveNext(); }

Read More

Compound Assignment Operators in C++

Govinda Sai
Govinda Sai
Updated on 11-Feb-2020 4K+ Views

The compound assignment operators are specified in the form e1 op= e2, where e1 is a modifiable l-value not of const type and e2 is one of the following −An arithmetic typeA pointer, if op is + or –The e1 op= e2 form behaves as e1 = e1 op e2, but e1 is evaluated only once.The following are the compound assignment operators in C++ −OperatorsDescription*=Multiply the value of the first operand by the value of the second operand; store the result in the object specified by the first operand./=Divide the value of the first operand by the value of the ...

Read More

How can we upload the changed value, rather than written in a text file, of column(s) while importing that text file into MySQL table?

Govinda Sai
Govinda Sai
Updated on 06-Feb-2020 162 Views

Suppose if we want to upload the changed value rather than the value written in a text file then we need to use user variables along with the SET command. It can be understood with the help of the following example −ExampleSuppose we are having the following data in ‘A.txt’ −105, Chum, USA, 11000 106, Danny, AUS, 12000But we want to upload the value of salary after adding 500 to it at the time of importing it without changing the value of salary in a text file then it can be done with the help of the following query by ...

Read More

How can we create a MySQL function to find out the duration of years, months, days, hours, minutes and seconds?

Govinda Sai
Govinda Sai
Updated on 30-Jan-2020 413 Views

Following is a MySQL function which calculates the duration in years, months, days, hours, minutes and seconds between two dates.mysql> DROP FUNCTION IF EXISTS Duration; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> DROP FUNCTION IF EXISTS Label123; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> DELIMITER // mysql> CREATE FUNCTION Duration( dtd1 datetime, dtd2 datetime ) RETURNS CHAR(128)    -> BEGIN    -> DECLARE yyr, mon, mmth, dy, ddy, hhr, m1, ssc, t1 BIGINT;    -> DECLARE dtmp DATETIME;    -> DECLARE t0 TIMESTAMP;    -> SET yyr = TIMESTAMPDIFF(YEAR, dtd1, dtd2);   ...

Read More

How can I use 2-digit year value in MySQL DATEDIFF() function?

Govinda Sai
Govinda Sai
Updated on 30-Jan-2020 320 Views

We can use 2-digit year value either in single date expression or in both date expressions used as argument/s in MySQL DATEDIFF() function.For example, the query below is using 2-digit year value in first date expression and other is having 4-digit year value.mysql> Select DATEDIFF('18-10-22', '2017-10-22'); +-----------------------------------+ | DATEDIFF('18-10-22', '2017-10-22') | +-----------------------------------+ |                               365 | +-----------------------------------+ 1 row in set (0.00 sec)And the query below is using 2-digit year value in both date expressions.mysql> Select DATEDIFF('18-10-22', '17-10-22'); +---------------------------------+ | DATEDIFF('18-10-22', '17-10-22') | +---------------------------------+ |   ...

Read More

In which format Year(2) or Year(4) MySQL will return the value of year from date '0000-00-00'?

Govinda Sai
Govinda Sai
Updated on 29-Jan-2020 208 Views

Suppose if we have stored a date value as ‘0000-00-00’ in MySQL table then on extracting year value from such kind of date, MySQL will return 0. It would not be in either Year(2) or Year(4) format. To understand it we are using the following data from ‘detail_bday’ table −mysql> Select * from detail_bday; +----+---------+------------+ | Sr | Name    | Birth_Date | +----+---------+------------+ | 1 | Saurabh  | 1990-05-12 | | 2 | Raman    | 1993-06-11 | | 3 | Gaurav   | 1984-01-17 | | 4 | Rahul    | 1993-06-11 | | 5 | Sonia   ...

Read More

Transporting SAP standard text

SAP
Govinda Sai
Govinda Sai
Updated on 16-Dec-2019 10K+ Views

STEP 1: Create Standard Text. To create standard text, you have to use T-Code SO10.In next window, pass the Text Name -> Click on CREATE Push Button. This will open a new window where you can save the TEXT.Next step is to create the TRANSPORT REQUEST to transport the TEXT. This can be done using T-Code: SE09. Go to Home screen and run T-Code SE09.To create Transport request, you have to click on CREATE button at the top. This will open Transport Organizer as below:This will open Create Request window. Enter the Short Description, Project and click on Save button as ...

Read More

Taking backup of schema in SAP HANA

Govinda Sai
Govinda Sai
Updated on 16-Dec-2019 489 Views

It is always recommended to back up your critical systems.ExampleFollowing SQL command can be used to export schema in HANA:EXPORT "SOURCE_SCHEMA_NAME".* AS BINARY INTO '/tmp/DESTINATION SCHEMA NAME' WITH    REPLACE;This can also be directly zipped to Linux as below:tar -czf SOURCE_SCHEMA.tgz /tmp/DESTINATION_SCHEMA/

Read More
Showing 31–40 of 45 articles
Advertisements