Help!!! : Complex mysql query in dreamweaver

Ok Guys: I need this query executed on a client's website. I know it's working well in phpmyadmin, but in dreamweaver I cannot put it to work. The point is that the mysql_query funcion in PHP can only execute one query, So I cannot set the initial values of the parameters. I tried to translate it into dreamweaver standard code but the result gives onlyone record for each cat_news_id, while I need three. Any help please?
================mysql code================================
SET @c :=0;
SET @a :=0;
SELECT n.id, n.cat_news_id, IF( @c = n.cat_news_id, @a := @a +1, @a :=1 ) AS rownum, (
@c := n.cat_news_id
), n.foto, DATE_FORMAT( n.data, '%d/%m/%Y' ) AS data_it, n.ora, n.titolo, n.testobreve, n.pubblicata, n.primopiano, n.visite, nc.cat_news_name
FROM tb_news n
INNER JOIN tb_cat_news nc ON n.cat_news_id = nc.cat_news_id
WHERE n.pubblicata =1
GROUP BY n.cat_news_id, rownum
HAVING rownum <=3
ORDER BY n.id DESC
==============end mysql code==========================================
================dreamweaver code================================
$intCounter_rsNotizie = "0";
$intCategory_rsNotizie = "0";
mysql_select_db($database_ConnInterista, $ConnInterista);
$query_rsNotizie = sprintf("SELECT n.id, n.cat_news_id, IF( %s = n.cat_news_id, %s = %s +1, %s =1 ) AS rownum, ( %s =  n.cat_news_id ), n.foto, DATE_FORMAT( n.data, '%%d/%%m/%%Y' ) AS data_it, n.ora, n.titolo, n.testobreve, n.pubblicata, n.primopiano, n.visite, nc.cat_news_name FROM tb_news n INNER JOIN tb_cat_news nc ON n.cat_news_id = nc.cat_news_id WHERE n.pubblicata =1 GROUP BY n.cat_news_id, rownum HAVING rownum <=3 ORDER BY n.id DESC", GetSQLValueString($intCategory_rsNotizie, "int"),GetSQLValueString($intCounter_rsNotizie, "int"),GetSQLValueString($intCounter_rsNotizie, "int"),GetSQLValueString($intCounter_rsNotizie, "int"),GetSQLValueString($intCategory_rsNotizie, "int"));
$rsNotizie = mysql_query($query_rsNotizie, $ConnInterista) or die(mysql_error());
$row_rsNotizie = mysql_fetch_assoc($rsNotizie);
$totalRows_rsNotizie = mysql_num_rows($rsNotizie);
==============end dreamweaver code==========================================
Thanks for your interest

Hi there Walt,
Thanks for your reply....A stored procedure...yes. I should have thought about it. In this particular case I will try this way out since I have a root account and I can execute any mysql code. Usually, anyway, I found that web hosts tend to leave little grants to their clients mysql user accounts and even setting up a stored procedure could be an issue. I would be happy to find also a lighter solution, if possible....Anyway I will let you know if I could put the stored procedure solution to work.
Thanks again for your hint!

