2

I am developing an Oracle ADF web application using jDeveloper. For that am using

  • jDeveloper
  • MySql database
  • Integrated WebLogic (which came with jDeveloper)

So am trying to Create a Query-only Business Service Based on Parameters. For this I need to create a query which will take values at run time.

I am following a tutorial in that they gave(because tutorial followed oracle) oracle equivalent query

select first_name,last_name from employees where email=:p_mail

But I need mysql query equivalent to the above (because I am following MySql DB).

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
Abdul
  • 1,096
  • 4
  • 28
  • 61
  • http://stackoverflow.com/questions/23178816/mysql-dynamic-query-in-stored-procedure might help. – Riad Dec 24 '14 at 07:28
  • thank you very much for replying.. – Abdul Dec 24 '14 at 07:53
  • the above link talking about stored procedure. But am not dealing with stored procedure. In orcale ADF app am creating Business service Based on parameters. Whenever I entered into a window the above query I am getting the following error – Abdul Dec 24 '14 at 07:59
  • com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':p_email' at line 1 – Abdul Dec 24 '14 at 08:04

1 Answers1

0

Same as Oracle your query will be :

$show_list = $bdd->prepare("SELECT first_name, last_name FROM employees WHERE email = :p_mail");
$show_list->execute(Array(':p_mail' => $user_email));
$show_list->fetchAll();
marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425