Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    4

    Unanswered: Multiple statements in single query batch

    Hi,

    Can anyone advise how to execute multiple statements in a single query
    batch. For example-

    update customers set customer_name = 'Smith' where customer_name =
    'Smyth';
    select * from customers;

    I can execute each statement individually but get the 'you have an error in
    you SQL syntax' when trying to execute them together.
    Ultimately I'm looking to build multi-statement queries (some may contain
    transactions) that do lots of work and then return a result for the client
    to use :-

    INSERT customers
    (customer_name)
    VALUES
    (ucase('test3'));

    SELECT c.customer_id, c.customer_name
    FROM customers c
    WHERE c.customer_name = ucase('test3');

    Can anyone tell me what I'm missing?

    Thanks,

    DG

  2. #2
    Join Date
    Aug 2005
    Location
    Oklahoma
    Posts
    9
    this question has been asked before. try doing a search in this forum, it shouldnt be hard to find a solution.

    good luck

  3. #3
    Join Date
    Oct 2004
    Location
    In cousin's house
    Posts
    303
    if u r using mysal 5.0 above then u can use create procedure

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •