Jump to:

10930 Posts in 2613 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » DB Plumber complex query

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 933 Views
  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    DB Plumber complex query Link to this post

    Hi,

    I have a complex query that I place into the SQL section and I get the result "no error", but no results... can DB Plumber take SQL like the following:

    SELECT bi.ID,bi.Quantity,bi.Cost, BookingItemGroupID,abi.ActivityID,a.Name,abi.ScheduleID,s.StartDate,s.StartTime
    FROM BookingItem bi, CourseBookingItem abi ,Activity a,Schedule s
    WHERE bi.ClassName = 'CourseBookingItem' AND bi.ID = abi.ID AND a.ID = abi.ActivityID AND s.ID = abi.ScheduleID
    AND bi.BookingItemGroupID IN (
    SELECT big.ID FROM BookingItemGroup big
    WHERE big.BookingID = (
    SELECT ID FROM Booking WHERE OrderRefNumber = 'EGS200006'
    )
    )
    ORDER BY bi.BookingItemGroupID ASC;

    And if not, what would the limits be?

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: DB Plumber complex query Link to this post

    hi swaiba,

    actually you can feed it any query you like cause it just passes it to the underlying db using your silverstripe db connection.

    "no error" is a db plumber msg saying that your query is ok, it just didn't return any results apparently.

    if you send me a test dump of your data as a pm or post simplified test data here i can have a look. (schema + data)

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: DB Plumber complex query Link to this post

    Oops - this was indeed no data - I'm sorry - may I suggest changing the message to 'no data' or similar to indicate this for people like me

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: DB Plumber complex query Link to this post

    you'r right, done. (r110932)

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: DB Plumber complex query Link to this post

    Many thanks apiening

    933 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.