PDA

View Full Version : vfp free table import to an existing lianja sql database



naeempk
2015-07-04, 18:31
Hi,

I need to import a free vfp table to one of my lianja sql server database.

Can you guide me how to do this or a web/blog link to do this ?

Regards,
Naeem

barrymavin
2015-07-04, 20:02
Hi Naeem,

Lianja can can open and read vfp tables so you should just need to...

open database your_lianja_database
use full_path_to_vfp_table
copy to table_name
use
dir

the table should now be in your database.

naeempk
2015-07-04, 20:35
Hi Barry,

Thanks. I was trying to use some gui in App builder but did not see any option there. A database import option is there but nothing for a single vfp table.

Is this possible in App builder without using command window ?

For related cdx file creation

Copy to table_name with production

Or

Copy to table_name with cdx

Will both work for cdx file creation?

Regards,
Naeem

naeempk
2015-07-04, 20:41
Hi Barry,

As you said Lianja can read a vfp table directly. I need to run sql statement against it.

Is there any performance advantage in case i import this table to my Lianja DB or the sql execution/performance will be same?

Regards,
Naeem

barrymavin
2015-07-04, 20:51
Hi Naeem,

copy with production

will create the indexes too if you need them.

barrymavin
2015-07-04, 20:53
Hi Naeem,

yes the native format is faster particularly when multiuser and the SQL query optimizer will perform better if you have indexes in columns that you are querying on.

barrymavin
2015-07-04, 20:59
Hi Naeem,

Yes that that will work in a stored procedure or in a .prg script file.

naeempk
2015-07-06, 03:39
Hi Barry,

I use the following code in a prg file to select data from a vfp free table (having a memo field) via Lianja ODBC.


USE c:\temp\shpstkdat SHARED
SELECT * FROM shpstkdat INTO CURSOR cc WHERE code = "10-0-1870"
use in select('shpstkdat')
return setresultset("cc")

The resultset was a data mess via Lianja ODBC. (Kindly see the image.)


I then imported the vfp free table to Lianja database through prg file using ODBC connection. The code is

open database sjadb
use c:\temp\shpstkdat share
copy to shpstkdat with production
close all

My ODBC connection was not responding as VFP went to "not responding" state. I checked my Lianja server and the table was imported there. So I pressed ESC key in my VFP session and it got back normal state.

Then I call sql statement to my newly imported table from Lianja DB via ODBC and result was okey. (Kindly see the image.)

If Lianja can read/write from vfp tables then why Lianja ODBC or setresultset is not returning data correctly ?

Regards,
Naeem

1102

yvonne.milne
2015-07-06, 05:53
I was trying to use some gui in App builder but did not see any option there. A database import option is there but nothing for a single vfp table.

Is this possible in App builder without using command window ?


Hi Naeem,

With an open Lianja database, you can use the Add table or drag 'n' drop in the App Builder Data Workspace, then Deploy for Lianja SQL Server access (http://www.lianja.com/doc/index.php/Deploying_to_Local_Directory).

See the 'Importing Free Tables' section here (http://www.lianja.com/documentation/documentation-index/307-importing-visual-FoxPro-files). The screenshots are from before the databases and tables were put into separate tabs, but it works the same.

1103

Regards,

Yvonne

naeempk
2015-07-06, 06:52
Hi Yvonne,

Thank for for sharing this information.

1) Any reply for my recent post ?

2) Can you share some information about table/cdx size changes after import ? Does Lianja needs more disk sapce than VFP ? see the image for comparison.

Regards,
Naeem

1104

barrymavin
2015-07-06, 07:43
Hi Naeem,

Although lianja can import vfp tables I do not recommend accessing then directly. Also nowhere have I said we support writing to them.

There was a forum post a while back where a developer was asking other developers to sponsor as a group the development that would allow full read/write access including indexes but there was insufficient interest so this functionality was shelved.

barrymavin
2015-07-06, 07:48
Hi Naeem,

Lianja indexes are a completely different format to those of vfp.

They are fully balanced B+ trees that are optimized for good concurrent access so they contain some additional information which is used internally.

Lianja has a 64-bit database engine so file size poses no issue.

Indexes are structured in such a way that the nodes have pointers to their children and parent nodes. Seeing as Lianja handles 64-bit file access v VFP 32-bit file access, the Lianja files will be larger as they accommodate 64-bit pointers.