Interesting! And processing any updates? Is that a manual task at the vfp generating spt ?
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 26 January 2018 15:56 To: profoxtech@leafe.com Subject: Re: MariaDB
I would avoid VFP remote views myself.
As a data administrator, I can create views and give them to specific users any only THEY can access that data. HR tables come to mind first as why do that.
As a heads up views just pre-join tables to deliver an easy to use dataset. If you are going to add a where clause in your code, in reality, the view is NOT using an index to do the work for you. You are doing a table scan on the resultant data set to produce your refined, cleaner, dataset that is passed back to you.
If you make a stored procedure you have the ability to pass in parameters that the code will use and that my allow an index scan or an index seek getting you your data very quickly.
create view AllTheDamnStock as select * from Stock
create procedure SomeOfTheDamnStock -- Add the parameters for the stored procedure here @StockType varchar(50) = NULL -- NULL default value as if @StockType is NULL begin -- No param was passed Select * from Stock end else begin -- Param was passed Select * from Stock where StockType=@StockType end
On Thu, Jan 25, 2018 at 4:20 PM, Chris Davis chrisd@actongate.co.uk wrote:
Well there is no code as such
The connection in the DBC has the following connection string
DRIVER={MariaDB ODBC 3.0 Driver};UID=root;PWD=xxx;DESCRIPTION={MariaDB via ODBC};SERVER=localhost;DATABASE=mydb;PORT=3306;
The mydb database has one table called stock.
When I create a remote view and select the connection it correctly offers me "stock" as a table I can add to the view but then crashes with that error saying table root.stock does not exist.
If I do some code i.e.
lnConnection=sqlconnect("myconnection")
sqlexec(lnConnection,"select * from stock")
that works fine and retrieves the records without error.
So my question is why won't it work with the remote view designer?
I have done exactly the same in the past with MySQL without issue.
I have tried both v2 and v3 of the ODBC drivers from the MariaDB site.
If there is anything else you can think of that I can provide to help I will.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Thursday, 25 January 2018 22:12 To: profoxtech@leafe.com Subject: Re: MariaDB
Can you give us the code?
I don't do Marina but you may be in the wrong database on the server as a guess. I know people long ago were connecting and being in Master database thinking they were in their own db.
This is a part of the connection string.
On Thu, Jan 25, 2018 at 3:15 PM, Chris Davis chrisd@actongate.co.uk wrote:
I guess just for ease when designing forms etc and having the view on the data environment , also interested in why it just doesn't work
My table is called stock and I get the error saying root.stock doesn't exist!
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Thursday, 25 January 2018 21:11 To: profoxtech@leafe.com Subject: Re: MariaDB
Make the views on the actual database. From there you can call them.
One question is why use a view instead of a stored procedure?
On Thu, Jan 25, 2018 at 3:01 PM, Chris Davis chrisd@actongate.co.uk wrote:
Hi All
Just wondered if anyone out there is using MariaDB as a back end but using remote views in a DBC with it?
I have a server working, a database and table created ... I can do "select
- from mytable" using sqlexec but I can't create a remote view
with the same table on.
Any help you could give would be appreciated.
Thanks
Chris.
__ __ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com __________________________________________________________________ __ __
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]