This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
from mysql.connector import Error | |
from datetime import date, time, datetime ,timedelta | |
import time | |
import logging | |
import json | |
import sys | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fileinput import filename | |
import mysql.connector | |
from mysql.connector import Error | |
import json | |
from datetime import date, time, datetime | |
# created_at between '2011-03-17 06:42:10' and '2011-03-17 07:42:50'; | |
print("trying to connect to database") | |
url = "https://www.zohoapis.in/crm/v2/Leads" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
from mysql.connector import Error | |
from datetime import date, time, datetime ,timedelta | |
import time | |
fileName = '2015-01-07' | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
from mysql.connector import Error | |
from datetime import date, time, datetime ,timedelta | |
import time | |
''' | |
for generating payloads - data to be inserted in APIs - with timestamps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
import requests | |
import json | |
import pprint | |
global accessToken | |
url = "https://accounts.zoho.in/oauth/v2/token" | |
payload = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* leads charset fixation */ | |
ALTER TABLE leads CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; | |
/* create a view to write out table of requirement*/ | |
/* -------------------------------------------------- */ | |
CREATE VIEW `leadsJsonView_2` AS | |
select | |
concat( | |
'{', | |
'"', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE invoice_info CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; | |
/* errors - - - - address field not validated */ | |
set @json_ob_8 = ( | |
select REGEXP_REPLACE( | |
GROUP_CONCAT(json_object ( | |
'Name',CAST(id as CHAR), | |
'Address' ,Address, | |
'Email' ,Email , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
create a test db | |
use that db | |
to test and export sql dump | |
*/ | |
/* create a table clients */ | |
CREATE TABLE clients ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* example of clients table */ | |
/* without use of json_object */ | |
SELECT table2.* FROM ( SELECT 'Name', 'added_on', 'phone_no', 'local_id' , 'Email', 'clients_user_id' UNION ALL ( select company_name as Name,CONCAT(replace(DATE_FORMAT(added_on,'%Y-%m-%d %T'),' ','T'),"+05:30") as added_on,(select case when ifnull(phone_no,'') <> 0 then phone_no else '' end) as phone_no,id as local_id,email as Email,user_id as clients_user_id from clients ) ) table2; | |
set @json_file2 = ( | |
select group_concat(table1.data1, table1.data2 ) from | |
( | |
select concat('{"','clients_user_id','"',':','"',user_id,'",') as data1 ,concat('"','Name','"',':','"',company_name,'"}',char(10)) as data2 from clients |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.