# Stored procedure Problems (MYSQL)

**URL:** <https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032>\
**Category:** Archived Topics\
**Created:** [June 23, 2011, 5:27pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032 "2011-06-23T17:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PenCapBlue](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@PenCapBlue](https://forum.inductiveautomation.com/u/PenCapBlue)\
**Post date:** [June 23, 2011, 5:27pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032/1 "2011-06-23T17:27:18Z")

</div>

I am creating a database authentication system. Unfortunately, I am not able to create a stored procedure to create a new user. I’ve worked with MSSQL quite in depth before, however I am at a loss as to how to solve this problem. Below is the code I am using to create the stored procedure: [quote]DELIMITER $$

create PROCEDURE USP\_CREATE\_LOS\_ALTOS\_USER (USER\_NAME1 VARCHAR(100),PWD1 VARCHAR(100),ROLE\_NUM1 TINYINT)

```
BEGIN

   INSERT INTO LOS_ALTOS.USERS (USER_NAME, PWD, ROLE_NUM)

   SELECT USER_NAME1, PWD1, ROLE_NUM1

END $$

```

DELIMITER ;  
[/quote]

Does anybody see anything blatantly wrong? I’ve been working at it for a few hours, and I’m still up against a brick wall.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [June 23, 2011, 5:49pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032/2 "2011-06-23T17:49:30Z")

</div>

Try the following:[code]DELIMITER $$

create PROCEDURE USP\_CREATE\_LOS\_ALTOS\_USER (USER\_NAME1 VARCHAR(100),PWD1 VARCHAR(100),ROLE\_NUM1 TINYINT)

BEGIN

INSERT INTO LOS\_ALTOS.USERS (USER\_NAME, PWD, ROLE\_NUM) VALUES (USER\_NAME1, PWD1, ROLE\_NUM1);

END $$

DELIMITER ;[/code]Let me know if you still have issues. Post the error message if you get one.

---

<div class="post-metadata">

**Author:** ![PenCapBlue](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@PenCapBlue](https://forum.inductiveautomation.com/u/PenCapBlue)\
**Post date:** [June 23, 2011, 6:52pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032/3 "2011-06-23T18:52:49Z")

</div>

Ah! It appears as if I have successfully created the stored procedure. However, when I attempt to execute the stored procedure via a stored procedure transaction group, I receive the error “No access to parameters by name when connection has been configured not to access procedure bodies.”

Any clues?

---

<div class="post-metadata">

**Author:** ![PenCapBlue](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@PenCapBlue](https://forum.inductiveautomation.com/u/PenCapBlue)\
**Post date:** [June 23, 2011, 7:51pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032/4 "2011-06-23T19:51:15Z")

</div>

Travis, I really appreciate your help.

We solved the problem.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [June 24, 2011, 4:07pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-problems-mysql/3032/5 "2011-06-24T16:07:03Z")

</div>

Can you post the solution?
