Author Topic: store proc insert pd my sql  (Read 1477 times)

0 Members and 1 Guest are viewing this topic.

Offline superfox

  • Newbie
  • *
  • Posts: 24
store proc insert pd my sql
« on: April 13, 2009, 07:48:14 PM »
Salam Foxer....
saya mau tanya soal storeprocedure pd my sql

sy buat sp tp ga tau cara jalanin nya  >:(
dan apakah sp saya ini sudah benar
sy pny tabel tbl_brg
dg field kd_brg varchar (10)
           nm_brg varchar (20)

CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_insert_brg`()
BEGIN
declare xkd varchar(10);
declare xnm varchar(20);
insert into tbl_brg(kd_brg,nm_brg) values (xkd,xnm);
END


nah cara execute sy ky gini
aa='001'
bb='topi'
SQLEXEC(XKON2,"call sp_insert_brg ?aa,?bb")

setelah sy execute data tdk masuk  knp ya? :sad2:


tengkyu....

Offline poison

  • Hero Member
  • *
  • Posts: 1.632
  • Poison 4 Women
Re: store proc insert pd my sql
« Reply #1 on: April 13, 2009, 09:55:34 PM »
SQLEXEC(XKON2,"call sp_insert_brg ?aa,?bb")
coba ganti dengan ni :
Quote
SQLEXEC(XKON2,"call sp_insert_brg (?aa,?bb)")


***
moga membantu
think BIG to get BIG thing

Offline superfox

  • Newbie
  • *
  • Posts: 24
Re: store proc insert pd my sql
« Reply #2 on: April 14, 2009, 03:04:24 PM »
tks bro...

udah saya coba n ga ada eror tapi hasilnya juga sama, data tsb ga masuk

apa ada yang salah dengan saat buat Sp nya ya?  ???

Offline fansul

  • Hero Member
  • *
  • Posts: 894
Re: store proc insert pd my sql
« Reply #3 on: April 14, 2009, 03:33:13 PM »
kalau sp nya di bikin gini bagaimana
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_insert_brg`
       (xkd varchar(10), xnm varchar(20))
BEGIN
insert into tbl_brg(kd_brg,nm_brg) values (xkd,xnm);
END