Categories
Database Development

Update large number of row in MySQL table

I’m using relational database(MySQL 5.7). On this database i have a table called customer_transaction. On this table i have 4 columns: id, customer_id, type, amount |id|customer_id |type |amount| |–|————|———|——| |1 |44 |Credit |50 | |2 |44 |Credit |20 | |3 |44 |Debit |30 | |4 |10 |Credit |30 | now i am introduce a new […]

Categories
Mastering Development

add record nlog date get error invalid month

I use nlog dll to write to database – oracle with entity frameWork in the line : logger.Log(logLevel, “try”); I get in the logs of NLog the following error: Warn DatabaseTarget: Parameter: ‘TIME_STAMP’ – Failed to assign DbType=OracleDbType.Date Error DatabaseTarget(Name=WS_TRACE): Error when writing to database. Exception: System.Data.OracleClient.OracleException (0x80131938): ORA-01843: Invalid month the code is: SetPropGDC(LogEntity); […]

Categories
CMS Mastering Development Wordpress

Woocommerce API usage to create an order

hey guys i need help on creating an order via API. i use postman for the POST api. So I include all datas like total, status, customer_id, line itemes etc. But it dont accept what i filled it just send an order with empty product. this is my code: const data = { “id”: 1441, […]

Categories
CMS Magento Mastering Development

Magento 1.9 Recurring profile error

I’m trying to finalize a recurring purchase in magento and I’m getting this error below SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`loja`.`sales_recurring_profile`, CONSTRAINT `FK_SALES_RECURRING_PROFILE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE), query was: INSERT INTO `sales_recurring_profile` (`state`, `customer_id`, `store_id`, `method_code`, `created_at`, `updated_at`, `start_datetime`, […]

Categories
CMS Magento Mastering Development

Magento2 shipping is not created after Successfuly Payment Paypal

In our magento 2.3.3 after palced and paid order via Paypal. Order has status Complite. Invoice has status Paid automatically. But shipping is not created, error in log file: [2020-03-25 07:19:47] main.ERROR: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (tuerenmeile2.sales_shipment, CONSTRAINT SALES_SHIPMENT_ORDER_ID_SALES_ORDER_ENTITY_ID FOREIGN KEY (order_id) […]

Categories
Development

php- inserting record into a database

I am a bit confused with my following code to insert into my database using PHP. I used this code a few days ago and it was working fine and i tried it now and it was not working. This is the PHP code: <?php session_start(); require_once(‘dbconn.php’); $user = $_SESSION[‘who’]; if (!$_SESSION[‘who’]) { header(“location: login.php”); […]

Categories
Development

php- inserting record into a database

I am a bit confused with my following code to insert into my database using PHP. I used this code a few days ago and it was working fine and i tried it now and it was not working. This is the PHP code: <?php session_start(); require_once(‘dbconn.php’); $user = $_SESSION[‘who’]; if (!$_SESSION[‘who’]) { header(“location: login.php”); […]

Categories
Development

is there a way to return the kind of the type of an element?

dict(map(lambda x,y:(x,type(y)) ,new_row.keys(),new_row.values())) #this return {‘customer_name’: <class ‘str’>, ‘customer_id’: <class ‘str’>, ‘customer_age’: <class ‘int’>, #’customer_city’: <class ‘str’>, ‘phone_num’: <class ‘str’>} #but I need : {‘customer_name’: str, ‘customer_id’: str, ‘customer_age’: int, ‘customer_city’: str, ‘phone_num’: str}

Categories
Development

How to use interesting values with training window in feature tools?

Code: import pandas as pd import featuretools as ft import featuretools.variable_types as vtypes #Create item details table l = [[1, ‘1’, ‘2018-05-02’, ‘A’, 2.0, 10], [1, ‘1’, ‘2018-05-02’, ‘A’, 1.0, 10], [2, ‘1’, ‘2018-05-28’, ‘B’, 1.0, 40], [3, ‘1’, ‘2018-06-13’, ‘A’, 2.0, 30], [4, ‘1’, ‘2019-08-20’, ‘C’, 3.0, 60]] item_detail = pd.DataFrame(l) item_detail.columns = [‘Ticket_id’,’Customer_id’,’trans_date’,’SKU’,’Qty’,’Amount’] […]

Categories
Development

How to get Name of an item corresponding to Min and Max value in a grouped set into different columns

Table 1: ORDERS (ORDER_ID, CUSTOMER_ID, ITEM_ID, QUANTITY) Table 2: CUSTOMERS (CUSTOMER_ID, CUSTOMER_NAME, ZIPCODE) Table 3: ITEMS (ITEM_ID, ITEM_NAME) Required Output: OUTPUT (ZIPCODE, MAX_ORDERED_ITEM_NAME, MIN_ORDERED_ITEM_NAME I’ve tried various approaches to get the output, but haven’t been able to get to the end result Current query: SELECT ZIPCODE, ITEM_NAME, SUM(QUANTITY) AS SALES FROM ORDERS JOIN CUSTOMERS ON […]