Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 9 Jahren, 11 Monaten
Letzter Beitrag:
vor 9 Jahren, 11 Monaten
Beteiligte Autoren:
Mitchell, Leo, Paulo Oliveira

Loading Oracle Database using WebDev Oracle Native Access

Startbeitrag von Mitchell am 04.06.2008 13:22

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

Antworten:

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")

von Paulo Oliveira - am 05.06.2008 11:51
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

von Mitchell - am 05.06.2008 16:31
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.

von Leo - am 06.06.2008 07:03
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.



von Paulo Oliveira - am 06.06.2008 09:23
-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 !!)


von Leo - am 06.06.2008 12:00
i think this thread is close. Thanks a lot guys..it is working now.

thanks for the help.

regards
mitch

von Mitchell - am 06.06.2008 15:22
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.