ผู้เขียน หัวข้อ: code update patient_cid 2 person_cid error!!!!!  (อ่าน 2847 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ siemens

  • Jr. Member
  • **
  • กระทู้: 87
  • Respect: 0
    • ดูรายละเอียด
code update patient_cid 2 person_cid error!!!!!
« เมื่อ: มีนาคม 23, 2010, 09:23:17 AM »
0
รบกวนช่วยดู code ที่ผมแก้ไขจาก code อื่น(ที่ก้อบมาจากใน hosxp broad นี้เองครับ) exec แล้วข้อมูลไม่ยอม update

update person INNER JOIN person ON patient.fname = person.fname AND patient.lname = person.lname AND patient.sex = person.sex AND patient.birthday = person.birthdate
set person.cid=(select patient.cid from patient where patient.fname = person.fname AND patient.lname = person.lname ANDpatient.sex = person.sex AND patient.birthday = person.birthdate)
WHERE patient.cid IS NOT NULL AND person.cid IS NULL

ขอบคุณล่วงหน้าครับ................. ;D
อนุโรจน์  วิสุทธิ์เจริญพร

โรงพยาบาลบ้านค่าย อ.บ้านค่าย จ.ระยอง

OS : Hosxp version 3.52.7.3 --->3.53.11.29
Server : CentOS 5.3 + MySQL 5.1.37 percona Ram 10G
Slave   : CentOS 5.3 + MySQL 5.1.37 percona Ram   3G 

since 4 July 2009   by  BMS team

moderator of smart-mobile.com

"What the will wills it has already. For the will wills its will. Its will is what it has willed. The will wills itself." fROM M. Heideggers

ออฟไลน์ pop_hosxp

  • Hero Member
  • *****
  • กระทู้: 3,128
  • Respect: +38
    • ดูรายละเอียด
    • Phanomphrai Hospital
Re: code update patient_cid 2 person_cid error!!!!!
« ตอบกลับ #1 เมื่อ: มีนาคม 23, 2010, 09:26:38 AM »
0
update person INNER JOIN patient ON patient.fname = person.fname AND patient.lname = person.lname AND patient.sex = person.sex AND patient.birthday = person.birthdate
set person.cid=(select patient.cid from patient where patient.fname = person.fname AND patient.lname = person.lname ANDpatient.sex = person.sex AND patient.birthday = person.birthdate)
WHERE patient.cid IS NOT NULL AND person.cid IS NULL
pop434241@gmail.com
รพ.พนมไพร จ.ร้อยเอ็ด www.phanomphrai.net

ออฟไลน์ siemens

  • Jr. Member
  • **
  • กระทู้: 87
  • Respect: 0
    • ดูรายละเอียด
Re: code update patient_cid 2 person_cid error!!!!!
« ตอบกลับ #2 เมื่อ: มีนาคม 23, 2010, 11:29:34 AM »
0
ขอบคุณครับ...................... ;D ลองรันแล้วใน slave ข้อมูลยังไม่มา แต่ผมลองทานข้อมูลพื้นฐานจาก patient / person ของโรงพยาบาลผมมันมี error ตรงข้อมูลซ้ำซ้อนด้วยครับ คงต้องแก้ไขตรงนี้ก่อนครับ............ :(
อนุโรจน์  วิสุทธิ์เจริญพร

โรงพยาบาลบ้านค่าย อ.บ้านค่าย จ.ระยอง

OS : Hosxp version 3.52.7.3 --->3.53.11.29
Server : CentOS 5.3 + MySQL 5.1.37 percona Ram 10G
Slave   : CentOS 5.3 + MySQL 5.1.37 percona Ram   3G 

since 4 July 2009   by  BMS team

moderator of smart-mobile.com

"What the will wills it has already. For the will wills its will. Its will is what it has willed. The will wills itself." fROM M. Heideggers