Ramu Prasad has Published 74 Articles

How can we use MySQL function STR_TO_DATE(Column, ‘%input_format’)?

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 05:59:04

224 Views

STR_TO_DATE() function will convert a string value into datetime value and it would be according to a specific format string. Both string value and format string must be passed as arguments to the function. Following is the syntax of STR_TO_DATE() function.STR_TO_DATE(string, format)Here string is the value of string which needs ... Read More

What MySQL returns if we include time components along with date component as an argument to DATEDIFF() function?

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 05:17:21

64 Views

MySQL DATEDIFF() function also works with date and time values but it ignores the time value. Hence even if we include the time value in DATEDIFF() function MySQL will return the difference, in days, between dates by ignoring the time values.mysql> Select DATEDIFF('2018-10-22 04:05:36', '2017-10-22 03:05:45'); +-------------------------------------------------------+ | DATEDIFF('2018-10-22 04:05:36', ... Read More

How to get last day of the next month in MySQL?

Ramu Prasad

Ramu Prasad

Updated on 29-Jan-2020 05:11:19

216 Views

With the help of following MySQL query, we can get the last day of next month −mysql> SELECT LAST_DAY(now() + INTERVAL 1 MONTH) AS 'LAST DAY OF NEXT MONTH'; +------------------------+ | LAST DAY OF NEXT MONTH | +------------------------+ | 2017-11-30             | +------------------------+ 1 row in set (0.00 sec)

What is the usage of ZEROFILL for INT datatype?

Ramu Prasad

Ramu Prasad

Updated on 28-Jan-2020 07:18:28

129 Views

On specifying ZEROFILL for a numeric column, MYSQL automatically pads the displayed value of the field with zeros up to the display width specified in the column definition.For example, we create a table showzerofill and insert the values as follows −mysql> Create Table showzerofill(Val1 INT(5) ZEROFILL, Val2 INT(5)); Query OK, ... Read More

Importing data from Pgsql to SAP HANA database

Ramu Prasad

Ramu Prasad

Updated on 28-Jan-2020 05:24:36

269 Views

Import and Export using a flat file is the easiest option. You can use CSV file if it is a onetime activity. However, If you think it is a repetitive activity then I would suggest you use HANA ETL options like HANA SLT replication, Smart Data access, etc.SAP HANA Replication ... Read More

List of Common Reasons for Segmentation Faults in C/C++

Ramu Prasad

Ramu Prasad

Updated on 27-Jan-2020 12:38:34

4K+ Views

The main reason for segmentation fault is accessing memory that is either not initialized, out of bounds for your program or trying to modify string literals. These may cause a segmentation fault though it is not guaranteed that they will cause a segmentation fault. Here are some of the common ... Read More

How to create a zero-filled JavaScript array?

Ramu Prasad

Ramu Prasad

Updated on 13-Jan-2020 10:28:00

60 Views

To create a zero-filled JavaScript array, use the Unit8Array typed array.ExampleYou can try to run the following code:Live Demo                    var arr1 = ["marketing", "technical", "finance", "sales"];          var arr2 = new Uint8Array(4);          document.write(arr1);          document.write("Zero filled array: "+arr2);          

How to concatenate several strings in JavaScript?

Ramu Prasad

Ramu Prasad

Updated on 09-Jan-2020 07:13:47

163 Views

To concatenate several string, use “Array.join()” method. Here, we will concat the following strings:John Amit SachinExampleYou can try to run the following code to concat several stringsLive Demo                    var arr = ['Amit', 'John', 'Sachin'];          document.write(arr.join(', '));            

Using clients in SAP ERP

Ramu Prasad

Ramu Prasad

Updated on 16-Dec-2019 09:58:35

363 Views

Several independent companies or subsets of one company can be present in one SAP system. The client separates these companies and their relevant data. Client serves as a key to most of the SAP database tables and used customizing, transactional and master data. To summarise client serves as unique database key for ... Read More

Formatting date in SAP system

Ramu Prasad

Ramu Prasad

Updated on 16-Dec-2019 07:34:34

95 Views

You will need to apply new culture to the existing thread as shown below:ExampleDateTime now = DateTime.Now; Console.WriteLine(now); CultureInfo sapCulture = new CultureInfo("en-US", true); sapCulture.DateTimeFormat.ShortDatePattern = "ddMMyyyy"; //sapCulture.DateTimeFormat.FullDateTimePattern =    sapCulture.DateTimeFormat.ShortDatePattern + " HH-mm-ss"; sapCulture.DateTimeFormat.LongTimePattern = "HH-mm-ss"; //sapCulture.DateTimeFormat.ShortTimePattern = "HH-mm-ss"; System.Threading.Thread.CurrentThread.CurrentCulture = sapCulture; //System.Threading.Thread.CurrentThread.CurrentUICulture = sapCulture; Console.WriteLine(now);Read More

Advertisements