Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
MySQL Articles
Found 3,543 articles
Date value is not populating while using Native SQL in SAP to insert an Order
When inserting date values using Native SQL in SAP ABAP, you may encounter issues with date population. The primary issue is often related to variable binding syntax in the SQL statement. Solution You need to put a colon (:) before the variable to properly bind it in Native SQL. Here's the corrected syntax − EXEC SQL. INSERT INTO order VALUES('2', :sy-datum) ENDEXEC. The colon (:) is essential for host variable binding in Native SQL. Without it, the system treats sy-datum as a literal string rather than a variable reference. Alternative ...
Read MoreAdding a condition using SQL or an ABAP program and difference in performance
When adding conditions to filter data, you can choose between implementing the logic in SQL or in an ABAP program. For small datasets like 500 records, there would not be much difference in performance between both options. You can use either of them based on your specific requirements. SQL Approach Using SQL WHERE clause directly in the database query is generally more efficient as it filters data at the database level − SELECT * FROM table_name INTO TABLE lt_table WHERE exp > 5. ABAP Program Approach Alternatively, you can ...
Read MoreChanging Data Element of a column and showing description in Transaction SE16N
When working with transaction SE16N in SAP, you may need to change the data element of a column to display proper descriptions. This process involves updating the Data Dictionary (DDIC) element and ensuring the system recognizes the changes. Methods to Update Data Element Descriptions Method 1: Activate the Change The primary approach is to activate the change after modifying the data element. This ensures the system properly updates the column description in SE16N. Method 2: Force System Recognition An alternative method involves temporarily creating an error to force the system to refresh the element description ...
Read MoreHow to display 3 random values from MySQL table?
To display random values from a MySQL table, use the RAND() function in the ORDER BY clause to shuffle the rows randomly, and LIMIT to restrict the number of results. The general syntax is − SELECT yourColumnName FROM yourTableName ORDER BY RAND() LIMIT 3; Creating the Demo Table Let us first create a table and insert some records − CREATE TABLE DemoTable646 ( Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName VARCHAR(100) ); INSERT INTO DemoTable646 (FirstName) VALUES ('John'); INSERT INTO DemoTable646 (FirstName) VALUES ('Bob'); INSERT INTO DemoTable646 (FirstName) VALUES ...
Read MoreSearching multiple columns for a row match in MySQL
To search multiple columns for a row match in MySQL, you can use the UNION operator. UNION combines the result sets of two or more SELECT statements into a single result, automatically removing duplicate rows. This is useful when you want to search different columns for different criteria and merge the results together. Creating the Demo Table Let us first create a table and insert some records − CREATE TABLE DemoTable645 ( Id INT, FirstName VARCHAR(100) ); INSERT INTO DemoTable645 VALUES (100, 'Chris'); INSERT INTO DemoTable645 VALUES (101, 'Robert'); INSERT INTO DemoTable645 ...
Read MoreDifference between an SAP ERP system and DBMS
What is DBMS? DBMS or Database Management system is basically the tool/interface required to manage the database. For example, SQL server or a tool like MYSQL workbench is a DBMS. A DBMS is mainly used by or designed for technical people. What is ERP ERP (Enterprise Resource Planning System) is a complete system with one database and number of function modules and has a number of inputs and output interfaces to be used by everyone. For example, there can be a user interface for customer or business people, another for technical people with various skills. So basically we ...
Read MoreConvert timestamp coming from SQL database to String PHP?
To convert timestamp to string, use setTimestamp(). Let’s say the following is our input i.e. timestamp −$SQLTimestamp = 1600320600000;We want the following output i.e. Date string −2020-09-17 05:30:00At first, get seconds from Timestamp −$seconds = round($SQLTimestamp/1000, 0);Example Output2020-09-17 05:30:00
Read MoreHow to convert JS date time to MySQL datetime?
We can convert JS date time to MySQL datetime with the help of toISOString() function.Let us see an example of JavaScript.Example Web Page Design document.writeln(new Date().toISOString().slice(0, 19).replace('T', ' ')); Current Date is displayed above... OutputThe following is the output.2018-11-23 11:14:38 Current Date is displayed above...
Read MoreHow to convert Python date format to 10-digit date format for mysql?
While working with databases like MySQL, it’s necessary to store dates in a numeric format, especially for timestamps. MySQL commonly uses Unix timestamps, which are 10-digit numbers representing the number of seconds since January 1, 1970 (known as the epoch). The following are the different methods from the time and datetime modules to convert Python date formats into a 10-digit format (Unix timestamp) suitable for use with MySQL. Using mktime() Method Using strptime() + mktime() Combination Using timestamp() Method Using mktime() Method The mktime() method from ...
Read MoreCount the number of columns in a MySQL table with Java
In this article, we will learn how to count the number of columns in a MySQL table using JDBC. We will be using the ResultSetMetaData to get details of the table by using simple examples. What is ResultSetMetaData? The ResultSetMetaData is an interface that is present in the java.sql package. Using ResultSetMetaData, we can get information about the table, for example, what are the column names of each and every table, and how many columns are there?. To create the object for ResultSet: ResultSet rs=st.executeQuery("Select * from Student"); The executeQuery method writes the records, which are then stored in the ...
Read More