Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Mencantumkan kode program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

[ask] error collation

mohon bantuanx dong kakak, ada error nih di delphi saya saat nge-klik radiobutton.

image
Erornya seperti pada gambar

terima kasih sebelumnya....

Tanggapan

  • anda mencoba melakukan query antara 2 tabel dengan Collation yang berbeda.
  • edited May 2013
    iya mas, saya malah baru tau kalo collationx berbeda antara 2 table tsb......

    ok mas dah q samakan collation di dua table tersebut,, sbenernya masalahnya itu ada posting saya sbelumnya... pada alamat ini:

    untuk query mysql pada posting diatas sudah terpecahkan, tpi kbingungan untuk manggil kode_training yang dpilih oleh user....

    berikut koding saya::
     
    [code]
    procedure TForm7.DBGrid1CellClick(Column: TColumn);
    begin
      if CheckBox1.checked then
        Q2.Close;
        Q2.SQL.Clear;
        Q2.SQL.text:='CALL proc_no_zero('+Q1.fieldbyname('KodeTraining').AsString+')';
        Q2.Open;
    end;
    [/code]

    karena saya panggil query-nya dengan :
      Q2.SQL.text:='CALL proc_no_zero('+Q1.fieldbyname('KodeTraining').AsString+')';

    ternyata, untuk manggil kode_training dengan query diatas masih error....

    jika saya manggil query-nya lewat MySQL, jadi begini query-nya:
    CALL proc_no_zero("30-03-01")
    data muncul dan lancar.......

    ada solusi mas....?
  • isi proc_no_zero nya apa ?
    error message nya apa ?
  • procedure proc_no_zero :::
    [code]
    DROP PROCEDURE IF EXISTS `proc_no_zero`;
    DELIMITER //
    CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_no_zero`(IN `kode` VARCHAR(50))
    BEGIN
    SET @sql =
    CONCAT(
     "SELECT NoPeserta,Nama,Kode_training,",
     (SELECT CONCAT_WS(',',
      IF(c0>0,'n1',NULL), IF(c1>0,'n2',NULL), IF(c2>0,'n3',NULL), IF(c3>0,'n4',NULL),
    IF(c4>0,'n5',NULL), IF(c5>0,'n6',NULL), IF(c6>0,'n7',NULL), IF(c7>0,'n8',NULL),
    IF(c8>0,'n9',NULL), IF(c9>0,'n10',NULL), IF(c10>0,'n11',NULL), IF(c11>0,'n12',NULL),
    IF(c12>0,'n13',NULL), IF(c13>0,'n14',NULL), IF(c14>0,'n15',NULL), IF(c15>0,'n16',NULL),
    IF(c16>0,'n17',NULL), IF(c17>0,'n18',NULL), IF(c18>0,'n19',NULL), IF(c19>0,'n20',NULL),
    IF(c20>0,'n21',NULL), IF(c21>0,'n22',NULL), IF(c22>0,'n23',NULL))

      FROM ( SELECT
      SUM(IF(IFNULL(n1,0)=0,0,1)) AS c0, SUM(IF(IFNULL(n2,0)=0,0,1)) AS c1,
      SUM(IF(IFNULL(n3,0)=0,0,1)) AS c2, SUM(IF(IFNULL(n4,0)=0,0,1)) AS c3,
    SUM(IF(IFNULL(n5,0)=0,0,1)) AS c4, SUM(IF(IFNULL(n6,0)=0,0,1)) AS c5,
    SUM(IF(IFNULL(n7,0)=0,0,1)) AS c6, SUM(IF(IFNULL(n8,0)=0,0,1)) AS c7,
    SUM(IF(IFNULL(n9,0)=0,0,1)) AS c8, SUM(IF(IFNULL(n10,0)=0,0,1)) AS c9,
    SUM(IF(IFNULL(n11,0)=0,0,1)) AS c10, SUM(IF(IFNULL(n12,0)=0,0,1)) AS c11,
    SUM(IF(IFNULL(n13,0)=0,0,1)) AS c12, SUM(IF(IFNULL(n14,0)=0,0,1)) AS c13,
    SUM(IF(IFNULL(n14,0)=0,0,1)) AS c14, SUM(IF(IFNULL(n15,0)=0,0,1)) AS c15,
    SUM(IF(IFNULL(n15,0)=0,0,1)) AS c16, SUM(IF(IFNULL(n16,0)=0,0,1)) AS c17,
    SUM(IF(IFNULL(n17,0)=0,0,1)) AS c18, SUM(IF(IFNULL(n18,0)=0,0,1)) AS c19,
    SUM(IF(IFNULL(n19,0)=0,0,1)) AS c20, SUM(IF(IFNULL(n20,0)=0,0,1)) AS c21,
    SUM(IF(IFNULL(n21,0)=0,0,1)) AS c22, SUM(IF(IFNULL(n22,0)=0,0,1)) AS c23
     
              FROM 2011_nilai WHERE Kode_training=kode
           ) bebaslah), " FROM 2011_nilai WHERE Kode_training='",kode,"'"
    );
    PREPARE stmt FROM @sql;
      EXECUTE stmt;
      DROP PREPARE stmt;
    END//
    DELIMITER ;
    [/code]



    ini collation saya kok eror lagi mas yaa..? padahal udah aku cek semua untuk tiap table n kolom dalam database-x agar collationnya menjadi latin1_swedish_ci, tapi erorsnya kok masih error seperti diatas...

Sign In or Register to comment.