[Solved] Base SQL not working with MySQL backend
Posted: Fri Jan 17, 2014 8:54 am
Hi,
I'm trying to build a database of student assessment records over a number of years so we can analyse growth over time. I've set up four tables; one for the teachers, one for the students, one to identify a data collection period (i.e. Feb 2013, May 2013 etc) and then the main data storage table which is the data we collect. I've populated each of the tables with some real data by importing from my spreadsheets used in previous years.
I setup MySQL on my Mac laptop and then installed OO 4.01 to use as a frontend, on the basis that I once created some relational databases in MS Office Access and thought it would improve my learning curve - but it hasn't really helped much.
I want to create a main form based on the student data table where I can bring up the data associated with a specific child for a given teacher and datapoint. The PK for the main data table is a composite key based on the student's ID code, teacher's ID code and the appropriate datapoint.
I've spent literally days studying this forum and a heap of other resources on-line to get to the point. Looking at several example databases showed me that I should be able to use a couple of ListBoxes to select the kid, teacher and datapoint I want using actual names from the simple tables rather than the meaningless id codes. So far so good.
I hit my first really big problem trying to concatenate fields to display in the list box. I am able to use a simple select query and insert, say, the teacher's last name into the list box but as soon as I try to use double pipes to join two fields together with an alias, the query just produces a 0 instead of the first_name, last_name combination I want. I've tried simplifying the query by just using the double pipes to add a comma after the first_name but it still produces a 0.
I eventually thought that it could be an incompatibility between the oobase SQL and the MySQL version when I discovered that MySQL uses the syntax CONCATENATE(field1,field2) etc. so I tried using the MySQL code but that just threw an instant error (I think you people refer to that as a parsing error?)
I've searched the forums and the wider web but I can't find any clues so I joined up to the forum and posted this.
Can anyone help?
Incidentally I've also been confused by the way my control properties and SQL strings are different from the ones in the example dbs. Some of my properties seem to have many more boxes, and the SQL strings have additional identifiers in the field names etc. I think it may just be because the examples all have embedded dbs and I'm using an external data source. Can anyone confirm that?
I'm trying to build a database of student assessment records over a number of years so we can analyse growth over time. I've set up four tables; one for the teachers, one for the students, one to identify a data collection period (i.e. Feb 2013, May 2013 etc) and then the main data storage table which is the data we collect. I've populated each of the tables with some real data by importing from my spreadsheets used in previous years.
I setup MySQL on my Mac laptop and then installed OO 4.01 to use as a frontend, on the basis that I once created some relational databases in MS Office Access and thought it would improve my learning curve - but it hasn't really helped much.
I want to create a main form based on the student data table where I can bring up the data associated with a specific child for a given teacher and datapoint. The PK for the main data table is a composite key based on the student's ID code, teacher's ID code and the appropriate datapoint.
I've spent literally days studying this forum and a heap of other resources on-line to get to the point. Looking at several example databases showed me that I should be able to use a couple of ListBoxes to select the kid, teacher and datapoint I want using actual names from the simple tables rather than the meaningless id codes. So far so good.
I hit my first really big problem trying to concatenate fields to display in the list box. I am able to use a simple select query and insert, say, the teacher's last name into the list box but as soon as I try to use double pipes to join two fields together with an alias, the query just produces a 0 instead of the first_name, last_name combination I want. I've tried simplifying the query by just using the double pipes to add a comma after the first_name but it still produces a 0.
I eventually thought that it could be an incompatibility between the oobase SQL and the MySQL version when I discovered that MySQL uses the syntax CONCATENATE(field1,field2) etc. so I tried using the MySQL code but that just threw an instant error (I think you people refer to that as a parsing error?)
I've searched the forums and the wider web but I can't find any clues so I joined up to the forum and posted this.
Can anyone help?
Incidentally I've also been confused by the way my control properties and SQL strings are different from the ones in the example dbs. Some of my properties seem to have many more boxes, and the SQL strings have additional identifiers in the field names etc. I think it may just be because the examples all have embedded dbs and I'm using an external data source. Can anyone confirm that?