Has anyone called the unix datadirect odbc from progress code.
Progress v11.4 datadirect odbc SQL native driver.
I can use the supplied tool to access the SQL database, but I now need to call the odbc from progress, and cannot find any where in the manual how to do this. The samples are all in c.
Can anyone point me to a reference or has some sample code they can share.
Hi Clive, you initially posted your question into our DataDirect Cloud forum but as your questions refers to the OE ODBC driver I moved your post in our OE forum.
If you want to access a Microsoft SQL database using 4GL code then using a dataserver to access the Microsoft SQL database would probably be the way to go. The MS SQL permissions needed are described in knowledgebase.progress.com/.../000050107
More information about the MS SQL dataserver product can be found here:
Once configured the dataserver will then make the conversions between the OpenEdge 4GL queries to the MS SQL queries and then convert the MS SQL result sets into an OpenEdge format.
Tinco van Engen
You can look at the SQL Dataserver product which allows you to write normal ABL against a MSSQL database.
If you just want to use ODBC, you can use the sample and approach at this page: community.progress.com/.../2179.integrating-datadirect-cloud-and-progress-easyl-into-openedge-using-the-odbc-bridge-sample-applications.aspx .
You will need to modify src\OpenEdge\Data\ODBC\DriverManagerLib.i to point to the ODBC .so and will need to recompile the ABL, but after that it /should/ work.
Flag this post as spam/abuse.
For *nix you're left only with C and shared libraries, this should work if you make some kind of data access library that will use the ms$sql odbc libraries and wrap those samples you have in something along the lines of:
procedure sqlSelect external 'odbc_sql.so':
define input parameter sqlStatement as character.
define return parameter resultSet as long.
procedure freeResult external 'odbc_sql.so':
define input parameter resultSet as long.
define variable pResultSet as int64.
define variable memResult as memptr.
run sqlSelect("select * from customer", output resultSet).
/* get result set data from memory, json/xml your own serialization */
set-pointer-value(memResult) = resultSet.
/* don't forget to free the memory allocated by library */
or maybe you get mono to work with a .net wrapper but guess that this is still not supported by PSC.
Wow, kudos for that Peter... definitively more than just a sample there ;)
Peter is right, updating the odbc library location in that definition file should give you a working solution... the only drawback on using directly the odbc library from 4gl is you'll end up doing a lot of calls that will kinda ruin the performance even if external procedures are defined as persistent.
Writing a small wrapper around odbc that will pack the result set: definition and data (either read-complete or row-by-row using a cursor) will greatly reduce the number of calls and if native progress temp-table serialization is used will be even better.