Similar Messages

  • Help with mysql query plz anyone i am begging!!!

    Hi everyone pls forgive me i am new to java. can someone pls tel me where i am going wrong wit this mysql query?
    <sql:query var="parish" maxRows="1" dataSource="jdbc/gav">
    SELECT ParishName, OwnerOccupierHousehold, OwnerOccupierPercOfOverall, OwnerOccupierCo2Emissions,
    SocialRentedHousehold, SocialRentedPercOfOverall, SocialRentedCo2Emissions, PrivateRentedHousehold,
    PrivateRentedPercOfOverall, PrivateRentedCo2Emission, TotalHouseholds, TotalPerc, Average,
    Total2001, TotalEstimatedTotal2006, EmissionsPerPerson, EmissionPerHousehold, EmissionsPerParish,
    EnergyChampionsNeeded, NumberOfPeopleAtWork, NumberOfSchoolAgeChildren
    FROM base_data as b
    WHERE b.id = ? <sql:param value="${param.id}"/>
    <sql:param value="${param.id}"/>
    </sql:query>
    <c:set var="parish" scope="request" value="${parish.rows[0]}"/>
    here is the error i get:
    java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
    please any help would be appreciated!!! Thanks in advance guys .

    here is my code for the form on the index page:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
    <sql:query var="parish" dataSource="jdbc/gav">
    SELECT id, ParishName FROM base_data
    </sql:query>
    <form action="response.jsp">
    Select a Parish: <select name="id">
    <c:forEach var="parish" items="${parish.rows}">
    <option value="${parish.id}">${parish.ParishName}</option>
    </c:forEach>
    </select><br><input type="submit" value="submit" name="submit" /></form>
    here is the code for the response page:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
    <sql:query var="parish" maxRows="1" dataSource="jdbc/gav">
    SELECT b.id, b.ParishName, b.OwnerOccupierHousehold, b.OwnerOccupierPercOfOverall, b.OwnerOccupierCo2Emissions,
    b.SocialRentedHousehold, b.SocialRentedPercOfOverall, b.SocialRentedCo2Emissions, b.PrivateRentedHousehold,
    b.PrivateRentedPercOfOverall, b.PrivateRentedCo2Emission, b.TotalHouseholds, b.TotalPerc, b.Average,
    b.Total2001, b.TotalEstimatedTotal2006, b.EmissionsPerPerson, b.EmissionPerHousehold, b.EmissionsPerParish,
    b.EnergyChampionsNeeded, b.NumberOfPeopleAtWork, b.NumberOfSchoolAgeChildren
    FROM base_data as b
    WHERE b.id = ? <sql:param value="${param.id}"/>
    </sql:query>
    <c:set var="parish" scope="request" value="${parish.rows[0]}"/>
    i display the results like this : ${parish.EmissionsPerParish}
    the user should be able to select a parish from a form and then sql query created and then i want to show the row results on the response page.
    could you tell me where so should be a simple process although not simple enough as it may seem.
    thanks for the advice keith

  • Need help with MySQL Query...Again

    Ok so I get this error when I enter "springfield" and "MA" for the city and state.
    This server program accepts either a 'zipcode' or 'city, state' depending on the choice # passed to it.
    I just need to be able to perform the query.
    Thanks!!
    java.sql.SQLException: Unknown column 'springfield' in 'where clause'
    Error4
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
         at com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
         at ThreadConnect.run(ZipcodeServer.java:84)Here is my code:
    import java.sql.*;
    import java.io.*;
    import java.net.*;
    public class ZipcodeServer {
         static void runServer() {
              ServerSocket server;
              Socket connection;
              try {
                   System.out.println("Creating Server Socket " + 5000 + " . . . ");
                   server = new ServerSocket(5000);
                   System.out.println("SUCCESS!!!");
                   while (true) {
                        System.out.println("Waiting for connection.");
                        connection = server.accept();
                        System.out.println("Done");
                        ThreadConnect t = new ThreadConnect(connection);
                        t.start();
              } catch (IOException e) {
                   System.out.println("Error5");
                   e.printStackTrace();
         public static void main(String args[]) {
              ZipcodeServer.runServer();
    class ThreadConnect extends Thread {
         Socket connection;
         DataOutputStream output;
         DataInputStream input;
         ThreadConnect(Socket x) {
              connection = x;
         public void run() {
              try {
                   input = new DataInputStream(connection.getInputStream());
                   output = new DataOutputStream(connection.getOutputStream());
                   try {
                        int choice = input.readInt();
                        String city, state;
                        int zipcode;
                        if (choice == 1) {
                             int zc = input.readInt();
                             DatabaseConnection.connect();
                             DatabaseConnection.rs = DatabaseConnection.s
                                       .executeQuery("SELECT City,State FROM Zipcodes "
                                                 + "WHERE ZipCode = " + zc);
                             while (DatabaseConnection.rs.next()) {
                                  state = DatabaseConnection.rs.getString("State");
                                  output.writeUTF(state);
                                  output.flush();
                                  city = DatabaseConnection.rs.getString("City");
                                  output.writeUTF(city);
                                  output.flush();
                        } else if (choice == 2) {
                             city = input.readUTF();
                             state = input.readUTF();
                             DatabaseConnection.connect();
                             DatabaseConnection.rs = DatabaseConnection.s
                                       .executeQuery("SELECT ZipCode FROM Zipcodes "
                                                 + "WHERE City = " + city + " AND State = "
                                                 + state);
                             while (DatabaseConnection.rs.next()) {
                                  zipcode = DatabaseConnection.rs.getInt("ZipCode");
                                  output.writeInt(zipcode);
                                  output.flush();
                   } catch (Exception e) {
                        System.out.println("Error4");
                        e.printStackTrace();
                   } finally {
                        DatabaseConnection.close();
              } catch (IOException e) {
                   System.out.println("Error3");
                   e.printStackTrace();
    class DatabaseConnection {
         static Connection con;
         static Statement s;
         static ResultSet rs;
         static String driver = "com.mysql.jdbc.Driver";
         static String url = "jdbc:mysql://***.****.******/***";
         static String user = "*******";
         static String password = "********";
         static void connect() {
              try {
                   Class.forName(driver).newInstance();
                   System.out.println("Loaded Driver");
                   con = DriverManager.getConnection(url, user, password);
                   System.out.println("Connected to database\n");
                   con.setAutoCommit(false);
                   s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                             ResultSet.CONCUR_READ_ONLY);
              } catch (Throwable e) {
                   System.out.println("Error2");
                   e.printStackTrace();
         static void close() {
              try {
                   rs.close();
                   s.close();
                   con.close();
                   System.out.println("\nDisconnected From Database");
              } catch (Throwable e) {
                   System.out.println("Error1");
                   e.printStackTrace();
    }

    R.Baldwin7 wrote:
    I tried it. Still getting the same error.
    Code no looks like:
    else if (choice == 2) {
                             city = input.readUTF();
                             state = input.readUTF();
                             DatabaseConnection.connect();
                             PreparedStatement ps = DatabaseConnection.con.prepareStatement("SELECT ZipCode FROM Zipcodes "
                                       + "WHERE City = " + city + " AND State = "
                                       + state);
                             DatabaseConnection.rs = ps.executeQuery();
                             while (DatabaseConnection.rs.next()) {
                                  zipcode = DatabaseConnection.rs.getInt("ZipCode");
                                  output.writeInt(zipcode);
                                  output.flush();
    Read the API docs and the JDBC Tutorials for the proper way to use a PreparedStatement. It may "work" to add the quotes, but it is definately not the right way to do it. What happens if the city entered contains an apostrophe? Your statement will be broken again. Like I said, use a PreparedStatement and use it right.

  • Help with MYSQLi Query and WHILE statement

    Hi,
    Not sure what is wrong here but the same record is printed in the while loop 11 times (the amount of records in the table).
    <?php 
    //Main Connection & Query
    //Database Connection & Error
    $con_host = 'X';
    $con_username = 'X';
    $con_password = 'X';
    $con_database = 'X';
    $con = mysqli_connect($con_host, $con_username, $con_password, $con_database);
    ?>
    <?php
    //Query
    $sql = "SELECT * FROM equipment ORDER BY name ASC";
    $query = mysqli_query($con, $sql);
    $row = mysqli_fetch_assoc($query);
    $row_count = mysqli_num_rows($query);
    //Create Variables
    $name = $row['name'];
    $size = $row['size'];
    $quantity = $row['quantity'];
    $protection = $row['protection'];
    $location = $row['location'];
    $sublocation = $row['sublocation'];
    $bc = $row['BC'];
    $id = $row['id'];
    ?>
    <!doctype html>
    <html>
    <link href="stylesheets/main_stylesheet.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/png" href="images/icon.png" />
    <style type="text/css">
    </style>
    <head>
    <meta charset="utf-8">
    <title>Print Equipment List</title>
    <link href="stylesheets/print_stylesheet.css" rel="stylesheet" type="text/css">
    <script src="sorttable.js"></script>
    <!--<body onload="window.print()">-->
    </head>
    <body>
    <div class="print_button no-print" onClick="window.print()">Print</div>
    <div class="print_text no-print">Select the sorting of the list by clicking on the table categories and click the print button below</div>
    <div class="print_a4page">
      <div class="print_header">
         <div class="print_header_logo"><img src="images/logo.png" width="306" height="43"></div>
          <div class="print_header_text" id="header_text">Drama Database</div>
          <div class="print_header_info">List printed: <script type="text/javascript">
      var currentTime = new Date();
      var month = currentTime.getMonth() + 1;
      var day = currentTime.getDate();
      var year = currentTime.getFullYear();
      document.write(day + "/" + month + "/" + year);</script>
      <br>
    Total records:
    <?php echo $row_count ?></div>
      </div>
        <div class="print_header_divider">Equipment List</div>
        <div class="print_body">
          <div>
            <form name="users" method="post">
              <div class="table_print">
              <table width="100%" border="0" cellpadding="5" class="sortable">
                <tr class="table_header_print">
                  <th width="15%" scope="col">Name</th>
                  <th width="12%" scope="col">Size</th>
                  <th width="9%" scope="col">Quantity</th>
                  <th width="12%" scope="col">Protection</th>
                  <th width="17%" scope="col">Location</th>
                  <th width="12%" scope="col">Sublocation</th>
                  <th width="11%" scope="col">Barcode</th>
                  <th width="12%" scope="col">Internal ID</th>
                </tr>
                <?php do { ?>
                <tr class="table_body">
                  <td><?php echo $name ?></td>
                  <td><?php echo $size ?></td>
                  <td><?php echo $quantity ?></td>
                  <td><?php echo $protection ?></td>
                  <td><?php echo $location ?></td>
                  <td><?php echo $sublocation ?></td>
                  <td><?php echo $bc ?></td>
                  <td><?php echo $id ?></td>
                </tr>
                <?php } while ($row = mysqli_fetch_assoc($query));?>
              </table>
            </form>
          </div>
        </div>
    </div>
    </body>
    </html>

    Still getting the same issue.
    As I see it, the way you have suggested is just rearanging things right?
    here is a screenshot of the outcome:
    And here is the improved code:
    <?php 
    //Main Connection & Query
    //Database Connection & Error
    $con_host = 'X';
    $con_username = 'X';
    $con_password = 'X';
    $con_database = 'X';
    $con = new mysqli($con_host, $con_username, $con_password, $con_database);
    ?>
    <?php
    //Query
    $sql = "SELECT * FROM equipment ORDER BY name ASC";
    $result = $con->query($sql);
    $row = $result->fetch_assoc();
    $row_count = $result->num_rows;
    //Create Variables
    $name = $row['name'];
    $size = $row['size'];
    $quantity = $row['quantity'];
    $protection = $row['protection'];
    $location = $row['location'];
    $sublocation = $row['sublocation'];
    $bc = $row['BC'];
    $id = $row['id'];
    ?>
    <!doctype html>
    <html>
    <link href="stylesheets/main_stylesheet.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/png" href="images/icon.png" />
    <style type="text/css">
    </style>
    <head>
    <meta charset="utf-8">
    <title>Print Equipment List</title>
    <link href="stylesheets/print_stylesheet.css" rel="stylesheet" type="text/css">
    <script src="sorttable.js"></script>
    <!--<body onload="window.print()">-->
    </head>
    <body>
    <div class="print_button no-print" onClick="window.print()">Print</div>
    <div class="print_text no-print">Select the sorting of the list by clicking on the table categories and click the print button below</div>
    <div class="print_a4page">
      <div class="print_header">
         <div class="print_header_logo"><img src="images/logo.png" width="306" height="43"></div>
          <div class="print_header_text" id="header_text">Drama Database</div>
          <div class="print_header_info">List printed: <script type="text/javascript">
      var currentTime = new Date();
      var month = currentTime.getMonth() + 1;
      var day = currentTime.getDate();
      var year = currentTime.getFullYear();
      document.write(day + "/" + month + "/" + year);</script>
      <br>
    Total records:
    <?php echo $row_count ?></div>
      </div>
        <div class="print_header_divider">Equipment List</div>
        <div class="print_body">
          <div>
            <form name="users" method="post">
              <div class="table_print">
              <table width="100%" border="0" cellpadding="5" class="sortable">
                <tr class="table_header_print">
                  <th width="15%" scope="col">Name</th>
                  <th width="12%" scope="col">Size</th>
                  <th width="9%" scope="col">Quantity</th>
                  <th width="12%" scope="col">Protection</th>
                  <th width="17%" scope="col">Location</th>
                  <th width="12%" scope="col">Sublocation</th>
                  <th width="11%" scope="col">Barcode</th>
                  <th width="12%" scope="col">Internal ID</th>
                </tr>
                <?php while ($row = $result->fetch_assoc()) { ?>
                <tr class="table_body">
                  <td><?php echo $name ?></td>
                  <td><?php echo $size ?></td>
                  <td><?php echo $quantity ?></td>
                  <td><?php echo $protection ?></td>
                  <td><?php echo $location ?></td>
                  <td><?php echo $sublocation ?></td>
                  <td><?php echo $bc ?></td>
                  <td><?php echo $id ?></td>
                </tr>
                <?php } ?>
              </table>
            </form>
          </div>
        </div>
    </div>
    </body>
    </html>

  • Complex MySQL Query, Grouping By Invoice Number and Adding Multiple Values To Insert Into Database

    I have a table that looks like the above. I need to be able to update values in a database based on an ioID (the invoice number)
    The value I need to add is the hours times the uSalary, however as you will notice above the hours can and well have been added on an ongoing basis. For example:
    smarotti has added 4.5 (0.5 + 4.0) hours for the ioID 14190 (last 2 rows) for a total cost of $143.55
    So what I need is to have the value $143.55 update the record 14190 (ioID) on a new column (userCost)
    So:
    the userID - ddevries did 1 hour worth of work at the rate of $23.20 that needs to be update on the record 8026
    the userID - kmurtha did 20 (.5 + .25 + 6.5 + .25 + 6.5 + 6) hours worth of work $696 (20 * 34.80) that needs to be update on the record 9462
    make sense? anyone have any thoughts on how to go about doing this?
    Thanks
    Vern

    Okay
    assuming you add the column to your table the query would look like the below:
    UPDATE workers
                    INNER JOIN (SELECT
                                                    round(SUM(hours*uSalary),1) AS cost,
                                                    ioID,
                                                    userid
                                            FROM
                                                    workers
                                            GROUP BY ioID, userid ) b
                    ON workers.ioID = b.ioID
            SET workers.userCost=b.cost
    WHERE workers.ioid = b.ioID
    AND     workers.userID = b.userID
    Or if you would just like to query the data:
    SELECT  round(SUM(hours*uSalary),1) AS usercost,ioID,userid
    FROM workers
    GROUP BY ioID, userid

  • Complex SQL query help

    Hi,
    I was wondering if I could have some help with the query I have below for this general data set, please? I need to do it in a single SQL statement. We're currently running Oracle 10g. The piece I'm struggling with is identifying that the person has all the items in a collection and to include the collection in the resulting collection of items.
    persons_items
    person     item
    Ted          cup
    Ted          saucer
    Ted          plate
    Ted          fork
    Alice          book
    Alice          thimble
    Alice          knife
    Alice          cup
    Joe          cup
    Joe          saucer
    Joe          plate
    Joe          knife
    Joe          fork
    Joe          spoon
    Jessica     spatula
    Jessica     dish
    collections
    collection_name     item
    crockery     cup
    crockery     saucer
    crockery     plate
    cutlery          knife
    cutlery          fork
    cutlery          spoon
    Query:
    What single items and collections does Ted have?     fork, crockery
    What single items and collections does Alice have?     book, thimble, knife, cup
    What single items and collections does Joe have?     crockery, cutlery
    What single items and collections does Jessica have?     spatula, dish
    Thanks in advance.
    Pat

    Expanding on Brendan's solution...
    For 11g:
    SQL> ed
    Wrote file afiedt.buf
      1  WITH person_items AS (
      2          SELECT 'Ted' person, 'cup' item FROM DUAL UNION
      3          SELECT 'Ted', 'saucer' FROM DUAL UNION
      4          SELECT 'Ted', 'plate' FROM DUAL UNION
      5          SELECT 'Ted', 'fork' FROM DUAL UNION
      6          SELECT 'Alice', 'book' FROM DUAL UNION
      7          SELECT 'Alice', 'thimble' FROM DUAL UNION
      8          SELECT 'Alice', 'knife' FROM DUAL UNION
      9          SELECT 'Alice', 'cup' FROM DUAL UNION
    10          SELECT 'Joe', 'cup' FROM DUAL UNION
    11          SELECT 'Joe', 'saucer' FROM DUAL UNION
    12          SELECT 'Joe', 'plate' FROM DUAL UNION
    13          SELECT 'Joe', 'knife' FROM DUAL UNION
    14          SELECT 'Joe', 'fork' FROM DUAL UNION
    15          SELECT 'Joe', 'spoon' FROM DUAL UNION
    16          SELECT 'Jessica', 'spatula' FROM DUAL UNION
    17          SELECT 'Jessica', 'dish' FROM DUAL
    18  ), collections AS (
    19          SELECT 'crockery' collection_name, 'cup' item FROM DUAL UNION
    20          SELECT 'crockery', 'saucer' FROM DUAL UNION
    21          SELECT 'crockery', 'plate' FROM DUAL UNION
    22          SELECT 'cutlery', 'knife' FROM DUAL UNION
    23          SELECT 'cutlery', 'fork' FROM DUAL UNION
    24          SELECT 'cutlery', 'spoon' FROM DUAL
    25  ), person_item_colls AS (
    26          SELECT pi.person, pi.item, co.collection_name,
    27                 Count(*) OVER (PARTITION BY pi.person, co.collection_name) n_col
    28            FROM person_items pi
    29            LEFT JOIN collections co
    30              ON co.item = pi.item
    31  )
    32  select person, listagg(collection_name,',') within group (order by collection_name) as collections
    33  from (
    34        SELECT DISTINCT person, collection_name
    35        FROM   person_item_colls
    36        WHERE  collection_name IS NOT NULL
    37        AND    n_col > 1
    38        UNION ALL
    39        SELECT person, item
    40        FROM   person_item_colls
    41        WHERE  collection_name IS NULL
    42        OR     n_col = 1
    43       )
    44* group by person
    SQL> /
    PERSON  COLLECTIONS
    Alice   book,cup,knife,thimble
    Jessica dish,spatula
    Joe     crockery,cutlery
    Ted     crockery,forkFor 10g:
    SQL> ed
    Wrote file afiedt.buf
      1  WITH person_items AS (
      2          SELECT 'Ted' person, 'cup' item FROM DUAL UNION
      3          SELECT 'Ted', 'saucer' FROM DUAL UNION
      4          SELECT 'Ted', 'plate' FROM DUAL UNION
      5          SELECT 'Ted', 'fork' FROM DUAL UNION
      6          SELECT 'Alice', 'book' FROM DUAL UNION
      7          SELECT 'Alice', 'thimble' FROM DUAL UNION
      8          SELECT 'Alice', 'knife' FROM DUAL UNION
      9          SELECT 'Alice', 'cup' FROM DUAL UNION
    10          SELECT 'Joe', 'cup' FROM DUAL UNION
    11          SELECT 'Joe', 'saucer' FROM DUAL UNION
    12          SELECT 'Joe', 'plate' FROM DUAL UNION
    13          SELECT 'Joe', 'knife' FROM DUAL UNION
    14          SELECT 'Joe', 'fork' FROM DUAL UNION
    15          SELECT 'Joe', 'spoon' FROM DUAL UNION
    16          SELECT 'Jessica', 'spatula' FROM DUAL UNION
    17          SELECT 'Jessica', 'dish' FROM DUAL
    18  ), collections AS (
    19          SELECT 'crockery' collection_name, 'cup' item FROM DUAL UNION
    20          SELECT 'crockery', 'saucer' FROM DUAL UNION
    21          SELECT 'crockery', 'plate' FROM DUAL UNION
    22          SELECT 'cutlery', 'knife' FROM DUAL UNION
    23          SELECT 'cutlery', 'fork' FROM DUAL UNION
    24          SELECT 'cutlery', 'spoon' FROM DUAL
    25  ), person_item_colls AS (
    26          SELECT pi.person, pi.item, co.collection_name,
    27                 Count(*) OVER (PARTITION BY pi.person, co.collection_name) n_col
    28            FROM person_items pi
    29            LEFT JOIN collections co
    30              ON co.item = pi.item
    31  )
    32  select person, ltrim(sys_connect_by_path(collection_name,','),',') as collections
    33  from (
    34        select person, collection_name, row_number() over (partition by person order by collection_name) as rn
    35        from (
    36              SELECT DISTINCT person, collection_name
    37              FROM   person_item_colls
    38              WHERE  collection_name IS NOT NULL
    39              AND    n_col > 1
    40              UNION ALL
    41              SELECT person, item
    42              FROM   person_item_colls
    43              WHERE  collection_name IS NULL
    44              OR     n_col = 1
    45             )
    46        )
    47  where connect_by_isleaf = 1
    48  connect by person = prior person and rn = prior rn + 1
    49* start with rn = 1
    SQL> /
    PERSON  COLLECTIONS
    Alice   book,cup,knife,thimble
    Jessica dish,spatula
    Joe     crockery,cutlery
    Ted     crockery,fork

  • Need help writing a MySQL query that will return only records with matching counter-parts

    Since I don't know how to explain this easily, I'm using the
    table below as an example.
    I want to create a MySQL query that will return only records
    that have matching counter-parts where 'col1' = 'ABC'.
    Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC' record. This record should not be
    returned because there is no matching counter-part. With this
    table, the 'ABC / GHI' record should be the only one returned in
    the query.
    How can I create a query that will do this?
    id | col1 | col2
    1 | ABC | DEF
    2 | DEF | ABC
    3 | ABC | GHI
    4 | DEF | GHI
    5 | GHI | DEF
    *Please let me know if you have no idea what I'm trying to
    explain.

    AngryCloud wrote:
    > Since I don't know how to explain this easily, I'm using
    the table below as an
    > example.
    >
    > I want to create a MySQL query that will return only
    records that have
    > matching counter-parts where 'col1' = 'ABC'.
    >
    > Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC'
    > record. This record should not be returned because there
    is no matching
    > counter-part. With this table, the 'ABC / GHI' record
    should be the only one
    > returned in the query.
    >
    > How can I create a query that will do this?
    >
    >
    > id | col1 | col2
    > --------------------
    > 1 | ABC | DEF
    > 2 | DEF | ABC
    > 3 | ABC | GHI
    > 4 | DEF | GHI
    > 5 | GHI | DEF
    >
    >
    > *Please let me know if you have no idea what I'm trying
    to explain.
    >
    Please be more clear. You say that 'ABC / GHI' should not be
    returned,
    and then you say that 'ABC / GHI' should be the only one
    returned. Can't
    have both...

  • Please help -- MySQL Query to Oracle

    I have been trying to convert the following MySQL query to work with Oracle 9i. There seem to be two problems:
    1) Oracle doesn't like the inclusion of the tblpackagegeneral.packageid in the "ON" clause of the "JOIN".
    2) The "GROUP BY" only has the one field, "tblpackagegeneral.packageid", specified; Oracle wants the other two specified as well. When I do that I get a different data set than what MySQL returns for the same tables of data: specifically MySQL returns one row for each packageid but the revised Oracle version returns more than 1 sometimes.
    I would appreciate any assistance possible.
    /* Formatted on 2003/07/07 14:43 (Formatter Plus v4.8.0) */
    SELECT tblpackagegeneral.packageid,
    CASE
    WHEN NVL
    (COUNT (tblpackagelearnerassignment.learnerid),
    COUNT (tbllearnergeneral.learnerid)
    ) > 0
    THEN 'Activity'
    WHEN tbllearnergeneral.subscribetopubliccourse = 'true'
    AND tblpackagegeneral.packageaccess = 'Public'
    THEN 'ActivityAfterSubscribe'
    WHEN ( tbllearnergeneral.subscribetopubliccourse = 'false'
    AND tblpackagegeneral.packageaccess = 'Public'
    THEN 'Subscribe'
    ELSE 'Subscribe'
    END AS "ASSIGNSTATUS"
    FROM tblpackagegeneral, tbllearnergeneral LEFT OUTER JOIN tblpackagelearnerassignment ON ( tblpackagelearnerassignment.packageid =
    tblpackagegeneral.packageid
    AND tblpackagelearnerassignment.learnerid =
    tbllearnergeneral.learnerid
    WHERE tbllearnergeneral.learnerid = '%var'
    AND tblpackagegeneral.packageavailability = 'Available'
    AND TO_CHAR (tblpackagegeneral.dateto, 'YYYYMMDD') >=
    TO_CHAR (CURRENT_TIMESTAMP, 'YYYYMMDD')
    GROUP BY tblpackagegeneral.packageid;
    Sincerely,
    Bill Robinson

    I have been trying to convert the following MySQL query to work with Oracle 9i. There seem to be two problems:
    1) Oracle doesn't like the inclusion of the tblpackagegeneral.packageid in the "ON" clause of the "JOIN".
    2) The "GROUP BY" only has the one field, "tblpackagegeneral.packageid", specified; Oracle wants the other two specified as well. When I do that I get a different data set than what MySQL returns for the same tables of data: specifically MySQL returns one row for each packageid but the revised Oracle version returns more than 1 sometimes.
    I would appreciate any assistance possible.
    /* Formatted on 2003/07/07 14:43 (Formatter Plus v4.8.0) */
    SELECT tblpackagegeneral.packageid,
    CASE
    WHEN NVL
    (COUNT (tblpackagelearnerassignment.learnerid),
    COUNT (tbllearnergeneral.learnerid)
    ) > 0
    THEN 'Activity'
    WHEN tbllearnergeneral.subscribetopubliccourse = 'true'
    AND tblpackagegeneral.packageaccess = 'Public'
    THEN 'ActivityAfterSubscribe'
    WHEN ( tbllearnergeneral.subscribetopubliccourse = 'false'
    AND tblpackagegeneral.packageaccess = 'Public'
    THEN 'Subscribe'
    ELSE 'Subscribe'
    END AS "ASSIGNSTATUS"
    FROM tblpackagegeneral, tbllearnergeneral LEFT OUTER JOIN tblpackagelearnerassignment ON ( tblpackagelearnerassignment.packageid =
    tblpackagegeneral.packageid
    AND tblpackagelearnerassignment.learnerid =
    tbllearnergeneral.learnerid
    WHERE tbllearnergeneral.learnerid = '%var'
    AND tblpackagegeneral.packageavailability = 'Available'
    AND TO_CHAR (tblpackagegeneral.dateto, 'YYYYMMDD') >=
    TO_CHAR (CURRENT_TIMESTAMP, 'YYYYMMDD')
    GROUP BY tblpackagegeneral.packageid;
    Sincerely,
    Bill Robinson

  • Conversion of Mysql query in oracle acceptable query format

    Hi
    I have successfully converted my MySql database in oracle. Now the problem is how to execute already written hundreds of Mysql query on the oracle. There are many syntax variation in Mysql query format which is not acceptable for oracle.
    For Example
    Select case_id as 'this is alias' from cases
    The above query can run on Mysql database but have problem while executing Oracle, because single quotes should be replaced with double quotes before executing it on oracle. There are also many other syntax conflicts.
    I have tried to resolve the problem through SwisSQLAPI but problem still exist as SwisSQLAPI is not dealing with all syntax conflict. In my case (select if (expresion, true,false)) must be replace with decode (expression, value,true,false) function of oracle and this conversion is not supported by SwisSQLAPI.
    Please help me in resolving this problem
    Thanks

    The problem with trying to port from one language (mysql SQL) to another (oracle SQL) is that there's generally no hard rules for a computer to follow, that it will get it 100% correct.
    Look at babelfish when you translate a foreign language to English. The end result is readable (usually), but it's rarely completely correct.
    The problem is when you feed something into Oracle SQL, it needs to be 100% correct.
    All you can really do here is rewrite these queries. It shouldn't actually take as long as you think, because 50% of queries will generally need very minor changes you can do in a minute, and 25% won't need any changes at all.

  • Weird problem with mysql query and data table buttons !!!!

    Hi,
    I'm using jsc 2 update 1 on windows and mysql 4.1 . I have a page with a data table. One column of the data table contains "Details" buttons.
    Source query for the table is :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    AND tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    The tbl_tesserati.data_nascita is a mysql date field.
    The click event handler code for the "Details" Button is:
    public String btnModificaTesserato_action() {
            try{
                TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");
                getRequestBean1().setId_tesserato((Long)rowData.getValue("idTesserato"));          
            } catch(Exception ex) {
                log("errore nella query",ex);
            return "dettaglioTesseratoSocieta";
        }When i run the project and open the page the table is correctly rendered and populated with some rows. But when i click on details button nothing happens, the page is simply reloaded.
    If i set a breakpoint in the code line   TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");the debbuger does not stop the code execution ! As if the button was never clicked!
    I tried to modify the source query to :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    OR tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    Using this query everything works well !! The click handler works and the debugger too !!
    I changed only the AND in OR !!!
    I also tried to change mysql-x-x-connector driver but without solving my problem.
    Can someone help me ?
    Thanks
    Giorgio

    You'll find that it is more to do with the way MySql deals with dates than anything else! Depending on how your date field is setup, then try using a BETWEEN statement for those 2 lines in your first query e.g.
    AND ( tbl_tesserati.data_nascita BETWEEN ? AND ?)
    The date column needs to be in the ISO format to work. If you examine your second query output, you might discover that the output is only going to refer to one parameter (probably the OR one). Did you manage to view the output logs from the application server? You would have got an idea from there with a message like stating a conversion error'.
    Alternatively, you could try using the to_days() function and convert it directly to a number which would be a lot easier to deal with. For example:
    AND to_days(tbl_tesserati.data_nascita >= ? )
    AND to_days( tbl_tesserati.data_nascita<= ? )
    Or try the BETWEEN version with to_days() and see what you get.
    More info about date formatting (v5) here:
    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_to-days
    Before I forget, sometimes you may need to treat dates as Strings rather 'Long' as you did.
    As a matter of interest, did you try your query in a different piece of software?
    If my queries are a little more complicated, I tend to try MySql queries out in the free MySql query browser and also double check in another to verify certain issues. I found it easier to develop SQL in a seperate program then import the final version to JSC making the required modifications for parameters.
    Message was edited by:
    aerostra

  • Connection error mysql database in Dreamweaver

    the error message is - HTTP error code 404 file not found. here are some possible reasons
    screen shot - http://netwizlk.site50.net/images/DW-error.jpg
    1)there is no testing server running on the server machine.
    2)the testing server specified for this site does not map to the http://localhost/_mmServerScripts/MMhTTPDB.php verify that the URL prefix maps to the root of the site.
    guy pls help me to solve this problem. I tried several times to connect my mysql database with dreamweaver but ended up having this error I reinstalled dreamweaver cs4 and XAMPP still the error is not rectified my both remote and local files are stored in XAMPP server location called in c:\xampp\htdocs\htdocs\myweb
    anybody who could give me a speedy solution for this issue will be highly appreciated thanks alot guys.

    c:\xampp\htdocs\htdocs\myweb
    MM serverscripts must be at the root level of the virtual server, that is directly in the htdocs folder.
    Mylenium

  • Error occured when connect to MySql Databse in Dreamweaver

    Hello! I met a problem when connect to Mysql Databse in
    Dreamweaver
    Details:
    My Php Environment: Php 5.2.2+ MySql 5.0.4 + IIS 6.0 + DW IDE
    + WinXP SP2,
    All necessary sevice started(Actually I have never stopped
    any Windows service).
    Php installed (IIS + CGI) and tested successfully in DW
    MySql Installtion(Typical Install with extensions ) and
    configuration are both OK.
    Configuration Details:
    For configuration type, select Detailed Configuration.
    For server type, select Developer Machine
    For database usage, select Non-Transactional Database Only.
    For the number of concurrent connections, select Decision
    Support(DSS)/OLAP.
    For networking options, accept the default settings.
    For the default character set, accept the default setting.
    For the Windows options, select both options – Install
    As Windows Service, and Include Bin Directory in Windows Path.
    For security options, enter a root password and confirmed.
    And then I Created a database "mydb" with 3 tables inside by
    "MySql Command Line Client",
    ...... (Approach Obmit here)
    Open "MySql Command Line Client":
    Type >mysql Show Database mydb;
    Show a list with 3 tables(Created Successfully)
    Then In DW,
    Open my Php webpage,
    Then from Database Panel>MySql Connection,
    Connect Name:myconn
    Mysql Server:localhost
    Username:root (Right)
    Password:111111(Right)
    Database:mydb
    Click "OK", but when DW tried to connect to MySql database,
    then DW popuped an alert dialog says "HTTP Error Code 502 Bad
    Gateway",
    I don't know what this mean and how to solve this problem,
    hope any PHP and DW expert can help me, thank you very much.

    Phoenix Wang wrote:
    > Click "OK", but when DW try to connect to MySql
    database, then popup an alert
    > dialog says "HTTP Error Code 502 Bad Gateway",
    > I don't know what this mean and how to solve this
    problem, hope any PHP and DW
    > expert can help me, thank you very much.
    How have you set up the Testing server in your site
    definition?
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • [SLVD] MySQL Query Browser (1.2.12) hangs when changing schma/database

    After a rather big upgrade yesterday (see paste below) I have got a problem with MySQL query browser which is found in package mysql-gui-tools. Everything else seems to be okay, but after upgrading mysql-gui-tools from 5.0r12-3 to 5.0r14-1 (..and now, after another update, its at 5.0r14-2) it is no longer able to refresh schema/databases. Every time I try to change/refresh schema in the schema menu to the right the program hangs and I have to kill it. A refresh icon appears as normal to the left of the schema I'm trying to refresh, but that icon too has frozen. I am however able to execute normal SELECT queries etc if I write the full "path" to the table in the SQL query, but when I try a USE query the same thing happens.
    I have done some searching on the Internet about this and found this thread to be interesting. Too bad it's from July 2007..
    I tried to downgrade to the old version of query browser, but then I got this problem:
    /usr/bin/mysql-query-browser-bin: error while loading shared libraries: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory
    ..So I guess theres a dependency problem here with the old version.
    Has anyone else got any problem with the MySQL Query Browser after upgrade or has any ideas for a solution?
    Log from pacman:
    [2009-04-12 13:52] synchronizing package lists
    [2009-04-12 13:52] starting full system upgrade
    [2009-04-12 13:55] upgraded xf86-input-evdev (2.1.2-1 -> 2.2.1-1)
    [2009-04-12 13:55] upgraded xorg-server (1.5.3-5 -> 1.6.0-3)
    [2009-04-12 13:56] synchronizing package lists
    [2009-04-12 13:56] starting full system upgrade
    [2009-04-12 13:56] upgraded glib2 (2.20.0-1 -> 2.20.1-1)
    [2009-04-12 13:56] upgraded libcap (1.10-2 -> 2.16-3)
    [2009-04-12 13:56] upgraded avahi (0.6.24-1 -> 0.6.24-3)
    [2009-04-12 13:56] upgraded cdrkit (1.1.9-1 -> 1.1.9-2)
    [2009-04-12 13:56]
    [2009-04-12 13:56] >>> Deluge's daemon is running with the "deluge" user. The default download directory is /srv/deluge/
    [2009-04-12 13:56]
    [2009-04-12 13:56] upgraded deluge (1.1.5-1 -> 1.1.6-3)
    [2009-04-12 13:56] upgraded jack-audio-connection-kit (0.109.2-2 -> 0.116.2-1)
    [2009-04-12 13:56] upgraded gstreamer0.10-bad-plugins (0.10.11-2 -> 0.10.11-3)
    [2009-04-12 13:56] upgraded hdparm (9.12-1 -> 9.14-1)
    [2009-04-12 13:56] upgraded iptables (1.4.2-1 -> 1.4.3.1-1)
    [2009-04-12 13:56] upgraded kbproto (1.0.3-1 -> 1.0.3-2)
    [2009-04-12 13:57] upgraded kdelibs (4.2.2-3 -> 4.2.2-4)
    [2009-04-12 13:57] upgraded kernel26-firmware (2.6.28-1 -> 2.6.29-1)
    [2009-04-12 13:59] >>> Updating module dependencies. Please wait ...
    [2009-04-12 13:59] >>> MKINITCPIO SETUP
    [2009-04-12 13:59] >>> ----------------
    [2009-04-12 13:59] >>> If you use LVM2, Encrypted root or software RAID,
    [2009-04-12 13:59] >>> Ensure you enable support in /etc/mkinitcpio.conf .
    [2009-04-12 13:59] >>> More information about mkinitcpio setup can be found here:
    [2009-04-12 13:59] >>> http://wiki.archlinux.org/index.php/Mkinitcpio
    [2009-04-12 13:59]
    [2009-04-12 13:59] >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    [2009-04-12 13:59] ==> Building image "default"
    [2009-04-12 13:59] ==> Running command: /sbin/mkinitcpio -k 2.6.29-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
    [2009-04-12 13:59] :: Begin dry run
    [2009-04-12 13:59] :: Parsing hook [base]
    [2009-04-12 13:59] :: Parsing hook [udev]
    [2009-04-12 13:59] :: Parsing hook [autodetect]
    [2009-04-12 13:59] :: Parsing hook [pata]
    [2009-04-12 13:59] :: Parsing hook [scsi]
    [2009-04-12 13:59] :: Parsing hook [sata]
    [2009-04-12 13:59] :: Parsing hook [usbinput]
    [2009-04-12 13:59] :: Parsing hook [keymap]
    [2009-04-12 13:59] :: Parsing hook [filesystems]
    [2009-04-12 13:59] :: Generating module dependencies
    [2009-04-12 13:59] :: Generating image '/boot/kernel26.img'...SUCCESS
    [2009-04-12 13:59] ==> SUCCESS
    [2009-04-12 13:59] ==> Building image "fallback"
    [2009-04-12 13:59] ==> Running command: /sbin/mkinitcpio -k 2.6.29-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26-fallback.img -S autodetect
    [2009-04-12 13:59] :: Begin dry run
    [2009-04-12 13:59] :: Parsing hook [base]
    [2009-04-12 13:59] :: Parsing hook [udev]
    [2009-04-12 13:59] :: Parsing hook [pata]
    [2009-04-12 13:59] :: Parsing hook [scsi]
    [2009-04-12 13:59] :: Parsing hook [sata]
    [2009-04-12 13:59] :: Parsing hook [usbinput]
    [2009-04-12 13:59] :: Parsing hook [keymap]
    [2009-04-12 13:59] :: Parsing hook [filesystems]
    [2009-04-12 13:59] :: Generating module dependencies
    [2009-04-12 14:00] :: Generating image '/boot/kernel26-fallback.img'...SUCCESS
    [2009-04-12 14:00] ==> SUCCESS
    [2009-04-12 14:00] upgraded kernel26 (2.6.28.8-1 -> 2.6.29.1-3)
    [2009-04-12 14:00] upgraded klibc-udev (140-1 -> 141-1)
    [2009-04-12 14:00] upgraded libavc1394 (0.5.3-1 -> 0.5.3-2)
    [2009-04-12 14:00] upgraded libcddb (1.3.0-3 -> 1.3.2-1)
    [2009-04-12 14:00] upgraded libdatrie (0.1.2-1 -> 0.2.1-1)
    [2009-04-12 14:00] upgraded libdrm (2.3.1-3 -> 2.4.9-1)
    [2009-04-12 14:00] upgraded libdvdread (0.9.7-1 -> 0.9.7-2)
    [2009-04-12 14:00] upgraded libfontenc (1.0.4-1 -> 1.0.4-2)
    [2009-04-12 14:00] upgraded libid3tag (0.15.1b-2 -> 0.15.1b-3)
    [2009-04-12 14:00] upgraded libmatroska (0.8.1-1 -> 0.8.1-2)
    [2009-04-12 14:00] upgraded libmpd (0.16.1-1 -> 0.18.0-1)
    [2009-04-12 14:00] upgraded libmysqlclient (5.0.77-1 -> 5.1.33-1)
    [2009-04-12 14:00] upgraded libogg (1.1.3-1 -> 1.1.3-2)
    [2009-04-12 14:00] upgraded libsamplerate (0.1.6-1 -> 0.1.7-1)
    [2009-04-12 14:00] upgraded libthai (0.1.9-1 -> 0.1.11-1)
    [2009-04-12 14:00] upgraded libx11 (1.2-1 -> 1.2.1-1)
    [2009-04-12 14:00] installed libftdi (0.15-1)
    [2009-04-12 14:00] upgraded lirc-utils (0.8.4-1 -> 0.8.5pre2-1)
    [2009-04-12 14:00] upgraded m4 (1.4.12-1 -> 1.4.13-1)
    [2009-04-12 14:00] upgraded man-db (2.5.4-2 -> 2.5.5-1)
    [2009-04-12 14:00] upgraded man-pages (3.19-1 -> 3.20-1)
    [2009-04-12 14:00] upgraded nvidia-utils (180.29-3 -> 180.44-1)
    [2009-04-12 14:00] installed dri2proto (1.99.3-1)
    [2009-04-12 14:01] upgraded mesa (7.2-1 -> 7.4-1)
    [2009-04-12 14:01] upgraded mpfr (2.3.2-2 -> 2.4.1-1)
    [2009-04-12 14:01] upgraded mpg123 (1.7.1-4 -> 1.7.2-1)
    [2009-04-12 14:01] upgraded mysql-clients (5.0.77-1 -> 5.1.33-1)
    [2009-04-12 14:01] upgraded mysql (5.0.77-3 -> 5.1.33-1)
    [2009-04-12 14:01] upgraded mysql-gui-tools (5.0r12-3 -> 5.0r14-1)
    [2009-04-12 14:01] In order to use the new nvidia module, exit Xserver and unload it manually.
    [2009-04-12 14:01] upgraded nvidia (180.29-3 -> 180.44-1)
    [2009-04-12 14:01] warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
    [2009-04-12 14:01] upgraded pacman-mirrorlist (20090108-1 -> 20090405-1)
    [2009-04-12 14:01] upgraded pango (1.24.0-1 -> 1.24.0-2)
    [2009-04-12 14:01] upgraded php (5.2.9-2 -> 5.2.9-3)
    [2009-04-12 14:01] upgraded pm-utils (1.2.4-3 -> 1.2.5-1)
    [2009-04-12 14:01] installed perl-xyne-common (0.01-5)
    [2009-04-12 14:01] installed perl-html-tagset (3.20-1)
    [2009-04-12 14:01] installed perl-html-parser (3.60-1)
    [2009-04-12 14:01] installed perl-libwww (5.825-1)
    [2009-04-12 14:01] installed perl-xyne-arch (0.03-5)
    [2009-04-12 14:01] ######################
    [2009-04-12 14:01] ## IMPORTANT NOTICE ##
    [2009-04-12 14:01] ######################
    [2009-04-12 14:01] Powerpill options and configuration file syntax have changed with
    [2009-04-12 14:01] version 16.0. Please remove old configuration files and use the
    [2009-04-12 14:01] default configuration file at /etc/powerpill.conf as a template for new
    [2009-04-12 14:01] ones. Please see the man page for information on the command-line options.
    [2009-04-12 14:01] upgraded powerpill (15.12-1 -> 16.0-5)
    [2009-04-12 14:01] upgraded python-numpy (1.2.1-4 -> 1.3.0-1)
    [2009-04-12 14:02] upgraded qt (4.5.0-3 -> 4.5.0-4)
    [2009-04-12 14:02] upgraded qt3 (3.3.8-9 -> 3.3.8-10)
    [2009-04-12 14:02] upgraded redland (1.0.8-1 -> 1.0.8-3)
    [2009-04-12 14:02] upgraded tdb (3.3.1-1 -> 3.3.3-1)
    [2009-04-12 14:02] upgraded smbclient (3.3.1-1 -> 3.3.3-1)
    [2009-04-12 14:02] upgraded subversion (1.6.0-2 -> 1.6.1-2)
    [2009-04-12 14:02] upgraded syslog-ng (3.0.1-4 -> 3.0.1-6)
    [2009-04-12 14:02] upgraded tzdata (2009d-1 -> 2009e-1)
    [2009-04-12 14:02] upgraded udev (140-2 -> 141-1)
    [2009-04-12 14:02] upgraded xf86-input-keyboard (1.3.2-1 -> 1.3.2-2)
    [2009-04-12 14:02] upgraded xf86-input-mouse (1.3.0-1 -> 1.4.0-2)
    [2009-04-12 14:02] upgraded xf86-video-vesa (2.1.0-1 -> 2.2.0-1)
    [2009-04-12 14:02] upgraded xfce4-mpc-plugin (0.3.3-2 -> 0.3.3-3)
    [2009-04-12 14:02] upgraded xorg-server-utils (7.4-3 -> 7.4-4)
    [2009-04-12 14:02] upgraded xorg-utils (7.4-2 -> 7.4-3)
    Last edited by siaco (2009-04-14 21:42:10)

    I found the error on this. In the current PGKBUILD found in AUR, the patch mysql-gui-tools.chema_change_freeze_bug.patch is no longer applied.
    I downloaded all related files to this package and built it myself now, with some changes to PGKBUILD and the mysql-gui-tools.chema_change_freeze_bug.patch. It works again :-)
    New PGKBUILD:
    # $Id: PKGBUILD,v 1.14 2009/04/12 11:52:45 dsa Exp $
    # Maintainer: Douglas Soares de Andrade <[email protected]>
    # Contributor: Vinay S Shastry <[email protected]>
    pkgname=mysql-gui-tools
    pkgver=5.0r14
    pkgrel=2
    arch=('i686' 'x86_64')
    pkgdesc="Set of programs to manage and interact with a MySQL server."
    url="http://www.mysql.com/products/tools/"
    license=('GPL')
    source=(http://mirrors.uol.com.br/pub/mysql/Downloads/MySQLGUITools/$pkgname-$pkgver.tar.gz
    bad-char.patch
    mysql-gui-tools-sigc_2.1.1_api_fixes.diff
    mysql-gui-tools-5.0_p12-deprecated-gtk+-api.patch
    mysql-gui-tools-gcc43.patch
    mysql-gui-tools.chema_change_freeze_bug.patch)
    depends=('gtkmm' 'gtkhtml' 'libmysqlclient' 'pcre')
    replaces=('mysql-administrator' 'mysql-query-browser')
    conflicts=('mysql-administrator' 'mysql-query-browser')
    provides=('mysql-gui-common' 'mysql-administrator' 'mysql-query-browser')
    makedepends=('pkgconfig' 'lua' 'libxml2' 'libgnomeprint')
    options=('!makeflags')
    build() {
    cd $startdir/src/$pkgname-$pkgver
    # Patch from mysql.com to fix the freeze when selecting a schema
    patch -p1 < ../mysql-gui-tools.chema_change_freeze_bug.patch || return 1
    # Patch to make 5.0r14 compile
    patch -Np1 < $startdir/src/bad-char.patch
    patch -Np1 < $startdir/src/mysql-gui-tools-sigc_2.1.1_api_fixes.diff
    patch -Np1 < $startdir/src/mysql-gui-tools-gcc43.patch
    patch -Np0 < $startdir/src/mysql-gui-tools-5.0_p12-deprecated-gtk+-api.patch
    cd $startdir/src/$pkgname-$pkgver/common
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make || return 1
    make DESTDIR=$startdir/pkg install || return 1
    cd ..
    cp -R common mysql-gui-common
    cd $startdir/src/$pkgname-$pkgver/administrator
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make || return 1
    make DESTDIR=$startdir/pkg install || return 1
    cd $startdir/src/$pkgname-$pkgver/query-browser
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make CFLAGS="${CFLAGS} -D_GNU_SOURCE" || return 1
    make DESTDIR=$startdir/pkg install || return 1
    #cd $startdir/src/$pkgname-$pkgver/mysql-workbench
    #patch -p1 < ../../mysql-gui-tools-5.0_p12-workbench-lua.patch
    #./configure --prefix=/usr --with-gtkhtml=libgtkhtml-3.14 || return 1
    #make || return 1
    #make DESTDIR=$startdir/pkg install
    # Some adjusts to make mysql-workbench run
    #cd $startdir/pkg/usr/bin
    #mv mysql-workbench mysql-wb
    #mv mysql-workbench-bin mysql-wb-bin
    #install -m755 $startdir/src/mysql-workbench.sh mysql-workbench
    #rm -rf $startdir/pkg/usr/lib/
    # Fixed startup scripts
    install -m755 $startdir/mysql-administrator $pkgdir/usr/bin
    install -m755 $startdir/mysql-query-browser $pkgdir/usr/bin
    md5sums=('b8efefbf20b7264c8f3afd34424467d7'
    '4279c75bb5e6c2bfcb16c98817d55b80'
    '4625629385142862cd01d37f814d5e80'
    '33205d45329ab4fa4096b6b298a60b2c'
    '1368384dac87bc0a64adb774ab2e6cbd'
    '2ff840932405f7a6a6863f633a639fe9')
    New mysql-gui-tools.chema_change_freeze_bug.patch: (only changes to paths in file. Don't know if this was really needed, but I belive so.)
    diff -ruN mysql-gui-tools-5.0r11.ORIG/query-browser/source/linux/MQQueryDispatcher.cc mysql-gui-tools-5.0r11/query-browser/source/linux/MQQueryDispatcher.cc
    --- mysql-gui-tools-5.0r11.ORIG/query-browser/source/linux/MQQueryDispatcher.cc 2007-02-21 01:31:19.000000000 +0000
    +++ mysql-gui-tools-5.0r11/query-browser/source/linux/MQQueryDispatcher.cc 2007-11-09 15:31:38.000000000 +0000
    @@ -558,8 +558,8 @@
    Gtk::Main::instance()->run();
    - while(!req->is_complete())
    +// while(!req->is_complete())
    +// ;
    return sps;
    I hope this helps anyone else who needs to fix this!

  • Help with MySQL Form Search

    I've got a db that contains various attributes of particular
    items... very similar to a db of a DVD library, for example...
    Director, Year of Release, comments, release date... etc.
    How do I structure the query in Dreamweaver (CS3) to tell the
    db to return ALL results for a field if it is submitted blank? As
    in, if a user didn't specify a Director, then it should not filter
    by that column and return ALL directors instead?
    In the advanced recordset dialogue I have the variables set
    to submit the run-time values from the form, but I don't know what
    to put in the "Default Value" field...
    I know this should be very simple, but I just can't get it to
    work... I tried %, but that's not doing it. (also, I tried
    searching the forum, but the search function is not working
    properly right now.)
    Any help is appreciated.

    I am completely self-taught to this point... testing the
    fields for content and adjusting the WHERE clause accordingly is a
    bit beyond my level. However, if anyone knows of any good content
    on the web that can help me get it that would be helpful... i just
    need to see a couple examples of this in action in order to
    comprehend it.
    I know that this is (or should be) an incredibly basic
    function of DB query... this shouldn't be THAT hard to find... I've
    googled and come up short...

  • MYSQL Query

    I have a question to a MYSQL query (using PHP) in a site I
    created for a
    client.
    I need to output the sum of one particular column in a table.
    I created
    an "exercise counter" for subscribers to this particular
    page, which is
    supposed to help them keeping track of how much exercise they
    get. So
    each day they add an amount, and it gets added up per week.
    What i need to output is the total amount of exercise of all
    users combined.
    So I just made a query, and go through however many rows
    there are in
    the result and add those up.
    But then I was thinking what if that table grows enourmously
    in size.
    (lets say there will be 100.000 subscribers and they each
    count each week).
    The calculating amount would be quite enormous.
    So then I thought, hey the heck with it, i throw in another
    table which
    just contains the total amount and each time a user adds on
    his count, i
    just do that too...
    Am I walking the long way or is my reasoning somewhat sound?
    Anurag

    Anuragbabaji wrote:
    > Steve wrote:
    >> On Thu, 07 Dec 2006 18:38:20 -0500, Anuragbabaji
    >> <[email protected]> wrote:
    >>
    >>> Am I walking the long way or is my reasoning
    somewhat sound?
    >>
    >> All you need is the SUM function:
    >>
    >>
    http://www.tizag.com/mysqlTutorial/mysqlsum.php
    >
    > looks great... BUT do you think that if the table has a
    zillion rows...
    > do you think the two table solution would be faster...
    >
    > I don't want to have to go back in five years ;)
    would it be sufficient and/or adviseable to simply "index"
    the column?
    anurag

Maybe you are looking for

  • Using Multiple Domain Names to Access Our Portal

    We operate one domain corp.company.com but all internal intranet web servers get  assigned the address inside.ZZZ. The inside.ZZZ is on our IE exclusion list but company.com is not. Adding company.com seems to be a miserable task so we are looking at

  • RAW files from SONY RX100 II not seen by Aperture

    OSX 10.8.5 Sony RX 100 II  Aperture 3.4.5  RAW 4.09 Build 711.2  RAW support 4090 Build 86.2 Mac Pro Mid 2010  2.8 GHz Quad  GB RAM  ATI Radeon HD  Aperture does not recognize RAW files shot with the RX100.  I cannot import files.  This only became a

  • How to disable "Confirm Bounce" warning dialog

    I try to bounce every single piece of junk mail I get, but Mail always puts up a warninng dialog when I do so. How do I turn that warning dialog off? Thanks, Shaun

  • Lenovo G550 DVD writer problem.

    Heya...i'v a Lenovo G550 with Windows XP SP3. The problem here is that the DVD reads all the DVDs but does not write any. It doesnt even give an error for not writing. I have Nero 9 and when i try to burn a DVD with that it shows burn process started

  • When opening a new tab by right click, the current page goes white for a while, why?

    For example i have one tab open i then right click and click open link in new tab. I do this and then the current tab i am one either goes white or shows up a completely different page and this can last up to 1 minute. Is there anything i can do to s