DELIMITER $$
USE `g4winners2`$$
DROP PROCEDURE IF EXISTS `ebetToTbConsumer`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ebetToTbConsumer`()
BEGIN
START TRANSACTION;
INSERT INTO g4winners2.`tb_consumer`(first_name,middle_name,last_name,username,PASSWORD ,ssn,email,home_phone
,date_of_birth,gender_type,is_locked,is_active,is_online,bonus_level_id,modified_by_entity,modified_by_id,record_created_on,record_modified_on
,consumer_status_type
,business_id,driver_license,driver_license_state_provice,mothers_maiden_name,id_type,intl_id_state_code,id_expiration,id_status,COMMENT,reward_profile_id
,player_tracking_id
)
SELECT cont.first_name, cont.middle_initial, cont.last_name,cust.user_name, cust.encrypted_password, cust.social_security_number, cont.email,cont.home_phone,cust.birthdate,
cust.sex,
b'0',b'1',b'0',1,'3',1, FROM_UNIXTIME(cust.signup_date), FROM_UNIXTIME(cust.updated_date) ,cust.status,cust.business_id,cust.drivers_license,cust.drivers_license_state_province,cust.mothers_maiden_name,cust.id_type,cust.intl_id_state_code,
cust.id_expiration,cust.id_status,cust.comment,cust.reward_profile_id,cust.player_tracking_id
FROM ebet.`contact_info` cont ,ebet.`customer` cust WHERE cust.id=cont.customer_id ;
INSERT INTO `g4winners2`.`tb_consumer_address`(consumer_id,address_line_1,address_line_2
,city,state,zip_code,country,county,region,record_modified_on,mailing_list_flag,
funding_notification_flag,title,marketing1,partner_list_flag,company_name)
SELECT cont.customer_id, cont.address1,cont.address2,cont.city,cont.state_province,cont.postal_code,cont.country,cont.county,cont.suburb ,cont.updated_date, cont.mailing_list_flag,
cont.funding_notification_flag,cont.title,cont.marketing1,cont.partner_list_flag,cont.company_name FROM ebet.`contact_info` cont;
INSERT INTO g4winners2.tb_consumer_funds(tote_account_id,pin,total_available_fund,onhold_fund,tote_account_status,last_access)
SELECT acc.acct_number,acc.encrypted_pin, FLOOR(acc.current_balance),FLOOR(acc.hold_balance), acc.status,acc.last_access
FROM ebet.`account` acc;
INSERT INTO g4winners2.`tb_system_settings`(setting_id,setting_name,setting_value,business_id)
SELECT 0,conf.name,conf.value,conf.business_id FROM ebet.`config1` conf;
COMMIT;
END$$
DELIMITER ;
답변
프로 시저를 만든 후에 실행해야합니다.
CALL ebetToTbConsumer();
을 사용하여 실행 해 보셨습니까?
테이블 g4winners2.tb_consumer
에는 예약어로 이름이 지정된 필드가 있습니다. PASSWORD
및 COMMENT
반드시은 테이블에서 사용하거나 완전히 피할 때 이스케이프 처리해야합니다.
g4winners2.tb_system_settings.setting_id
필드의 경우에도 일부 제약 조건 오류가 발생하지 않으면 삽입 된 값 0
을 입력해야합니다. MySQL 오류 로그를보고 오류의 실제 상황을 확인하는 것이 좋습니다.
아무런 결과조차도 내가 모든 도움을 필요로했다. 나는 mysql5.x를 사용하고있다. –
편집 된 답변 확인. – Peter
서버 변수 autocommit
을 OFF
으로 설정해야합니다. 서버 설정 파일에 추가하거나 명시 적으로 다음과 같이 프로 시저에서 설정할 수 있습니다 :
DELIMITER $$
USE `g4winners2`$$
DROP PROCEDURE IF EXISTS `ebetToTbConsumer`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ebetToTbConsumer`()
BEGIN
SET autocommit=0; /******************Check this line******************/
START TRANSACTION;
INSERT INTO g4winners2.`tb_consumer`(first_name,middle_name,last_name,username,PASSWORD ,ssn,email,home_phone
,date_of_birth,gender_type,is_locked,is_active,is_online,bonus_level_id,modified_by_entity,modified_by_id,record_created_on,record_modified_on
,consumer_status_type
,business_id,driver_license,driver_license_state_provice,mothers_maiden_name,id_type,intl_id_state_code,id_expiration,id_status,COMMENT,reward_profile_id
,player_tracking_id
)
SELECT cont.first_name, cont.middle_initial, cont.last_name,cust.user_name, cust.encrypted_password, cust.social_security_number, cont.email,cont.home_phone,cust.birthdate,
cust.sex,
b'0',b'1',b'0',1,'3',1, FROM_UNIXTIME(cust.signup_date), FROM_UNIXTIME(cust.updated_date) ,cust.status,cust.business_id,cust.drivers_license,cust.drivers_license_state_province,cust.mothers_maiden_name,cust.id_type,cust.intl_id_state_code,
cust.id_expiration,cust.id_status,cust.comment,cust.reward_profile_id,cust.player_tracking_id
FROM ebet.`contact_info` cont ,ebet.`customer` cust WHERE cust.id=cont.customer_id ;
INSERT INTO `g4winners2`.`tb_consumer_address`(consumer_id,address_line_1,address_line_2
,city,state,zip_code,country,county,region,record_modified_on,mailing_list_flag,
funding_notification_flag,title,marketing1,partner_list_flag,company_name)
SELECT cont.customer_id, cont.address1,cont.address2,cont.city,cont.state_province,cont.postal_code,cont.country,cont.county,cont.suburb ,cont.updated_date, cont.mailing_list_flag,
cont.funding_notification_flag,cont.title,cont.marketing1,cont.partner_list_flag,cont.company_name FROM ebet.`contact_info` cont;
INSERT INTO g4winners2.tb_consumer_funds(tote_account_id,pin,total_available_fund,onhold_fund,tote_account_status,last_access)
SELECT acc.acct_number,acc.encrypted_pin, FLOOR(acc.current_balance),FLOOR(acc.hold_balance), acc.status,acc.last_access
FROM ebet.`account` acc;
INSERT INTO g4winners2.`tb_system_settings`(setting_id,setting_name,setting_value,business_id)
SELECT 0,conf.name,conf.value,conf.business_id FROM ebet.`config1` conf;
COMMIT;
END$$
DELIMITER ;
아무 결과조차도 내가 모든 도움을 필요로했다. 나는 mysql5.x를 사용하고있다. –
- 1. Codeigniter 라우팅이 다음 절차에서 작동하지 않습니다.
- 2. 아래의 함수가 원하는대로 작동하지 않습니다.
- 3. MySQL은 트랜잭션을 롤백하지 않습니다.
- 4. SET XACT_ABORT ON이 작성 절차에서 작동하지 않음
- 5. MySQL은 트랜잭션을 지원하지 않습니다?
- 6. Django transaction.commit_on_success가 트랜잭션을 롤백하지 않습니다.
- 7. 절차에서 테이블 만들기
- 8. 절차에서 참조로 해시 채우기
- 9. 위의 절차에서 mssql2005
- 10. 오라클 절차에서 명세서 선택
- 11. 절차에서 동일한 winform 재사용
- 12. 목록의 목록? 내 주요 절차에서
- 13. finishTransaction : 대기열에서 트랜잭션을 제거하지 않습니다 ...
- 14. Spring - @Transactional이 트랜잭션을 시작하지 않습니다.
- 15. Bitcoin sendfrom 트랜잭션을 처리하지 않습니다.
- 16. Devits URL 도우미가 암호 재설정 절차에서 생성되지 않습니다.
- 17. 아래의 hashTable 프로그램이 작동하지 않습니까?
- 18. 전체 행에 굵게를 적용하려고하지만 null 참조가 계속 유지되는 중 - NPOI
- 19. 디렉토리 아래의 여러 파일을 지정하기위한 대괄호가 Makefile에서 작동하지 않습니다.
- 20. StackTrace 클래스 메서드가 릴리스 모드에서 작동하지 않습니다. 아래의
- 21. 버튼과 버튼 아래의 TinyMCE 드롭 다운 화살표가 올바르게 작동하지 않습니다.
- 22. 지역지도가 온 클릭 나는 그것이 작동하지 않습니다 아래의 코드를
- 23. 저장 프로 시저가 트랜잭션을 생성하지 않습니다
- 24. 절차에서 일부 구문 오류가 발생했습니다.
- 25. 삽입 절차에서 dblink를 사용하여 삽입
- 26. 동일한 절차에서 삭제 및 삽입
- 27. 후 내 공기 절차에서 프레임
- 28. 절차에서 OOP 날짜 형식 기능까지
- 29. 내 절차에서 데이터 그리드 프로그램
- 30. 이 절차에서 잘못된 점은 무엇입니까?
자세한 정보를 입력하십시오. 작동하지 않는 부분과 시도한 부분은 무엇입니까? – Marthijn