Sign in Join
Wiki copytemporary

Oracle/ja: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1+---
2+[[Portal:Databases/ja|**データベースのポータル**]]
3+参照: · [[Databases/ja|Databases 概要]] · [[Database libraries/ja|ライブラリ]] · [[Database field type/ja|フィールドの型]] · [[Data Controls tab/ja|コントロール]] · [[Lazarus DB Faq/ja|FAQ]] · [[SqlDBHowto/ja]] · [[Working With TSQLQuery/ja|TSQLQuery の利用]] · [[How to write in-memory database applications in Lazarus/FPC/ja|メモリ上で動作するデータベースの作り方]] · チュートリアル/練習となる記事: · [[Lazarus Database Overview/ja|概要]] · [[SQLdb Tutorial0/ja|0 - データベースのセットアップ]] · [[SQLdb Tutorial1/ja|1 - 開始]] · [[SQLdb Tutorial2/ja|2 - 編集]] · [[SQLdb Tutorial3/ja|3 - クエリ]] · [[SQLdb Tutorial4/ja|4 - データモジュール]] · [[SQLdb Programming Reference/ja]] · 各種データベース · [[Advantage Database Server/ja|Advantage]] \- [[MySQLDatabases/ja|MySQL]] \- [[mssqlconn/ja|MSSQL]] \- [[postgres/ja|Postgres]] \- [[Firebird/ja|Interbase]] \- [[Firebird/ja|Firebird]] \- Oracle \- [[ODBCConn/ja|ODBC]] \- [[TParadox/ja|Paradox]] \- [[SQLite/ja|SQLite]] \- [[Lazarus Tdbf Tutorial/ja|dBASE]] \- [[MS Access/ja|MS Access]] \- [[Zeos tutorial/ja|Zeos]]
4+
5+
16## 低階層 Oracle サーバインタフェース
27
3-The low level Oracle server interface exists of one unit, **oraoci**, which is a straight translation of the Oracle interface header files.
8+低階層のOracleサーバインタフェースは**oraoci** という1つのユニットに存在し、それはOracleインタフェースヘッダファイルの直訳である。
49
5-There are 2 example programs:
10+2つのプログラム例がある:
611
7-- **oraclew** contains some utility routines for the oracle interface, for easier management of result sets. Needs the classes unit from the FCL.
8-- **test01** a simple test program to demonstrate the interface.
12+ * **oraclew** は結果セットのより簡便な取り扱いに向けた、Oracleインタフェースのためのいくつかのユーティリティルーチンを含む。FCLからのクラスユニットを必要とする。
13+ * **test01** はこのインタフェースのデモのための簡単なテストプログラムである。
914
1015## Oracle へ直接接続
1116
12-You can directly connect Lazarus and Oracle by using Oracle Data Access Components (ODAC). It is a library of components that provides native connectivity to Oracle from Lazarus (and Free Pascal) on Windows, Mac OS X, iOS, Android, Linux, and FreeBSD for both 32-bit and 64-bit platforms. The ODAC library is designed to help programmers develop faster and more native Oracle database applications.
17+Oracle Data Access Component(ODAC)を用いてLazarusとOracleを直接接続することができる。
1318
19+それはWindows、Mac OS X、Android、Linux、FreeBSDの32-bit、64-bitプラットフォーム双方のためにLazarus(およびFree Pascal)からOracleにネイティブな接続性を提供するコンポーネントのライブラリである。 ODACライブラリはプログラマにより迅速で、ネイティブなOracleデータベースアプリケーションを開発するために設計されている。
20+
21+
22+
1423## Oracle へのOOPアクセス
1524
16-Built over the low-level interface, the SQLDB framework supplied with FPC supports accessing Oracle (using TOracleConnection); see also [[Lazarus Database Overview|Lazarus_Database_Overview#Lazarus_and_Oracle]]
25+低レベルインタフェース上で構築され、SQLDBフレームワークはFPCに(TOracleConnectionを用いて)Oracleへのアクセスを提供する。以下も参照のこと [[Lazarus Database Overview|Lazarus_Database_Overview#Lazarus_and_Oracle]]
1726
18-Lazarus also has a component: [[TOracleConnection]]
27+Lazarusはまたコンポーネント: [[TOracleConnection]] を持つ。
1928
20-- Hostname: as with other sqldb connectors, use hostname or IP address. Leave empty if you use a TNSNAMES.ORA net service name in DatabaseName
21-- Username/password: same as with other sqldb connectors
22-- DatabaseName:
23- - instance/SID of the Oracle server you want to connect to **or**
24- - net service name in a TNSNAMES.ORA file
29+ * Hostname: 他のSQLDBコネクタ同様、ホスト名やIPアドレスを用いる。もし、DatabaseNameにTNSNAMES.ORAネットサービス名を使う場合は空にしておく
30+ * Username/password: 他のSQLDBコネクタ同様である
31+ * DatabaseName:
32+ * 接続したいOracleサーバのインスタンス/SID **または**
33+ * TNSNAMES.ORA ファイルのネットサービス名
2534
26-> **Note:** Released FPC/Lazarus x64 versions on Windows do not include an Oracle connector. If you enable it and test successfully, please submit a patch with the changes so it can be included
35+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** WindowsでリリースされているFPC/Lazarus x64バージョンはOracleコネクタを含んでいない。もしこれを有効にしたいのであれば、パッチを送られたい。そうすれば付属することになる
2736
2837## トラブルシューティング
2938
3039### クライアントとサーバのキャラクタセット
3140
32-To get info about what character set/NLS settings are active, you can run the following program.
33-
34-Please don't forget to fill out correct server name, username, password and database name before compiling.
41+どのキャラクタセット/NLS設定が有効か知るために、以下のプログラムを実行することができる。
3542
36-``` pascal
43+コンパイルの前に正しいサーバ名、ユーザー名、パスワード、データベース名が含まれているか忘れないでほしい。
44+```
3745program oracharset;
38-
39-{ Shows client and server character set/NLS info}
40-{ PLEASE EDIT PASSWORDS ETC BELOW. }
41-
42-{$mode objfpc}{$H+}
43-
44-uses {$IFDEF UNIX} {$IFDEF UseCThreads}
45- cthreads, {$ENDIF} {$ENDIF}
46- Classes,
47- SysUtils,
48- sqldb,
49- oracleconnection;
50-
51-var
52- Col: integer;
53- Conn: TOracleConnection;
54- Tran: TSQLTransaction;
55- Q: TSQLQuery;
56-begin
57- Conn := TOracleConnection.Create(nil);
58- Tran := TSQLTransaction.Create(nil);
59- Q := TSQLQuery.Create(nil);
60- try
61- // * EDIT IDENTIFYING INFO AS NEEDED*
62- Conn.HostName := '';
63- Conn.UserName := 'system';
64- Conn.Password := '';
65- Conn.DatabaseName := 'XE';
66- // *END IDENTIFIYING INFO*
67- Conn.Transaction := Tran;
68- Q.DataBase := Conn;
69- Conn.Open;
70- Tran.Active := true;
71-
72- writeln('Server character set info:');
73- Q.SQL.Text := 'SELECT value$ FROM sys.props$ WHERE name like ''NLS_%'' ';
74- Q.Open;
75- Q.First;
76- while not (Q.EOF) do
46+
47+ { クライアントとサーバの文字集合/NSL情報を表示する}
48+ { 以下のパスワードなどは適宜設定されたい。 }
49+
50+ {$mode objfpc}{$H+}
51+
52+ uses {$IFDEF UNIX} {$IFDEF UseCThreads}
53+ cthreads, {$ENDIF} {$ENDIF}
54+ Classes,
55+ SysUtils,
56+ sqldb,
57+ oracleconnection;
58+
59+ var
60+ Col: integer;
61+ Conn: TOracleConnection;
62+ Tran: TSQLTransaction;
63+ Q: TSQLQuery;
7764 begin
78- writeln('*****************');
79- for Col := 0 to Q.Fields.Count - 1 do
80- begin
81- try
82- writeln(Q.Fields[Col].DisplayLabel + ':');
83- writeln(Q.Fields[Col].AsString);
84- except
85- writeln('Error retrieving field ', Col);
65+ Conn := TOracleConnection.Create(nil);
66+ Tran := TSQLTransaction.Create(nil);
67+ Q := TSQLQuery.Create(nil);
68+ try
69+ // * 識別情報が必要であれば編集する*
70+ Conn.HostName := '';
71+ Conn.UserName := 'system';
72+ Conn.Password := '';
73+ Conn.DatabaseName := 'XE';
74+ // * 識別情報の終わり*
75+ Conn.Transaction := Tran;
76+ Q.DataBase := Conn;
77+ Conn.Open;
78+ Tran.Active := true;
79+
80+ writeln('Server character set info:');
81+ Q.SQL.Text := 'SELECT value$ FROM sys.props$ WHERE name like ''NLS_%'' ';
82+ Q.Open;
83+ Q.First;
84+ while not (Q.EOF) do
85+ begin
86+ writeln('*****************');
87+ for Col := 0 to Q.Fields.Count - 1 do
88+ begin
89+ try
90+ writeln(Q.Fields[Col].DisplayLabel + ':');
91+ writeln(Q.Fields[Col].AsString);
92+ except
93+ writeln('Error retrieving field ', Col);
94+ end;
95+ end;
96+ Q.Next;
8697 end;
87- end;
88- Q.Next;
89- end;
90- Q.Close;
91-
92- writeln('');
93- writeln('Client character set info:');
94- Q.SQL.Text := 'SELECT * FROM NLS_SESSION_PARAMETERS ';
95- Q.Open;
96- Q.First;
97- while not (Q.EOF) do
98- begin
99- writeln('*****************');
100- for Col := 0 to Q.Fields.Count - 1 do
101- begin
102- try
103- writeln(Q.Fields[Col].DisplayLabel + ':');
104- writeln(Q.Fields[Col].AsString);
105- except
106- writeln('Error retrieving field ', Col);
98+ Q.Close;
99+
100+ writeln('');
101+ writeln('Client character set info:');
102+ Q.SQL.Text := 'SELECT * FROM NLS_SESSION_PARAMETERS ';
103+ Q.Open;
104+ Q.First;
105+ while not (Q.EOF) do
106+ begin
107+ writeln('*****************');
108+ for Col := 0 to Q.Fields.Count - 1 do
109+ begin
110+ try
111+ writeln(Q.Fields[Col].DisplayLabel + ':');
112+ writeln(Q.Fields[Col].AsString);
113+ except
114+ writeln('Error retrieving field ', Col);
115+ end;
116+ end;
117+ Q.Next;
107118 end;
119+ Q.Close;
120+ // *バグテストコード例の終わり*
121+ Conn.Close;
122+ finally
123+ Q.Free;
124+ Tran.Free;
125+ Conn.Free;
108126 end;
109- Q.Next;
110- end;
111- Q.Close;
112- // *END EXAMPLE BUG TESTING CODE*
113- Conn.Close;
114- finally
115- Q.Free;
116- Tran.Free;
117- Conn.Free;
118- end;
119- writeln('Program complete. Press a key to continue.');
120- readln;
121-end.
127+ writeln('Program complete. Press a key to continue.');
128+ readln;
129+ end.
122130```
123131
124132### ORA-00911 : invalid character
125133
126-If you see this error message, you might want to try
134+もしこのエラーメッセージが出たら、以下を試すことができる
127135
128-- removing a trailing semicolon - ; - if you have it in a SELECT statement
129-- adding a trailing semicolon (e.g. in CALL or EXECUTE statements)
136+ * もしSELECT文でセミコロンが用いられている場合は取り除いてみる
137+ * 末尾にセミコロンを加えてみる (例えば CALL や EXECUTE文で)
130138
131-See this thread which applies to .Net but may apply to SQLDB as well: [1](http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/58a27505-a3fb-4cb1-9063-3946b3f26acd)
139+.NETでどれを用いるかこのスレッドを参照されたい。SQLDBでも当てはまるかもしれない: [[1]](<http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/58a27505-a3fb-4cb1-9063-3946b3f26acd>)
132140
133141Go back to [[Packages List]]
134142
135143---
136-*From the Free Pascal wiki, page "Oracle/ja", as it stood on 2024-03-26 after a change by Ariben, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
144+*From the Free Pascal wiki, page "Oracle/ja", as the Internet Archive kept it on 2025-01-17, last changed on 2024-09-22. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history