Welcome! Log In Create A New Profile

Advanced

Loading Oracle Database using WebDev Oracle Native Access

Posted by Mitchell 
Dear coders,
Can somebody advise me how to load the Oracle Database 9.2.0 using native access in RUNTIME? what commands or syntax i have to use to load the database by reading the tnsnames.ora file?

advise please

mitch
G_USERBD="sys"
G_PASSWORDBD="password"
G_MAQUINA="MACHINE/INSTANCE"
G_FICH="INSTANCE"


HDescribeConnection
("conn_ora",G_USERBD,G_PASSWORDBD,G_MAQUINA,G_FICH,hNativeAccessOracle,hOReadWrite,"WD Connection Timeout = 300; WD Command Timeout=300")

HOpenConnection("conn_ora")

HChangeConnection("*","conn_ora")
Hello Paolo,
thanks for the try, when i code it, it doesn't work with my requirements. My requirements is to load the ORACLE DATABASE without loading it on the analysis or without making or defined in analysis..My analysis is empty.
my question is , how to load the oracle database using nativeaccess oracle without defining it on the analysis, I want to load the database called "USERS" from oracle database into the Table of my form. how to code this?

thanks again
mitch
Hi Mitchel,

I don't understand what you mean by 'loading'.
The code Paolo wrote is to connect to a Oracle Dbase. About the same way I connect to it.
If that is not the problem, and you only want to know how to read data from Oracle without a 'Analyse' described, then take a look in the manual at sqlExec(), sqlFirst(), etc.
Come back if you read those and you'd still have questions.

Anyway, if you're used to Hread, HModify etc... forget the 'No-Analyse' option ! If you don't know SQL, and you don't want to learn it, the analyse is obligated.

Leo.
Ok without analyse (I supose that USERS is one table in the ORACLE db).

G_USERBD="sys"
G_PASSWORDBD="password"
G_MAQUINA="MACHINE/INSTANCE"
G_FICH="INSTANCE"


HDescribeConnection
("conn_ora",G_USERBD,G_PASSWORDBD,G_MAQUINA,G_FICH,hNativeAccessOracle,hOReadWrite,"WD Connection Timeout = 300; WD Command Timeout=300")

HOpenConnection("conn_ora")

wora_table is Data Source
HDeclareExternal("USERS",wora_table,"conn_ora")

and after this you can use wora_table as any other file in your project.

If you only use SQL* instructions or HEXECUTESQLQUERY(hQueryWithoutCorrection)
you don't need the hdeclarexternal, if you use HREAD* you need the to declare the oracle table.

-You do not have to 'hOpenConnection' if you only need SQL
-You do not need to HDeclareExternal anything.

just
SQLConnect(DataBase,USER,PASSWORD,"","ORACLE")
and send your queries!


Suppose your USER tabel has a USNAME and a USPASSW and the table on your form 'MyTable' has the same columns

sqlText is string = " SELECT USNAME, USPASSW FROM USER "

sqlExec(sqlText,"qry1")

WHILE sqlFetch("qry1") = 0
TableAdd(MyTable,sqlGetCol("qry1",1),sqlGetCol("qry1",2))
END

sqlClose("qry1")

TableDisplay(MyTable,taStart)

th th th that's all folks.
(remember .. develop 10 times faster !!)
i think this thread is close. Thanks a lot guys..it is working now.

thanks for the help.

regards
mitch
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: