Found 4378 Articles for MySQL

How to insert a Python object in MySQL?

Rajendra Dharmkar
Updated on 28-Jan-2020 06:11:54

738 Views

Assuming that a MySQL database named 'test' is present on the server and a table named employee is also created. Let the table have five fields fname, lname, age, gender, and salary.Suppose we want to insert a tuple object containing data of a record defined as follows into the Msql database.t1=('Steven', 'Assange', 21, 'M', 2001)To establish an interface between MySQL and Python 3, you need to install the PyMySQL module. Then you can set up the connection using the following statementsimport PyMySQL # Open database connection db = PyMySQL.connect("localhost", "root", "", "test" ) # prepare a cursor object using cursor() ... Read More

How to store and retrieve a date into MySQL database using Python?

Rajendra Dharmkar
Updated on 28-Sep-2023 01:40:28

4K+ Views

To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. Once you have that, you'll need to convert your date in a string format before inserting it to your database. To do this, you can use the datetime module's strftime formatting function.Example from datetime import datetime now = datetime.now() id = 1 formatted_date = now.strftime('%Y-%m-%d %H:%M:%S') # Assuming you have a cursor named cursor you want to execute this query on: cursor.execute('insert into table(id, date_created) values(%s, %s)', (id, formatted_date))Running this will try to insert the tuple (id, date) ... Read More

How to convert Python date format to 10-digit date format for mysql?

Pranav Indukuri
Updated on 08-Sep-2022 06:59:26

1K+ Views

In this article, we will convert a python date format to 10-digit format for MySQL. We use the mktime() method from the time module provided by python. The mktime() method The python time method mktime() is the inverse function of the localtime(). The time.mktime() method of the Time module is used to convert a time.struct_time object or a tuple of 9 elements(which represents the time.struct_time object) to time in seconds since the epoch of the local system. Syntax The syntax of mktime() method is as follows. Time.mktime(t) Where, t is a time.struct_time object or a tuple containing 9 elements ... Read More

In SAP Business One SDK, filling a gridview and button saves in database

John SAP
Updated on 30-Jul-2019 22:30:20

310 Views

This can be achieved in multiple ways. You can either use a SAP DI documents, an open SQL or use data transfer workbench for this purpose.You can use a direct SQL write as this is one of straight way to do this. It is also possible to use SAP-DI Documents object to iterate over the Purchase Orders.One more option is using Data Transfer Workbench (DTW), where you export it to a file and then using DTW. It also provides error handling incase any exception occurs.

Getting memory error while doing UNION in SAP HANA

John SAP
Updated on 13-Dec-2019 06:45:39

208 Views

The SQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows.To use this UNION clause, each SELECT statement must haveThe same number of columns selectedThe same number of column expressionsThe same data type andHave them in the same orderWhile performing UNION you need to note that what data it will bring. To perform UNION ALL you need to ensure that views should be fully materialized.To know more about SAP HANA Modeling, you can refer SAP Guide:SAP HANA Guide

Getting error message: Scalar type not allowed in SAP HANA

karthikeya Boyini
Updated on 11-Dec-2019 08:57:53

484 Views

Few points about your code to create a Stored Procedure, that you can edit and tryPROCEDURE "SLT_DELETE"."HCDW.IT.IT::TO_TIMESTAMP_CALL" (IN IN_DATE DECIMAL(15),    OUT OUT_DATE TIMESTAMP)    LANGUAGE SQLSCRIPT AS    --DEFAULT SCHEMA    --READS SQL DATA AS BEGIN    select to_timestamp(IN_DATE) into OUT_DATE FROM DUMMY; END;In Line32, you have used below:SELECT: ORGID_ARTIKEL intoHowever correct syntax should be like:SELECT "ORGID_ARTIKEL" into

How to use SUM function for NUMC type field?

Johar Ali
Updated on 30-Jul-2019 22:30:20

487 Views

NUMC is numeric text. As this is text, SUM function cannot be implemented as it is of type varchar in the database.There is no simple solution to do it. The one method is to copy the data to internal tables, convert the NUMC data into DEC by looping through all the rows, SUM and GROUP them and then convert back the DEC values back to NUMC values.

Difference between an SAP ERP system and DBMS

Samual Sam
Updated on 25-Jun-2024 16:17:28

2K+ Views

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.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 can say that DBMS can be a subset of ERP.Read More

Using memory analyzer in SAP

Sai Subramanyam
Updated on 30-Jul-2019 22:30:20

204 Views

There are lots of free and proprietary tools to do the same. You can use Memory Analyzer project done by SAP. It lets you find memory leaks against in-memory objects via simple SQL statements. Also, you can use JHAT (Java Heap Analysis tool) command line tool to examine the memory. It lets you examine heap memory via histogram and can be of good help. Also, you can go for HeapWalker from Netbeans or Visual VM. Also, Eclipse has Eclipse memory analyzer which is a freeware and can handle good size with dump and provides a fair deal of memory analysis.Read More

Present date as default value in a table

Rahul Sharma
Updated on 25-Feb-2020 11:07:58

164 Views

Please try the below code. Note that you need to set the value before START-OF_SELECTIONselect-OPTIONS: so_date FOR sy-datlo. INITIALIZATION. so_date-sign = 'I'. so_date-option = 'EQ'. so_date-low = sy-datum. CLEAR so_date-high. APPEND so_date.You can also try this easy option −select-OPTIONS: so_date FOR sy-datlo default SY-DATUM.

Advertisements