Changeset 115
- Timestamp:
- 11/22/09 17:28:01 (3 years ago)
- Files:
-
- trunk/bbconv/bbcode.d (modified) (3 diffs)
- trunk/bbconv/bbconv.d (modified) (15 diffs)
- trunk/bbconv/dbi/DBIException.d (modified) (4 diffs)
- trunk/bbconv/dbi/Database.d (modified) (6 diffs)
- trunk/bbconv/dbi/ErrorCode.d (modified) (1 diff)
- trunk/bbconv/dbi/Metadata.d (added)
- trunk/bbconv/dbi/PreparedStatement.d (added)
- trunk/bbconv/dbi/Registry.d (added)
- trunk/bbconv/dbi/Result.d (modified) (1 diff)
- trunk/bbconv/dbi/Row.d (modified) (4 diffs)
- trunk/bbconv/dbi/SqlGen.d (added)
- trunk/bbconv/dbi/Statement.d (modified) (10 diffs)
- trunk/bbconv/dbi/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/ib/IbDatabase.d (modified) (3 diffs)
- trunk/bbconv/dbi/ib/IbResult.d (modified) (3 diffs)
- trunk/bbconv/dbi/ib/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/ib/imp.d (modified) (6 diffs)
- trunk/bbconv/dbi/msql/MsqlDatabase.d (modified) (3 diffs)
- trunk/bbconv/dbi/msql/MsqlResult.d (modified) (3 diffs)
- trunk/bbconv/dbi/msql/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/msql/imp.d (modified) (2 diffs)
- trunk/bbconv/dbi/mssql (added)
- trunk/bbconv/dbi/mssql/MssqlDatabase.d (added)
- trunk/bbconv/dbi/mssql/MssqlDate.d (added)
- trunk/bbconv/dbi/mssql/MssqlResult.d (added)
- trunk/bbconv/dbi/mssql/all.d (added)
- trunk/bbconv/dbi/mssql/imp.d (added)
- trunk/bbconv/dbi/mysql/MysqlDatabase.d (modified) (9 diffs)
- trunk/bbconv/dbi/mysql/MysqlError.d (modified) (2 diffs)
- trunk/bbconv/dbi/mysql/MysqlPreparedStatement.d (added)
- trunk/bbconv/dbi/mysql/MysqlResult.d (modified) (2 diffs)
- trunk/bbconv/dbi/mysql/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/mysql/imp.d (modified) (15 diffs)
- trunk/bbconv/dbi/mysql/imp_win.d (added)
- trunk/bbconv/dbi/odbc/OdbcDatabase.d (modified) (18 diffs)
- trunk/bbconv/dbi/odbc/OdbcResult.d (modified) (8 diffs)
- trunk/bbconv/dbi/odbc/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/oracle/OracleDatabase.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/OracleResult.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/oracle/imp/nzerror.d (modified) (5 diffs)
- trunk/bbconv/dbi/oracle/imp/nzt.d (modified) (33 diffs)
- trunk/bbconv/dbi/oracle/imp/oci.d (modified) (10 diffs)
- trunk/bbconv/dbi/oracle/imp/oci1.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/oci8dp.d (modified) (4 diffs)
- trunk/bbconv/dbi/oracle/imp/ociap.d (modified) (316 diffs)
- trunk/bbconv/dbi/oracle/imp/ociapr.d (modified) (30 diffs)
- trunk/bbconv/dbi/oracle/imp/ocidef.d (modified) (26 diffs)
- trunk/bbconv/dbi/oracle/imp/ocidem.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/ocidfn.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/ociextp.d (modified) (7 diffs)
- trunk/bbconv/dbi/oracle/imp/ocikpr.d (modified) (2 diffs)
- trunk/bbconv/dbi/oracle/imp/ocixmldb.d (modified) (4 diffs)
- trunk/bbconv/dbi/oracle/imp/odci.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/oratypes.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/ori.d (modified) (64 diffs)
- trunk/bbconv/dbi/oracle/imp/orid.d (modified) (3 diffs)
- trunk/bbconv/dbi/oracle/imp/orl.d (modified) (28 diffs)
- trunk/bbconv/dbi/oracle/imp/oro.d (modified) (5 diffs)
- trunk/bbconv/dbi/oracle/imp/ort.d (modified) (101 diffs)
- trunk/bbconv/dbi/oracle/imp/xa.d (modified) (4 diffs)
- trunk/bbconv/dbi/pg/PgDatabase.d (modified) (11 diffs)
- trunk/bbconv/dbi/pg/PgError.d (modified) (2 diffs)
- trunk/bbconv/dbi/pg/PgResult.d (modified) (5 diffs)
- trunk/bbconv/dbi/pg/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/pg/imp.d (modified) (9 diffs)
- trunk/bbconv/dbi/sqlite/SqliteDatabase.d (modified) (15 diffs)
- trunk/bbconv/dbi/sqlite/SqliteError.d (modified) (2 diffs)
- trunk/bbconv/dbi/sqlite/SqliteResult.d (modified) (2 diffs)
- trunk/bbconv/dbi/sqlite/all.d (modified) (2 diffs)
- trunk/bbconv/dbi/sqlite/imp.d (modified) (7 diffs)
- trunk/bbconv/ini.bnf (modified) (2 diffs)
- trunk/bbconv/ini.d (modified) (14 diffs)
- trunk/bbconv/parser.bnf (modified) (2 diffs)
- trunk/bbconv/parser.d (modified) (38 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bbconv/bbcode.d
r29 r115 1 1 module bbcode; 2 2 3 import std.conv; 4 import std.utf; 5 import std.stdio; 3 import tango.io.Stdout; 4 import tango.util.Convert; 6 5 import enki.types; 7 import en tity;6 import enki.library.d.CharEntity; 8 7 9 8 char[] Latin1ToUTF8(char[] value){ … … 18 17 result ~= 0x80 | (ch & 0x3F); 19 18 20 debug writefln("converted: %0.2X to %0.2X %0.2X",ch, result[$-2], result[$-1]);19 debug Stdout.formatln("converted: {:X2} to {:X2} {:X2}",ch, result[$-2], result[$-1]); 21 20 } 22 21 } … … 43 42 44 43 entity = entity[1..$]; 45 dchar value = cast(dchar)to Uint(entity);46 result ~= to UTF8((&value)[0..1]);44 dchar value = cast(dchar)to!(uint)(entity); 45 result ~= to!(char[])((&value)[0..1]); 47 46 } 48 47 // handle non-numeric entities by lookup trunk/bbconv/bbconv.d
r34 r115 1 module bbconv; 2 1 3 import bbcode; 2 4 import parser; … … 6 8 import dbi.pg.all; 7 9 8 import std.stdio; 9 import std.string; 10 import std.file; 11 import std.utf; 10 import tango.io.Stdout; 11 import tango.text.Util; 12 import tango.text.convert.Layout; 13 import tango.time.Clock; 14 import tango.time.Time; 15 import tango.time.chrono.Gregorian; 16 import tango.util.Convert; 17 18 Layout!(char) sformat; 19 char[][char[]] bioHeadings; 20 21 static this() 22 { 23 sformat = new Layout!(char)(); 24 bioHeadings = [ 25 "user_icq"[]: "ICQ Number"[], 26 "user_aim": "AIM Address", 27 "user_msnm": "MSN Messenger", 28 "user_yim": "Yahoo Messenger", 29 "user_website": "Website", 30 "user_from": "Location", 31 "user_occ": "Occupation", 32 "user_interests": "Interests" 33 ]; 34 35 } 12 36 13 37 char[] escape(char[] value){ 14 return std.string.replace(std.string.replace(value,"\\","\\\\"),"'","''"); 38 return substitute(substitute(value,"\\","\\\\"),"'","''"); 39 } 40 41 TimeSpan parsePhpbbTime(char[] timeStr) 42 { 43 return TimeSpan.fromSeconds( to!(long)(timeStr) + TimeSpan(TimeSpan.Epoch1970).seconds ); 44 } 45 46 char[] timeToPgTimestamp(TimeSpan time, char[] timezone) 47 { 48 auto date = Gregorian.generic.toDate(Time(time.ticks)); 49 50 if(timezone.length > 0 && !"+-".contains(timezone[0])) 51 timezone = "+" ~ timezone; 52 53 return 54 "{,4}-{}-{} {}:{}:{}{}".sformat( 55 date.year, date.month, date.day, 56 time.time.hours, time.time.minutes, time.time.seconds, 57 timezone 58 ); 59 } 60 61 char[] genBioLine(Row row, char[] column) 62 { 63 if(row[column] is null || row[column] == "") 64 return ""; 65 else 66 return "'''{}''': {}\n\n".sformat(bioHeadings[column], row[column]); 67 } 68 69 char[] genBio(Row row) 70 { 71 char[] bio = ""; 72 73 foreach(char[] column; bioHeadings.keys) 74 bio ~= genBioLine(row, column); 75 76 return bio; 15 77 } 16 78 … … 21 83 auto config = new IniParser("config.ini"); 22 84 23 writefln("connecting to source database.");85 Stdout.formatln("connecting to source database."); 24 86 auto phpbbDB = new PgDatabase(config["SourceDB"]); 25 87 scope(exit) phpbbDB.close(); 26 88 27 writefln("connecting to destination database.");89 Stdout.formatln("connecting to destination database."); 28 90 auto tracforumsDB = new PgDatabase(config["DestDB"]); 29 91 scope(exit) tracforumsDB.close(); … … 39 101 } 40 102 41 writefln("data failed convertion\n[%s]\n[%s]\n",parser.getErrorReport(),bbcode);103 Stdout.formatln("data failed convertion\n[{}]\n[{}]\n",parser.getErrorReport(),bbcode); 42 104 return bbcode; 43 105 } 44 106 45 107 //Convert profile Data 46 writefln("Removing old profile data...");47 48 tracforumsDB.execute("DELETE FROM profile");108 Stdout.formatln("Removing old profile data..."); 109 110 tracforumsDB.execute("DELETE FROM userprofile"); 49 111 50 112 auto users = phpbbDB.query(` 51 113 SELECT username,user_sig,user_timezone,user_email,user_regdate,user_lastvisit,user_viewemail, 114 user_actkey,user_posts,user_password, 115 user_icq,user_aim,user_msnm,user_yim,user_website,user_from,user_occ,user_interests, 52 116 CASE WHEN user_active = -1 THEN 0 ELSE 1 END AS active 53 117 FROM phpbb_users 54 118 `); 55 119 56 writefln("Adding user data..."); 120 auto dsAuthUserRows = tracforumsDB.query(` 121 SELECT id,username 122 FROM auth_user 123 `).fetchAll; 124 125 Stdout.formatln("Adding user data..."); 57 126 58 127 char[] sql; 59 128 foreach(user; users.fetchAll){ 60 129 char[] sig = Latin1ToUTF8(user["user_sig"]); 61 130 62 131 if(sig.length > 0){ 63 132 sig = convertBBCode(sig); 64 133 } 65 134 char[] username = Latin1ToUTF8(user["username"]); 66 135 136 auto joinedOn = parsePhpbbTime(user["user_regdate" ]); 137 auto lastVisitedOn = parsePhpbbTime(user["user_lastvisit"]); 138 139 char[] userId; 140 bool userIdFound=false; 141 foreach(Row row; dsAuthUserRows){ 142 if(row["username"] == username){ 143 userId = row["id"]; 144 userIdFound = true; 145 } 146 } 147 148 if(!userIdFound){ 149 //Stdout.formatln("Could not find dsource auth_user row for user: {}\n",username); 150 sql = 151 "INSERT INTO auth_user " 152 "(username,first_name,last_name,email,password,is_staff,is_active,is_superuser,last_login,date_joined) " 153 "VALUES (" 154 "E'" ~ escape(username) ~ "'," // username 155 "'" ~ "" ~ "'," // first_name 156 "'" ~ "" ~ "'," // last_name 157 "E'" ~ escape(user["user_email"]) ~ "'," // email 158 "'" ~ user["user_password"] ~ "'," // password 159 "" ~ "0" ~ "::bool," //TODO: is_staff 160 "" ~ user["active"] ~ "::bool," // is_active 161 "" ~ "0" ~ "::bool," //TODO: is_superuser 162 "'" ~ timeToPgTimestamp(lastVisitedOn, user["user_timezone"]) ~ "'," // last_login 163 "'" ~ timeToPgTimestamp(joinedOn, user["user_timezone"]) ~ "'" // date_joined 164 ")"; 165 try{ 166 tracforumsDB.execute(sql); 167 } 168 catch(DBIException e){ 169 Stdout.formatln("Could not insert user account: {}\nSQL:{}\n",user["username"],sql); 170 e.writeOut( (char[] s) { Stdout(s); } ); 171 Stdout.newline; 172 } 173 174 userId = 175 tracforumsDB 176 .query("SELECT id FROM auth_user WHERE username=E'"~escape(username)~"'") 177 .fetchRow["id"]; 178 } 179 else{ 180 //TODO? Update auth_user row 181 Stdout.formatln("User already exists in dsource auth_user: {}\n",username); 182 } 183 67 184 sql = 68 "INSERT INTO profile "69 "( isactive,username,sig,timezone,email,regdate,lastvisit,viewemail,bio) "185 "INSERT INTO userprofile " 186 "(user_id,activation_key,key_expires,sig,defaultavatarid,bio,timezone,viewemail,isexpert,posts) " 70 187 "VALUES (" 71 "" ~ user["active"] ~ "::bool," 72 "'" ~ escape(username) ~ "'," 73 "'" ~ escape(sig) ~ "'," 74 "'" ~ escape(user["user_timezone"]) ~ "'," 75 "'" ~ escape(user["user_email"]) ~ "'," 76 "" ~ user["user_regdate"] ~ "," 77 "" ~ user["user_lastvisit"] ~ "," 78 "" ~ user["user_viewemail"] ~ "::bool," 79 "'" ~ "" ~ "'" //TODO: bio 188 "" ~ userId ~ "," // user_id 189 "E'" ~ escape(user["user_actkey"]) ~ "'," // activation_key 190 "'" ~ timeToPgTimestamp(TimeSpan(Clock.now.ticks + TimeSpan.TicksPerDay * 7), "") ~ "'," // key_expires 191 "E'" ~ escape(sig) ~ "'," // sig 192 "" ~ "0" ~ "," // defaultavatarid 193 "E'" ~ escape(genBio(user)) ~ "'," // bio 194 "E'" ~ escape(user["user_timezone"]) ~ "'," // timezone 195 "" ~ user["user_viewemail"] ~ "::bool," // viewemail 196 "" ~ "0" ~ "::bool," // isexpert 197 "'" ~ user["user_posts"] ~ "'" // posts 80 198 ")"; 81 199 try{ … … 83 201 } 84 202 catch(DBIException e){ 85 writefln("Could not insert user: %s\nSQL:%s\n",user["username"],sql); 86 writefln("%s",e.toString()); 203 Stdout.formatln("Could not insert user profile: {}\nSQL:{}\n",user["username"],sql); 204 e.writeOut( (char[] s) { Stdout(s); } ); 205 Stdout.newline; 87 206 } 88 207 } 89 208 users.finish(); 90 209 91 writefln("Done.");210 Stdout.formatln("Done."); 92 211 93 212 //Convert Forum Data 94 writefln("Removing old fourm data..."); 95 96 tracforumsDB.execute("DELETE FROM forum"); 97 tracforumsDB.execute("DELETE FROM topic"); 98 tracforumsDB.execute("DELETE FROM message"); 99 tracforumsDB.execute("DELETE FROM moderators"); 100 101 writefln("Adding forums, moderators, topics and posts..."); 213 Stdout.formatln("Removing old fourm data..."); 214 215 tracforumsDB.execute("DELETE FROM f_forum"); 216 tracforumsDB.execute("DELETE FROM f_topic"); 217 tracforumsDB.execute("DELETE FROM f_message"); 218 tracforumsDB.execute("DELETE FROM f_moderators"); 219 220 try 221 { 222 sql = "ALTER TABLE f_topic ADD COLUMN hidden boolean NOT NULL"; 223 tracforumsDB.execute(sql); 224 sql = "ALTER TABLE f_topic ADD COLUMN locked boolean NOT NULL"; 225 tracforumsDB.execute(sql); 226 } 227 catch(DBIException e){ 228 Stdout.formatln("Could not add column to topic\nSQL:{}\n",sql); 229 e.writeOut( (char[] s) { Stdout(s); } ); 230 Stdout.newline; 231 } 232 233 Stdout.formatln("Adding forums, moderators, topics and posts..."); 102 234 103 235 auto forums = phpbbDB.query(` … … 105 237 CASE WHEN projects.project_code is null THEN 'dsource' ELSE projects.project_code END AS project_code 106 238 FROM phpbb_forums 107 Left JOIN projects ON projects.forum_id = phpbb_forums.forum_id; 239 Left JOIN projects ON projects.forum_id = phpbb_forums.forum_id 240 ORDER BY forum_id; 108 241 `); 109 242 243 char[] lastForumId = ""; 110 244 foreach(forum; forums.fetchAll){ 111 writefln("adding forum: %s (%s)",forum["project_code"],forum["forum_id"]); 245 if(forum["forum_id"] == lastForumId) 246 continue; 247 lastForumId = forum["forum_id"]; 248 249 Stdout.formatln("adding forum: {} ({})",forum["project_code"],forum["forum_id"]); 112 250 113 251 // add forum 114 252 tracforumsDB.execute( 115 "INSERT INTO f orum "253 "INSERT INTO f_forum " 116 254 "(id,name,description,created,modified,projectid,locked,hidden) " 117 255 "VALUES( " 118 256 "" ~ forum["forum_id"] ~ "," 119 " '" ~ escape(forum["forum_name"]) ~ "',"120 " '" ~ escape(forum["forum_desc"]) ~ "',"257 "E'" ~ escape(forum["forum_name"]) ~ "'," 258 "E'" ~ escape(forum["forum_desc"]) ~ "'," 121 259 "0," // created 122 260 "0," // modified 123 " '" ~ escape(forum["project_code"]) ~ "',"261 "E'" ~ escape(forum["project_code"]) ~ "'," 124 262 "0::bool," // locked 125 263 "0::bool" // hidden … … 140 278 foreach(mod; moderators.fetchAll){ 141 279 char[] username = Latin1ToUTF8(mod["username"]); 142 writefln("\tmod: %s for %s",username,mod["forum_name"]);280 Stdout.formatln("\tmod: {} for {}",username,mod["forum_name"]); 143 281 144 282 tracforumsDB.execute( 145 "INSERT INTO moderators "283 "INSERT INTO f_moderators " 146 284 "(forumid,username) " 147 285 "VALUES( " 148 286 "" ~ forum["forum_id"] ~ "," 149 " '" ~ escape(username) ~ "'"287 "E'" ~ escape(username) ~ "'" 150 288 ")" 151 289 ); … … 158 296 159 297 foreach(topic; topics.fetchAll){ 160 writefln("\ttopic: %s",topic["topic_title"]);298 Stdout.formatln("\ttopic: {}",topic["topic_title"]); 161 299 162 300 char[] type; … … 175 313 // add topic 176 314 tracforumsDB.execute( 177 "INSERT INTO topic "315 "INSERT INTO f_topic " 178 316 "(id,forumid,subject,hidden,locked,type,views) " 179 317 "VALUES( " 180 318 "" ~ topic["topic_id"] ~ "," 181 319 "" ~ forum["forum_id"] ~ "," 182 "'" ~ escape(topic["topic_title"]) ~ "'," 320 "E'" ~ escape(topic["topic_title"]) ~ "'," 321 "0::bool," // hidden 183 322 "0::bool," // locked 184 "0::bool," // hidden185 323 "'" ~ type ~ "'," // type 186 324 "" ~ topic["topic_views"] ~ "" … … 203 341 char[] username = Latin1ToUTF8(post["username"]); 204 342 205 writefln("\t\tpost: %s by %s at %s",post["post_id"],username,post["post_time"]);343 Stdout.formatln("\t\tpost: {} by {} at {}",post["post_id"],username,post["post_time"]); 206 344 207 345 // convert text … … 220 358 // add post 221 359 char[] messagesql = 222 "INSERT INTO message "360 "INSERT INTO f_message " 223 361 "(id,topicid,created,modified,author,body,avatarid) " 224 362 "VALUES( " … … 227 365 "" ~ post["post_time"] ~ "," 228 366 "" ~ editTime ~ "," 229 " '" ~ escape(username) ~ "',"230 " '" ~ escape(text) ~ "',"367 "E'" ~ escape(username) ~ "'," 368 "E'" ~ escape(text) ~ "'," 231 369 "0" // avatarid 232 370 ")"; … … 240 378 241 379 tracforumsDB.execute( 242 "UPDATE topic SET leadmessageid=" ~ post["post_id"] ~ " WHEREtopic.id = " ~ topic["topic_id"] ~ ""380 "UPDATE f_topic SET leadmessageid=" ~ post["post_id"] ~ " WHERE f_topic.id = " ~ topic["topic_id"] ~ "" 243 381 ); 244 382 isFirst = false; … … 246 384 } 247 385 catch(DBIException e){ 248 writefln("ERROR: failure on post %s\n sql: %s\n%s",post["post_id"],sql,e.toString());386 Stdout.formatln("ERROR: failure on post {}\n sql: {}\n{}",post["post_id"],sql,e.toString()); 249 387 } 250 388 } … … 256 394 257 395 // update sequences 258 tracforumsDB.execute("SELECT setval('f orum_id_seq',max(id)) FROMforum");259 tracforumsDB.execute("SELECT setval(' message_id_seq',max(id)) FROMmessage");260 tracforumsDB.execute("SELECT setval(' profile_id_seq',max(id)) FROMprofile");261 tracforumsDB.execute("SELECT setval(' topic_id_seq',max(id)) FROMtopic");262 } 396 tracforumsDB.execute("SELECT setval('f_forum_id_seq',max(id)) FROM f_forum"); 397 tracforumsDB.execute("SELECT setval('f_message_id_seq',max(id)) FROM f_message"); 398 tracforumsDB.execute("SELECT setval('f_profile_id_seq',max(id)) FROM f_profile"); 399 tracforumsDB.execute("SELECT setval('f_topic_id_seq',max(id)) FROM f_topic"); 400 } trunk/bbconv/dbi/DBIException.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.DBIException; 9 6 10 version (Ares) { 11 private import std.vararg : va_arg; 12 } else { 13 private import std.stdarg : va_arg; 14 } 7 private import tango.core.Vararg : va_arg; 15 8 private import dbi.ErrorCode; 16 9 … … 34 27 * Params: 35 28 * msg = The message to report to the users. 36 * 29 * 37 30 * Throws: 38 31 * DBIException on invalid arguments. … … 62 55 dbiCode = va_arg!(ErrorCode)(_argptr); 63 56 } else { 64 throw new DBIException("Invalid argument of type \"" ~ _arguments[i].toString() ~ "\" passed to the DBIException constructor.");57 throw new DBIException("Invalid argument of type \"" ~ _arguments[i].toString() ~ "\" passed to the DBIException constructor."); 65 58 } 66 59 } … … 96 89 return sql; 97 90 } 98 deprecated alias getSql getSQL; 99 91 100 92 private: 101 93 char[] sql; trunk/bbconv/dbi/Database.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.Database; 9 6 10 version (Ares) { 11 private static import std.regexp; 12 debug (UnitTest) private import std.io.Console; 13 } else { 14 private static import std.string; 15 debug (UnitTest) private import std.stdio; 16 } 7 private static import tango.text.Util; 8 private static import tango.io.Stdout; 17 9 private import dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 10 public import dbi.SqlGen; 18 11 19 12 /** … … 70 63 */ 71 64 final Statement prepare (char[] sql) { 72 return new Statement(cast(Database)this, sql); 65 return new Statement(this, sql); 66 } 67 68 /** 69 * Escape a _string using the database's native method, if possible. 70 * 71 * Params: 72 * string = The _string to escape, 73 * 74 * Returns: 75 * The escaped _string. 76 */ 77 char[] escape (char[] string) 78 { 79 char[] result; 80 size_t count = 0; 81 82 // Maximum length needed if every char is to be quoted 83 result.length = string.length * 2; 84 85 for (size_t i = 0; i < string.length; i++) { 86 switch (string[i]) { 87 case '"': 88 case '\'': 89 case '\\': 90 result[count++] = '\\'; 91 break; 92 default: 93 break; 94 } 95 result[count++] = string[i]; 96 } 97 98 result.length = count; 99 return result; 73 100 } 74 101 … … 147 174 */ 148 175 deprecated abstract char[] getErrorMessage (); 149 176 177 /** 178 * Get the integer id of the last row to be inserted. 179 * 180 * Returns: 181 * The id of the last row inserted into the database. 182 */ 183 abstract long getLastInsertID (); 184 150 185 /** 151 186 * Split a _string into keywords and values. … … 162 197 final protected char[][char[]] getKeywords (char[] string) { 163 198 char[][char[]] keywords; 164 version (Ares) { 165 foreach (char[] group; std.regexp.split(string, ";")) { 166 if (group == "") { 167 continue; 168 } 169 char[][] vals = std.regexp.split(group, "="); 170 keywords[vals[0]] = vals[1]; 199 foreach (char[] group; tango.text.Util.delimit(string, ";")) { 200 if (group == "") { 201 continue; 171 202 } 172 } else { 173 foreach (char[] group; std.string.split(string, ";")) { 174 if (group == "") { 175 continue; 176 } 177 char[][] vals = std.string.split(group, "="); 178 keywords[vals[0]] = vals[1]; 179 } 203 char[][] vals = tango.text.Util.delimit(group, "="); 204 keywords[vals[0]] = vals[1]; 180 205 } 181 206 return keywords; 207 } 208 209 static this() 210 { 211 sqlGen = new SqlGenerator; 212 } 213 private static SqlGenerator sqlGen; 214 215 SqlGenerator getSqlGenerator() 216 { 217 return sqlGen; 182 218 } 183 219 } … … 190 226 deprecated int getErrorCode () {return 0;} 191 227 deprecated char[] getErrorMessage () {return "";} 192 193 } 228 } 229 230 debug(UnitTest) { 194 231 195 232 unittest { 196 version (Ares) { 197 void s1 (char[] s) { 198 Cout("" ~ s ~ "\n"); 199 } 200 201 void s2 (char[] s) { 202 Cout(" ..." ~ s ~ "\n"); 203 } 204 } else { 205 void s1 (char[] s) { 206 writefln("%s", s); 207 } 208 209 void s2 (char[] s) { 210 writefln(" ...%s", s); 211 } 212 } 213 233 void s1 (char[] s) { 234 tango.io.Stdout.Stdout(s).newline(); 235 } 236 237 void s2 (char[] s) { 238 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 239 } 214 240 215 241 s1("dbi.Database:"); … … 218 244 s2("getKeywords"); 219 245 char[][char[]] keywords = db.getKeywords("dbname=hi;host=local;"); 220 assert(keywords["dbname"] == "hi"); 221 assert(keywords["host"] == "local"); 222 } 246 assert (keywords["dbname"] == "hi"); 247 assert (keywords["host"] == "local"); 248 } 249 } trunk/bbconv/dbi/ErrorCode.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ trunk/bbconv/dbi/Result.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ trunk/bbconv/dbi/Row.d
r11 r115 1 2 /** 1 /** 3 2 * Authors: The D DBI project 4 *5 * Version: 0.2.46 *7 3 * Copyright: BSD license 8 4 */ 9 5 module dbi.Row; 10 6 11 version (Ares) {12 debug (UnitTest) private import std.io.Console;13 } else {14 debug (UnitTest) private import std.stdio;15 }16 7 private import dbi.DBIException; 17 8 … … 62 53 * --- 63 54 * 64 * Returns: 55 * Returns: 65 56 * The field's contents. 66 57 */ … … 162 153 } 163 154 155 /** 156 * Ability to do a foreach of each column. 157 */ 158 int opApply(int delegate(inout char[], inout char[]) dg) { 159 int result = 0; 160 161 for (int i = 0; i < fieldNames.length; i++) { 162 result = dg(fieldNames[i], fieldValues[i]); 163 if (result) 164 break; 165 } 166 return result; 167 } 168 169 /** 170 * 171 * Returns: the number of columns in the row. 172 */ 173 size_t length () { 174 return fieldTypes.length; 175 } 176 164 177 private: 165 178 char[][] fieldNames; … … 169 182 } 170 183 184 debug(UnitTest) { 185 static import tango.io.Stdout; 186 171 187 unittest { 172 version (Ares) { 173 void s1 (char[] s) { 174 Cout("" ~ s ~ "\n"); 175 } 176 177 void s2 (char[] s) { 178 Cout(" ..." ~ s ~ "\n"); 179 } 180 } else { 181 void s1 (char[] s) { 182 writefln("%s", s); 183 } 184 185 void s2 (char[] s) { 186 writefln(" ...%s", s); 187 } 188 189 void s1 (char[] s) { 190 tango.io.Stdout.Stdout(s).newline(); 191 } 192 193 void s2 (char[] s) { 194 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 188 195 } 189 196 190 197 s1("dbi.Row:"); 191 198 Row r1 = new Row(); 192 r1.addField("name", "John Doe", "text", 3);193 r1.addField("age", "23","integer", 1);199 r1.addField("name", "John Doe", "text", 3); 200 r1.addField("age", "23", "integer", 1); 194 201 195 202 s2("get(int)"); 196 assert (r1.get(0) == "John Doe");203 assert (r1.get(0) == "John Doe"); 197 204 198 205 s2("get(char[])"); 199 assert (r1.get("name") == "John Doe");206 assert (r1.get("name") == "John Doe"); 200 207 201 208 s2("[int]"); 202 assert (r1[0] == "John Doe");209 assert (r1[0] == "John Doe"); 203 210 204 211 s2("[char[]]"); 205 assert (r1["age"] == "23");212 assert (r1["age"] == "23"); 206 213 207 214 s2("getFieldIndex"); 208 assert (r1.getFieldIndex("name") == 0);215 assert (r1.getFieldIndex("name") == 0); 209 216 210 217 s2("getFieldType"); 211 assert (r1.getFieldType(0) == 3);212 218 assert (r1.getFieldType(0) == 3); 219 213 220 s2("getFieldDecl"); 214 assert (r1.getFieldDecl(1) == "integer");221 assert (r1.getFieldDecl(1) == "integer"); 215 222 } 223 } trunk/bbconv/dbi/Statement.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.Statement; 9 6 10 version ( Ares) {11 private static import std. regexp;12 debug (UnitTest) private import std.io.Console;7 version (Phobos) { 8 private static import std.string; 9 debug (UnitTest) private static import std.stdio; 13 10 } else { 14 private static import std.string; 15 debug (UnitTest) private import std.stdio; 16 } 17 private import dbi.Database, dbi.Result; 11 private static import tango.text.Util; 12 private static import tango.text.Regex; 13 debug (UnitTest) private static import tango.io.Stdout; 14 } 15 private import dbi.Database, dbi.DBIException, dbi.Result; 18 16 19 17 /** … … 99 97 */ 100 98 char[] escape (char[] string) { 101 version (Ares) {102 return std.regexp.sub(string, "'", "''");99 if (database !is null) { 100 return database.escape(string); 103 101 } else { 104 return std.string.replace(string, "'", "''"); 102 char[] result; 103 size_t count = 0; 104 105 // Maximum length needed if every char is to be quoted 106 result.length = string.length * 2; 107 108 for (size_t i = 0; i < string.length; i++) { 109 switch (string[i]) { 110 case '"': 111 case '\'': 112 case '\\': 113 result[count++] = '\\'; 114 break; 115 default: 116 break; 117 } 118 result[count++] = string[i]; 119 } 120 121 result.length = count; 122 return result; 105 123 } 106 124 } … … 116 134 */ 117 135 char[] getSqlByQM () { 118 char[] result = sql; 119 int qmIdx = 0, qmCount = 0; 120 121 void replace () { 122 result = result[0 .. qmIdx] ~ "'" ~ binds[qmCount] ~ "'" ~ result[qmIdx + 1 .. result.length]; 123 qmCount++; 124 } 125 126 version (Ares) { 127 while((qmIdx = std.regexp.find(result, "\\u003F")) != size_t.max) { 128 replace(); 129 } 130 } else { 131 while ((qmIdx = std.string.find(result, "?")) != -1) { 132 replace(); 133 } 134 } 136 char[] result; 137 size_t i = 0, j = 0, count = 0; 138 139 // binds.length is for the '', only 1 because we replace the ? too 140 result.length = sql.length + binds.length; 141 for (i = 0; i < binds.length; i++) { 142 result.length = result.length + binds[i].length; 143 } 144 145 for (i = 0; i < sql.length; i++) { 146 if (sql[i] == '?') { 147 result[j++] = '\''; 148 result[j .. j + binds[count].length] = binds[count]; 149 j += binds[count++].length; 150 result[j++] = '\''; 151 } 152 else { 153 result[j++] = sql[i]; 154 } 155 } 156 157 sql = result; 135 158 return result; 136 159 } … … 147 170 char[] getSqlByFN () { 148 171 char[] result = sql; 149 ptrdiff_t begIdx = 0, endIdx = 0;150 version (Ares) {151 while ((beg Idx = std.regexp.find(result, ":")) != -1 && (endIdx = std.regexp.find(result[begIdx + 1 .. length], ":")) != -1) {152 result = result[0 .. beg Idx] ~ "'" ~ getBoundValue(result[begIdx + 1.. begIdx + endIdx + 1])~ "'" ~ result[begIdx + endIdx + 2 .. length];172 version (Phobos) { 173 ptrdiff_t beginIndex = 0, endIndex = 0; 174 while ((beginIndex = std.string.find(result, ":")) != -1 && (endIndex = std.string.find(result[beginIndex + 1 .. length], ":")) != -1) { 175 result = result[0 .. beginIndex] ~ "'" ~ getBoundValue(result[beginIndex + 1.. beginIndex + endIndex + 1]) ~ "'" ~ result[beginIndex + endIndex + 2 .. length]; 153 176 } 154 177 } else { 155 while ((begIdx = std.string.find(result, ":")) != -1 && (endIdx = std.string.find(result[begIdx + 1 .. length], ":")) != -1) { 156 result = result[0 .. begIdx] ~ "'" ~ getBoundValue(result[begIdx + 1.. begIdx + endIdx + 1])~ "'" ~ result[begIdx + endIdx + 2 .. length]; 178 uint beginIndex = 0, endIndex = 0; 179 while ((beginIndex = tango.text.Util.locate(result, ':')) != result.length && (endIndex = tango.text.Util.locate(result, ':', beginIndex + 1)) != result.length) { 180 result = result[0 .. beginIndex] ~ "'" ~ getBoundValue(result[beginIndex + 1 .. endIndex]) ~ "'" ~ result[endIndex + 1 .. length]; 157 181 } 158 182 } … … 167 191 */ 168 192 char[] getSql () { 169 version (Ares) { 170 if (std.regexp.find(sql, "\\u003F") != size_t.max) { 171 return getSqlByQM(); 172 } else if (std.regexp.find(sql, ":") != size_t.max) { 173 return getSqlByFN(); 174 } else { 175 return sql; 176 } 177 } else { 193 version (Phobos) { 178 194 if (std.string.find(sql, "?") != -1) { 179 195 return getSqlByQM(); … … 183 199 return sql; 184 200 } 201 } else { 202 if (tango.text.Util.contains(sql, '?')) { 203 return getSqlByQM(); 204 } else if (tango.text.Util.contains(sql, ':')) { 205 return getSqlByFN(); 206 } else { 207 return sql; 208 } 185 209 } 186 210 } … … 194 218 * Returns: 195 219 * The bound value of fn. 220 * 221 * Throws: 222 * DBIException if fn is not bound 196 223 */ 197 224 char[] getBoundValue (char[] fn) { 198 for (ptrdiff_t idx = 0; idx < bindsFNs.length; idx++) { 199 if (bindsFNs[idx] == fn) { 200 return binds[idx]; 201 } 202 } 203 return null; 204 } 205 206 public void clearBinds(){ 207 this.bindsFNs = (char[][]).init; 208 this.binds = (char[][]).init; 209 } 210 } 211 225 for (size_t index = 0; index < bindsFNs.length; index++) { 226 if (bindsFNs[index] == fn) { 227 return binds[index]; 228 } 229 } 230 throw new DBIException(fn ~ " is not bound in the Statement."); 231 } 232 } 233 234 debug(UnitTest) { 212 235 unittest { 213 version ( Ares) {236 version (Phobos) { 214 237 void s1 (char[] s) { 215 Cout("" ~ s ~ "\n");238 std.stdio.writefln("%s", s); 216 239 } 217 240 218 241 void s2 (char[] s) { 219 Cout(" ..." ~ s ~ "\n");242 std.stdio.writefln(" ...%s", s); 220 243 } 221 244 } else { 222 245 void s1 (char[] s) { 223 writefln("%s", s);246 tango.io.Stdout.Stdout(s).newline(); 224 247 } 225 248 226 249 void s2 (char[] s) { 227 writefln(" ...%s", s);250 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 228 251 } 229 252 } … … 231 254 s1("dbi.Statement:"); 232 255 Statement stmt = new Statement(null, "SELECT * FROM people"); 233 char[] resultingSql = "SELECT * FROM people WHERE id = '10' OR name LIKE 'John Mc ''Donald'";256 char[] resultingSql = "SELECT * FROM people WHERE id = '10' OR name LIKE 'John Mc\\'Donald'"; 234 257 235 258 s2("escape"); 236 assert (stmt.escape("John Mc'Donald") == "John Mc''Donald");259 assert (stmt.escape("John Mc'Donald") == "John Mc\\'Donald"); 237 260 238 261 s2("simple sql"); 239 262 stmt = new Statement(null, "SELECT * FROM people"); 240 assert (stmt.getSql() == "SELECT * FROM people");263 assert (stmt.getSql() == "SELECT * FROM people"); 241 264 242 265 s2("bind by '?'"); … … 244 267 stmt.bind(1, "10"); 245 268 stmt.bind(2, "John Mc'Donald"); 246 assert (stmt.getSql() == resultingSql);269 assert (stmt.getSql() == resultingSql); 247 270 248 271 /+ 249 272 s2("bind by '?' sent to getSql via variable arguments"); 250 273 stmt = new Statement("SELECT * FROM people WHERE id = ? OR name LIKE ?"); 251 assert (stmt.getSql("10", "John Mc'Donald") == resultingSql);274 assert (stmt.getSql("10", "John Mc'Donald") == resultingSql); 252 275 +/ 253 276 … … 256 279 stmt.bind("id", "10"); 257 280 stmt.bind("name", "John Mc'Donald"); 258 assert(stmt.getBoundValue("name") == "John Mc''Donald"); 259 assert(stmt.getSql() == resultingSql); 260 } 281 assert (stmt.getBoundValue("name") == "John Mc\\'Donald"); 282 assert (stmt.getSql() == resultingSql); 283 } 284 } trunk/bbconv/dbi/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 17 14 dbi.Result, 18 15 dbi.Row, 19 dbi.Statement; 16 dbi.Statement, 17 dbi.Registry; trunk/bbconv/dbi/ib/IbDatabase.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.ib.IbDatabase; 6 7 version (dbi_ib) { 9 8 10 9 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; … … 40 39 41 40 /** 42 * 41 * 43 42 */ 44 43 override void connect (char[] params, char[] username = null, char[] password = null) { … … 105 104 106 105 private: 107 106 108 107 } 108 109 } trunk/bbconv/dbi/ib/IbResult.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.ib.IbResult; 6 7 version (dbi_ib) { 9 8 10 9 private import dbi.DBIException, dbi.Result, dbi.Row; … … 20 19 public: 21 20 this () { 22 21 23 22 } 24 23 … … 37 36 */ 38 37 override void finish () { 39 38 40 39 } 41 40 42 41 private: 43 42 } 43 } trunk/bbconv/dbi/ib/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 version (dbi_ib) { 12 14 13 public import dbi.ib.IbDatabase, 15 14 dbi.ib.IbResult, 16 15 dbi.all; 16 } trunk/bbconv/dbi/ib/imp.d
r11 r115 1 /**1 /** 2 2 * InterBase import library. 3 3 * … … 7 7 * InterBase version 7.5.1 8 8 * 9 * Import library version 0.0 19 * Import library version 0.02 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ … … 16 15 17 16 version (Windows) { 18 17 pragma (msg, "You will need to manually link in the InterBase library."); 19 18 } else version (linux) { 20 19 pragma (msg, "You will need to manually link in the InterBase library."); 20 } else version (Posix) { 21 pragma (msg, "You will need to manually link in the InterBase library."); 21 22 } else version (darwin) { 22 static assert (0);23 pragma (msg, "You will need to manually link in the InterBase library."); 23 24 } else { 24 static assert (0);25 pragma (msg, "You will need to manually link in the InterBase library."); 25 26 } 26 27 … … 796 797 const uint SQL_DIALECT_V6 = 3; /// supports SQL delimited identifier, SQLDATE/DATE, TIME, TIMESTAMP, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, and 64-bit exact numeric type. 797 798 const uint SQL_DIALECT_CURRENT = SQL_DIALECT_V6; /// latest IB DIALECT. 799 version (dbi_ib) { 800 798 801 799 802 const uint sec_uid_spec = 0x01; … … 1165 1168 1166 1169 int isc_modify_user (ISC_STATUS*, USER_SEC_DATA*); 1167 1170 1168 1171 ISC_STATUS isc_compile_request (ISC_STATUS*, isc_db_handle*, isc_req_handle*, short, char*); 1169 1172 … … 1342 1345 1343 1346 ISC_STATUS isc_suspend_window (ISC_STATUS*, isc_win_handle*); 1347 1348 } trunk/bbconv/dbi/msql/MsqlDatabase.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.msql.MsqlDatabase; 6 7 version (dbi_msql) { 9 8 10 9 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; … … 40 39 41 40 /** 42 * 41 * 43 42 */ 44 43 override void connect (char[] params, char[] username = null, char[] password = null) { … … 102 101 103 102 private: 104 103 105 104 } 105 106 } trunk/bbconv/dbi/msql/MsqlResult.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.msql.MsqlResult; 6 7 version (dbi_msql) { 8 9 9 10 10 private import dbi.DBIException, dbi.Result, dbi.Row; … … 20 20 public: 21 21 this () { 22 22 23 23 } 24 24 … … 37 37 */ 38 38 override void finish () { 39 39 40 40 } 41 41 42 42 private: 43 43 } 44 45 } trunk/bbconv/dbi/msql/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 version (dbi_msql) { 12 14 13 public import dbi.msql.MsqlDatabase, 15 14 dbi.msql.MsqlResult, 16 15 dbi.all; 16 17 } trunk/bbconv/dbi/msql/imp.d
r11 r115 7 7 * mSQL version 3.8 8 8 * 9 * Import library version 0.0 19 * Import library version 0.02 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.msql.imp; 16 15 16 version (dbi_msql) { 17 18 version (Phobos) { 19 private import std.c.time; 20 } else { 21 private import tango.stdc.time; 22 } 23 24 17 25 version (Windows) { 18 26 pragma (msg, "You will need to manually link in the mSQL library."); 19 27 } else version (linux) { 20 28 pragma (lib, "libmsql.a"); 29 } else version (Posix) { 30 pragma (lib, "libmsql.a"); 21 31 } else version (darwin) { 22 32 pragma (msg, "You will need to manually link in the mSQL library."); 23 33 } else { 24 static assert (0); 25 } 26 27 private import std.c.time; 34 pragma (msg, "You will need to manually link in the mSQL library."); 35 } 28 36 29 37 const uint INT_TYPE = 1; /// … … 540 548 */ 541 549 time_t msqlMillidatetimeToUnixTime (char*); 550 551 } trunk/bbconv/dbi/mysql/MysqlDatabase.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.mysql.MysqlDatabase; 9 6 10 version (Ares) { 11 private static import std.regexp; 12 private import util.string : asString = toString; 13 debug (UnitTest) private import std.io.Console; 14 } else { 15 private static import std.string; 16 alias std.string.toString asString; 17 debug (UnitTest) private import std.stdio; 18 } 19 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 20 private import dbi.mysql.imp, dbi.mysql.MysqlError, dbi.mysql.MysqlResult; 7 version (dbi_mysql) { 8 9 private import tango.stdc.stringz : toDString = fromStringz, toCString = toStringz; 10 private import tango.io.Console; 11 private static import tango.text.Util; 12 private static import tango.text.convert.Integer; 13 debug(UnitTest) import tango.io.Stdout; 14 15 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement, dbi.Registry; 16 version(Windows) { 17 private import dbi.mysql.imp_win; 18 } 19 else { 20 private import dbi.mysql.imp; 21 } 22 private import dbi.mysql.MysqlError, dbi.mysql.MysqlResult; 23 24 static this() { 25 uint ver = mysql_get_client_version(); 26 if(ver < 50000) { 27 throw new Exception("Unsupported MySQL client version. Please compile using at least version 5.0 of the MySQL client libray."); 28 } 29 else if(ver < 50100) { 30 if(MYSQL_VERSION != 50000) { 31 throw new Exception("You are linking against version 5.0 of the MySQL client library but you have a build switch turned on for a different version (such as MySQL_51)."); 32 } 33 } 34 else { 35 if(MYSQL_VERSION != 50100) { 36 throw new Exception("You are linking against version 5.1 (or higher) of the MySQL client library so you need to use the build switch '-version=MySQL_51'."); 37 } 38 } 39 } 21 40 22 41 /** … … 80 99 char[] host = "localhost"; 81 100 char[] dbname = "test"; 82 char[] sock = "/tmp/mysql.sock";101 char[] sock = null; 83 102 uint port = 0; 84 103 … … 95 114 } 96 115 if ("port" in keywords) { 97 port = toInt(keywords["port"]); 98 } 99 } 100 101 version (Ares) { 102 if (std.regexp.find(params, "=") != size_t.max) { 103 parseKeywords(); 104 } else { 105 dbname = params; 106 } 107 } else { 108 if (std.string.find(params, "=") != -1) { 109 parseKeywords(); 110 } else { 111 dbname = params; 112 } 113 } 114 115 mysql_real_connect(connection, host, username, password, dbname, port, sock, 0); 116 port = cast(uint)tango.text.convert.Integer.parse(keywords["port"]); 117 } 118 } 119 if (tango.text.Util.contains(params, '=')) { 120 parseKeywords(); 121 } else { 122 dbname = params; 123 } 124 125 mysql_real_connect(connection, toCString(host), toCString(username), toCString(password), toCString(dbname), port, toCString(sock), 0); 116 126 if (uint error = mysql_errno(connection)) { 117 throw new DBIException("Unable to connect to the MySQL database.", error, dbi.mysql.MysqlError.specificToGeneral(error)); 127 Cout("connect(): "); 128 Cout(toDString(mysql_error(connection))); 129 Cout("\n").flush; 130 throw new DBIException("Unable to connect to the MySQL database.", error, specificToGeneral(error)); 118 131 } 119 132 } … … 126 139 */ 127 140 override void close () { 128 mysql_close(connection); 129 if (uint error = mysql_errno(connection)) { 130 throw new DBIException("Unable to close the MySQL database.", error, dbi.mysql.MysqlError.specificToGeneral(error)); 141 if (connection !is null) { 142 mysql_close(connection); 143 if (uint error = mysql_errno(connection)) { 144 Cout("close(): "); 145 Cout(toDString(mysql_error(connection))); 146 Cout("\n").flush; 147 throw new DBIException("Unable to close the MySQL database.", error, specificToGeneral(error)); 148 } 149 connection = null; 131 150 } 132 151 } … … 142 161 */ 143 162 override void execute (char[] sql) { 144 int error = mysql_real_query(connection, sql, sql.length);163 int error = mysql_real_query(connection, toCString(sql), sql.length); 145 164 if (error) { 146 throw new DBIException("Unable to execute a command on the MySQL database.", sql, error, dbi.mysql.MysqlError.specificToGeneral(error)); 165 Cout("execute(): "); 166 Cout(toDString(mysql_error(connection))); 167 Cout("\n").flush; 168 throw new DBIException("Unable to execute a command on the MySQL database.", sql, error, specificToGeneral(error)); 147 169 } 148 170 } … … 161 183 */ 162 184 override MysqlResult query (char[] sql) { 163 mysql_real_query(connection, sql, sql.length);185 mysql_real_query(connection, toCString(sql), sql.length); 164 186 MYSQL_RES* results = mysql_store_result(connection); 165 //if (results is null) { 166 // throw new DBIException("Unable to query the MySQL database.", sql); 167 //} 187 if (results is null) { 188 Cout("query(): "); 189 Cout(toDString(mysql_error(connection))); 190 Cout("\n").flush; 191 throw new DBIException("Unable to query the MySQL database.", sql); 192 } 168 193 assert (results !is null); 169 194 return new MysqlResult(results); … … 181 206 */ 182 207 deprecated override int getErrorCode () { 208 Cout("GetErrorCode: "); 209 Cout(toDString(mysql_error(connection))); 210 Cout("\n").flush; 183 211 return cast(int)mysql_errno(connection); 184 212 } … … 195 223 */ 196 224 deprecated override char[] getErrorMessage () { 197 return asString(mysql_error(connection)); 198 } 199 200 private: 225 return toDString(mysql_error(connection)); 226 } 227 228 /** 229 * Get the integer id of the last row to be inserted. 230 * 231 * Returns: 232 * The id of the last row inserted into the database. 233 */ 234 override long getLastInsertID() { 235 return mysql_insert_id(connection); 236 } 237 238 static this() 239 { 240 mysqlSqlGen = new MysqlSqlGenerator; 241 } 242 private static MysqlSqlGenerator mysqlSqlGen; 243 244 override SqlGenerator getSqlGenerator() 245 { 246 return mysqlSqlGen; 247 } 248 249 package: 201 250 MYSQL* connection; 202 251 } 203 252 253 class MysqlSqlGenerator : SqlGenerator 254 { 255 override char getIdentifierQuoteCharacter() 256 { 257 return '`'; 258 } 259 } 260 261 private class MysqlRegister : Registerable { 262 263 public char[] getPrefix() { 264 return "mysql"; 265 } 266 267 public Database getInstance(char[] url) { 268 //parse the URL here 269 return new MysqlDatabase(); 270 } 271 } 272 273 static this() { 274 Cout("Attempting to register MysqlDatabase in Registry").newline; 275 registerDatabase(new MysqlRegister()); 276 } 277 278 debug(UnitTest) { 204 279 unittest { 205 version (Ares) { 206 void s1 (char[] s) { 207 Cout("" ~ s ~ "\n"); 208 } 209 210 void s2 (char[] s) { 211 Cout(" ..." ~ s ~ "\n"); 212 } 213 } else { 214 void s1 (char[] s) { 215 writefln("%s", s); 216 } 217 218 void s2 (char[] s) { 219 writefln(" ...%s", s); 220 } 221 } 280 281 void s1 (char[] s) { 282 tango.io.Stdout.Stdout(s).newline(); 283 } 284 285 void s2 (char[] s) { 286 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 287 } 222 288 223 289 s1("dbi.mysql.MysqlDatabase:"); 224 290 MysqlDatabase db = new MysqlDatabase(); 225 s2("connect");291 /+ s2("connect"); 226 292 db.connect("dbname=test", "test", "test"); 227 293 … … 265 331 266 332 s2("close"); 267 db.close(); 268 } 269 270 /* 271 * Copyright (C) 2002-2006 by Digital Mars, www.digitalmars.com 272 * Written by Walter Bright 273 * Some parts contributed by David L. Davis 274 * Modified for use in D DBI. 275 * 276 * This software is provided 'as-is', without any express or implied 277 * warranty. In no event will the authors be held liable for any damages 278 * arising from the use of this software. 279 * 280 * Permission is granted to anyone to use this software for any purpose, 281 * including commercial applications, and to alter it and redistribute it 282 * freely, subject to the following restrictions: 283 * 284 * o The origin of this software must not be misrepresented; you must not 285 * claim that you wrote the original software. If you use this software 286 * in a product, an acknowledgment in the product documentation would be 287 * appreciated but is not required. 288 * o Altered source versions must be plainly marked as such, and must not 289 * be misrepresented as being the original software. 290 * o This notice may not be removed or altered from any source 291 * distribution. 292 */ 293 int toInt (char[] string) { 294 if (!string.length) { 295 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 296 } 297 298 bool negative = false; 299 int v = 0; 300 301 for (size_t i = 0; i < string.length; i++) { 302 char c = string[i]; 303 304 if (c >= '0' && c <= '9') { 305 uint v1 = v; 306 v = v * 10 + (c - '0'); 307 308 if (cast(uint)v < v1) { 309 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 310 } 311 } else if (c == '-' && i == 0) { 312 negative = true; 313 314 if (string.length == 1) { 315 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 316 } 317 } else if (c == '+' && i == 0) { 318 if (string.length == 1) { 319 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 320 } 321 } else { 322 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 323 } 324 } 325 if (negative) { 326 if (cast(uint)v > 0x80000000) { 327 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 328 } 329 330 v = -v; 331 } else { 332 if (cast(uint)v > 0x7FFFFFFF) { 333 throw new DBIException("Couldn't convert \"" ~ string ~ "\" to type \"int.\""); 334 } 335 } 336 return v; 337 } 333 db.close();+/ 334 auto sqlgen = db.getSqlGenerator; 335 auto res = sqlgen.makeInsertSql("user", ["name", "date"]); 336 assert(res == "INSERT INTO `user` (`name`,`date`) VALUES(?,?)", res); 337 } 338 } 339 340 } trunk/bbconv/dbi/mysql/MysqlError.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.mysql.MysqlError; 6 7 version (dbi_mysql) { 9 8 10 9 private import dbi.ErrorCode; … … 145 144 return ErrorCode.Unknown; 146 145 } 146 147 } trunk/bbconv/dbi/mysql/MysqlResult.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.mysql.MysqlResult; 9 6 10 version (Ares) { 11 private import util.string : asString = toString; 12 } else { 13 private import std.string : asString = toString; 7 version (dbi_mysql) { 8 private import tango.stdc.stringz : asString = fromStringz; 9 private import dbi.DBIException, dbi.Result, dbi.Row; 10 version(Windows) { 11 private import dbi.mysql.imp_win; 14 12 } 15 private import dbi.DBIException, dbi.Result, dbi.Row; 16 private import dbi.mysql.imp; 13 else { 14 private import dbi.mysql.imp; 15 } 17 16 18 17 /** … … 66 65 const uint fieldCount; 67 66 } 67 68 } trunk/bbconv/dbi/mysql/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 version (dbi_mysql) { 12 14 13 public import dbi.mysql.MysqlDatabase, 15 14 dbi.mysql.MysqlResult, 16 15 dbi.all; 16 17 } trunk/bbconv/dbi/mysql/imp.d
r11 r115 1 /** 2 * Authors: The D DBI project 3 * Copyright: BSD license 4 */ 1 5 module dbi.mysql.imp; 6 7 version (dbi_mysql) { 8 9 extern (C): 2 10 3 11 version (Windows) { … … 5 13 } else version (linux) { 6 14 pragma (lib, "libmysql.a"); 15 } else version (Posix) { 16 pragma (lib, "libmysql.a"); 7 17 } else version (darwin) { 8 18 pragma (lib, "libmysql.a"); 9 19 } else { 10 static assert (0);20 pragma (msg, "You will need to manually link in the MySQL library."); 11 21 } 12 22 13 extern (C): 23 version(MySQL_51) { 24 const uint MYSQL_VERSION = 50100; 25 } 26 else { 27 const uint MYSQL_VERSION = 50000; 28 } 14 29 15 30 alias ubyte __u_char; … … 675 690 uint charsetnr; 676 691 enum_field_types type; 692 version(MySQL_51){ 693 void* extension; 694 } 677 695 }; 678 696 alias st_mysql_field MYSQL_FIELD; … … 731 749 alias st_mem_root MEM_ROOT; 732 750 733 734 struct st_mysql_data { 735 my_ulonglong rows; 736 uint fields; 737 MYSQL_ROWS *data; 738 MEM_ROOT alloc; 739 740 MYSQL_ROWS **prev_ptr; 741 742 }; 751 version(MySQL_51) { 752 struct st_mysql_data { 753 MYSQL_ROWS *data; 754 //embedded_query_result *embedded_info; 755 void* embedded_info; 756 MEM_ROOT alloc; 757 my_ulonglong rows; 758 uint fields; 759 void* extension; 760 761 }; 762 } 763 else { 764 struct st_mysql_data { 765 my_ulonglong rows; 766 uint fields; 767 MYSQL_ROWS *data; 768 MEM_ROOT alloc; 769 770 MYSQL_ROWS **prev_ptr; 771 772 }; 773 } 743 774 alias st_mysql_data MYSQL_DATA; 744 775 … … 805 836 int (*local_infile_error)(void *, char *, uint); 806 837 void *local_infile_userdata; 838 version(MySQL_51) { 839 void* extension; 840 } 807 841 } 808 842 … … 853 887 alias charset_info_st CHARSET_INFO; 854 888 855 // end self inserted 889 // end self inserted 856 890 857 891 //struct st_mysql_methods; // conflict with line 1211 … … 910 944 911 945 my_bool *unbuffered_fetch_owner; 946 byte* info_buffer; 947 version(MySQL_51) { 948 void* extension; 949 } 912 950 }; 913 951 alias st_mysql MYSQL; … … 921 959 uint *lengths; 922 960 MYSQL *handle; 923 MEM_ROOT field_alloc; 924 uint field_count, current_field; 925 MYSQL_ROW row; 926 MYSQL_ROW current_row; 927 my_bool eof; 928 929 my_bool unbuffered_fetch_cancelled; 930 const st_mysql_methods *methods; 961 version(MySQL_51) { 962 const st_mysql_methods *methods; 963 MYSQL_ROW row; 964 MYSQL_ROW current_row; 965 MEM_ROOT field_alloc; 966 uint field_count, current_field; 967 my_bool eof; 968 my_bool unbuffered_fetch_cancelled; 969 void* extension; 970 } 971 else { 972 MEM_ROOT field_alloc; 973 uint field_count, current_field; 974 MYSQL_ROW row; 975 MYSQL_ROW current_row; 976 my_bool eof; 977 978 my_bool unbuffered_fetch_cancelled; 979 const st_mysql_methods *methods; 980 } 931 981 }; 932 982 alias st_mysql_res MYSQL_RES; … … 935 985 NET net; 936 986 char* host,user,passwd; 987 version(MySQL_51) { 988 char* net_buf,net_buf_pos,net_data_end; 989 uint port; 990 int cmd_status; 991 int last_errno; 992 int net_buf_size; 993 my_bool free_me; 994 my_bool eof; 995 char last_error[256]; 996 void* extension; 997 } 998 else { 937 999 uint port; 938 1000 my_bool free_me; … … 944 1006 int net_buf_size; 945 1007 char last_error[256]; 1008 } 946 1009 }; 947 1010 alias st_mysql_manager MYSQL_MANAGER; … … 983 1046 uint mysql_field_count(MYSQL *mysql); 984 1047 my_ulonglong mysql_affected_rows(MYSQL *mysql); 985 my_ulonglong mysql_insert_id(MYSQL *mysql);1048 long mysql_insert_id(MYSQL *mysql); 986 1049 uint mysql_errno(MYSQL *mysql); 987 1050 char * mysql_error(MYSQL *mysql); … … 1149 1212 MYSQL_STMT_FETCH_DONE 1150 1213 }; 1151 struct st_mysql_bind { 1152 uint *length; 1153 my_bool *is_null; 1154 void *buffer; 1155 1156 my_bool *error; 1157 enum_field_types buffer_type; 1158 1159 uint buffer_length; 1160 ubyte *row_ptr; 1161 uint offset; 1162 uint length_value; 1163 uint param_number; 1164 uint pack_length; 1165 my_bool error_value; 1166 my_bool is_unsigned; 1167 my_bool int_data_used; 1168 my_bool is_null_value; 1169 void (*store_param_func)(NET *net, st_mysql_bind *param); 1170 void (*fetch_result)(st_mysql_bind *, MYSQL_FIELD *, 1171 ubyte **row); 1172 void (*skip_result)(st_mysql_bind *, MYSQL_FIELD *, 1173 ubyte **row); 1174 }; 1214 version(MySQL_51) 1215 { 1216 struct st_mysql_bind 1217 { 1218 uint *length; /* output length pointer */ 1219 my_bool *is_null; /* Pointer to null indicator */ 1220 void *buffer; /* buffer to get/put data */ 1221 /* set this if you want to track data truncations happened during fetch */ 1222 my_bool *error; 1223 ubyte *row_ptr; /* for the current data position */ 1224 void (*store_param_func)(NET *net, st_mysql_bind *param); 1225 void (*fetch_result)(st_mysql_bind *, MYSQL_FIELD *, 1226 ubyte **row); 1227 void (*skip_result)(st_mysql_bind *, MYSQL_FIELD *, 1228 ubyte **row); 1229 /* output buffer length, must be set when fetching str/binary */ 1230 uint buffer_length; 1231 uint offset; /* offset position for char/binary fetch */ 1232 uint length_value; /* Used if length is 0 */ 1233 uint param_number; /* For null count and error messages */ 1234 uint pack_length; /* Internal length for packed data */ 1235 enum_field_types buffer_type; /* buffer type */ 1236 my_bool error_value; /* used if error is 0 */ 1237 my_bool is_unsigned; /* set if integer type is unsigned */ 1238 my_bool long_data_used; /* If used with mysql_send_long_data */ 1239 my_bool is_null_value; /* Used if is_null is 0 */ 1240 void *extension; 1241 } 1242 } 1243 else 1244 { 1245 struct st_mysql_bind { 1246 uint *length; 1247 my_bool *is_null; 1248 void *buffer; 1249 1250 my_bool *error; 1251 enum_field_types buffer_type; 1252 1253 uint buffer_length; 1254 ubyte *row_ptr; 1255 uint offset; 1256 uint length_value; 1257 uint param_number; 1258 uint pack_length; 1259 my_bool error_value; 1260 my_bool is_unsigned; 1261 my_bool int_data_used; 1262 my_bool is_null_value; 1263 void (*store_param_func)(NET *net, st_mysql_bind *param); 1264 void (*fetch_result)(st_mysql_bind *, MYSQL_FIELD *, 1265 ubyte **row); 1266 void (*skip_result)(st_mysql_bind *, MYSQL_FIELD *, 1267 ubyte **row); 1268 }; 1269 } 1175 1270 alias st_mysql_bind MYSQL_BIND; 1176 1271 … … 1187 1282 MYSQL_DATA result; 1188 1283 MYSQL_ROWS *data_cursor; 1189 1190 my_ulonglong affected_rows; 1191 my_ulonglong insert_id; 1192 1193 1194 1195 1196 int (*read_row_func)(st_mysql_stmt *stmt, 1197 ubyte **row); 1284 version(MySQL_51) { 1285 int (*read_row_func)(st_mysql_stmt *stmt, 1286 ubyte **row); 1287 my_ulonglong affected_rows; 1288 my_ulonglong insert_id; 1289 } 1290 else { 1291 my_ulonglong affected_rows; 1292 my_ulonglong insert_id; 1293 int (*read_row_func)(st_mysql_stmt *stmt, 1294 ubyte **row); 1295 1296 } 1198 1297 uint stmt_id; 1199 1298 uint flags; … … 1220 1319 1221 1320 my_bool update_max_length; 1321 version(MySQL_51) { 1322 void* extension; 1323 } 1222 1324 }; 1223 1325 alias st_mysql_stmt MYSQL_STMT; … … 1319 1421 void mysql_close(MYSQL *sock); 1320 1422 uint net_safe_read(MYSQL* mysql); 1423 1424 const uint NOT_NULL_FLAG = 1; /* Field can't be NULL */ 1425 const uint PRI_KEY_FLAG = 2; /* Field is part of a primary key */ 1426 const uint UNIQUE_KEY_FLAG = 4; /* Field is part of a unique key */ 1427 const uint MULTIPLE_KEY_FLAG = 8; /* Field is part of a key */ 1428 const uint BLOB_FLAG = 16; /* Field is a blob */ 1429 const uint UNSIGNED_FLAG = 32; /* Field is unsigned */ 1430 const uint ZEROFILL_FLAG = 64; /* Field is zerofill */ 1431 const uint BINARY_FLAG = 128; /* Field is binary */ 1432 1433 const int MYSQL_NO_DATA = 100; 1434 const int MYSQL_DATA_TRUNCATED = 101; 1435 1436 } trunk/bbconv/dbi/odbc/OdbcDatabase.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 * Modified:7 * 2006-11-01 Added some casts around nulls.8 *9 3 * Copyright: BSD license 10 4 */ … … 15 9 // WindowsAPI should also include odbc32.lib itself. 16 10 17 version (Ares) { 18 private static import std.array; 19 debug (UnitTest) private import std.io.Console; 11 version (dbi_odbc) { 12 13 version (Phobos) { 14 private static import std.string; 15 debug (UnitTest) private static import std.stdio; 20 16 } else { 21 private static import std.string;22 debug (UnitTest) private import std.stdio;17 private static import tango.text.Util; 18 debug (UnitTest) private static import tango.io.Stdout; 23 19 } 24 20 private import dbi.Database, dbi.DBIException, dbi.Result; … … 27 23 debug (UnitTest) private import dbi.Row, dbi.Statement; 28 24 29 pragma (lib, "odbc32.lib");25 version (Windows) pragma (lib, "odbc32.lib"); 30 26 31 27 private SQLHENV environment; … … 107 103 * Connect to a database using ODBC. 108 104 * 109 * This function will connect DSN-lessly if params has a "="and with DSN110 * otherwise. For information on how to use connect DSN-lessly, see the105 * This function will connect without DSN if params has a '=' and with DSN 106 * otherwise. For information on how to use connect without DSN, see the 111 107 * ODBC documentation. 112 108 * 113 109 * Bugs: 114 * Connecting DSN-lesslyignores username and password.110 * Connecting without DSN ignores username and password. 115 111 * 116 112 * Params: … … 135 131 SQLCHAR[1024] buffer; 136 132 137 if (!SQL_SUCCEEDED(SQLDriverConnect(connection, null, cast(SQLCHAR*)params , cast(SQLSMALLINT)params.length, buffer, buffer.length, null, SQL_DRIVER_COMPLETE))) {133 if (!SQL_SUCCEEDED(SQLDriverConnect(connection, null, cast(SQLCHAR*)params.ptr, cast(SQLSMALLINT)params.length, buffer.ptr, buffer.length, null, SQL_DRIVER_COMPLETE))) { 138 134 throw new DBIException("Unable to connect to the database. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 139 135 } … … 141 137 142 138 void connectWithDSN () { 143 if (!SQL_SUCCEEDED(SQLConnect(connection, cast(SQLCHAR*)params , cast(SQLSMALLINT)params.length, cast(SQLCHAR*)username, cast(SQLSMALLINT)username.length, cast(SQLCHAR*)password, cast(SQLSMALLINT)password.length))) {139 if (!SQL_SUCCEEDED(SQLConnect(connection, cast(SQLCHAR*)params.ptr, cast(SQLSMALLINT)params.length, cast(SQLCHAR*)username.ptr, cast(SQLSMALLINT)username.length, cast(SQLCHAR*)password.ptr, cast(SQLSMALLINT)password.length))) { 144 140 throw new DBIException("Unable to connect to the database. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 145 141 } 146 142 } 147 143 148 version (Ares) { 149 if (std.regexp.find(params, "=") == size_t.max) { 150 connectWithDSN(); 151 } else { 152 connectWithoutDSN(); 153 } 154 } else { 144 version (Phobos) { 155 145 if (std.string.find(params, "=") == -1) { 156 146 connectWithDSN(); … … 158 148 connectWithoutDSN(); 159 149 } 160 } 161 150 } else { 151 if (tango.text.Util.contains(params, '=')) { 152 connectWithoutDSN(); 153 } else { 154 connectWithDSN(); 155 } 156 } 162 157 } 163 158 … … 200 195 throw new DBIException("Unable to destroy an ODBC statement. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 201 196 } 202 scope (failure) 197 scope (failure) 203 198 if (!SQL_SUCCEEDED(SQLEndTran(SQL_HANDLE_DBC, connection, SQL_ROLLBACK))) { 204 199 throw new DBIException("Unable to rollback after a query failure. ODBC returned " ~ getLastErrorMessage, sql, getLastErrorCode); … … 207 202 throw new DBIException("Unable to create an ODBC statement. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 208 203 } 209 if (!SQL_SUCCEEDED(SQLExecDirect(stmt, cast(SQLCHAR*)sql , sql.length))) {204 if (!SQL_SUCCEEDED(SQLExecDirect(stmt, cast(SQLCHAR*)sql.ptr, sql.length))) { 210 205 throw new DBIException("Unable to execute SQL code. ODBC returned " ~ getLastErrorMessage, sql, getLastErrorCode); 211 206 } 212 207 213 208 } 214 209 … … 238 233 throw new DBIException("Unable to destroy an ODBC statement. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 239 234 } 240 scope (failure) 235 scope (failure) 241 236 if (!SQL_SUCCEEDED(SQLEndTran(SQL_HANDLE_DBC, connection, SQL_ROLLBACK))) { 242 237 throw new DBIException("Unable to rollback after a query failure. ODBC returned " ~ getLastErrorMessage, sql, getLastErrorCode); … … 245 240 throw new DBIException("Unable to create an ODBC statement. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 246 241 } 247 if (SQL_SUCCEEDED(SQLExecDirect(stmt, cast(SQLCHAR*)sql , sql.length))) {242 if (SQL_SUCCEEDED(SQLExecDirect(stmt, cast(SQLCHAR*)sql.ptr, sql.length))) { 248 243 return new OdbcResult(stmt); 249 244 } else { … … 278 273 deprecated override char[] getErrorMessage () { 279 274 return getLastErrorMessage(); 280 }275 } 281 276 282 277 /* … … 299 294 SQLRETURN ret = SQL_SUCCESS; 300 295 301 while (SQL_SUCCEEDED(ret = SQLDrivers(environment, direction, driver , driver.length, &driverLength, attr, attr.length, &attrLength))) {296 while (SQL_SUCCEEDED(ret = SQLDrivers(environment, direction, driver.ptr, driver.length, &driverLength, attr.ptr, attr.length, &attrLength))) { 302 297 direction = SQL_FETCH_NEXT; 303 298 driverList ~= driver[0 .. driverLength] ~ cast(SQLCHAR[])" ~ " ~ attr[0 .. attrLength]; … … 324 319 SQLRETURN ret = SQL_SUCCESS; 325 320 326 while (SQL_SUCCEEDED(ret = SQLDataSources(environment, direction, dsn , dsn.length, &dsnLength, desc, desc.length, &descLength))) {321 while (SQL_SUCCEEDED(ret = SQLDataSources(environment, direction, dsn.ptr, dsn.length, &dsnLength, desc.ptr, desc.length, &descLength))) { 327 322 if (ret == SQL_SUCCESS_WITH_INFO) { 328 323 throw new DBIException("Data truncation occurred in the data source list. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); … … 352 347 353 348 SQLGetDiagField(SQL_HANDLE_DBC, connection, 0, SQL_DIAG_NUMBER, &errorNumber, 0, null); 354 SQLGetDiagRec(SQL_HANDLE_DBC, connection, errorNumber, state , &nativeCode, text, text.length, &textLength);349 SQLGetDiagRec(SQL_HANDLE_DBC, connection, errorNumber, state.ptr, &nativeCode, text.ptr, text.length, &textLength); 355 350 return cast(char[])state ~ " = " ~ cast(char[])text; 356 351 } … … 370 365 371 366 SQLGetDiagField(SQL_HANDLE_DBC, connection, 0, SQL_DIAG_NUMBER, &errorNumber, 0, null); 372 SQLGetDiagRec(SQL_HANDLE_DBC, connection, errorNumber, state , &nativeCode, text, text.length, &textLength);367 SQLGetDiagRec(SQL_HANDLE_DBC, connection, errorNumber, state.ptr, &nativeCode, text.ptr, text.length, &textLength); 373 368 return nativeCode; 374 369 } … … 376 371 377 372 unittest { 378 version ( Ares) {373 version (Phobos) { 379 374 void s1 (char[] s) { 380 Cout("" ~ s ~ "\n");375 std.stdio.writefln("%s", s); 381 376 } 382 377 383 378 void s2 (char[] s) { 384 Cout(" ..." ~ s ~ "\n");379 std.stdio.writefln(" ...%s", s); 385 380 } 386 381 } else { 387 382 void s1 (char[] s) { 388 writefln("%s", s);383 tango.io.Stdout.Stdout(s).newline(); 389 384 } 390 385 391 386 void s2 (char[] s) { 392 writefln(" ...%s", s);387 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 393 388 } 394 389 } … … 441 436 delete db; 442 437 } 438 439 } trunk/bbconv/dbi/odbc/OdbcResult.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 * Modified:7 * 2006-11-01 Fixed an array bounds exception on null data.8 * 2006-11-01 Fixed a problem that sometimes caused the column name to be "".9 * 2006-11-01 Added some casts around nulls.10 *11 3 * Copyright: BSD license 12 4 */ … … 17 9 // WindowsAPI should also include odbc32.lib itself. 18 10 19 version (Ares) { 20 private static import std.regexp; 11 version (dbi_odbc) { 12 13 version (Phobos) { 14 private import std.string : trim = strip; 21 15 } else { 22 private import std.string : strip;16 private import tango.text.Util : trim; 23 17 } 24 18 private import dbi.DBIException, dbi.Result, dbi.Row; 25 19 private import win32.odbcinst, win32.sql, win32.sqlext, win32.sqltypes, win32.sqlucode, win32.windef; 26 20 27 pragma (lib, "odbc32.lib");21 version (Windows) pragma (lib, "odbc32.lib"); 28 22 29 23 /* … … 61 55 throw new DBIException("Unable to get the SQL column types. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 62 56 } 63 if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_TYPE_NAME, typeName , typeName.length, &typeNameLength, null))) {57 if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_TYPE_NAME, typeName.ptr, typeName.length, &typeNameLength, null))) { 64 58 throw new DBIException("Unable to get the SQL column type names. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 65 59 } 66 if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_NAME, columnName , columnName.length, &columnNameLength, null))) {60 if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_NAME, columnName.ptr, columnName.length, &columnNameLength, null))) { 67 61 throw new DBIException("Unable to get the SQL column names. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 68 62 } … … 81 75 */ 82 76 override Row fetchRow () { 83 version (Ares) {84 char[] strip (char[] string) {85 return std.regexp.sub(std.regexp.sub(string, "^[ \t\v\r\n\f]+", ""), " [\t\v\r\n\f]+$", "");86 }87 }88 89 77 if (SQL_SUCCEEDED(SQLFetch(stmt))) { 90 78 Row row = new Row(); … … 93 81 94 82 for (SQLUSMALLINT i = 1; i <= numColumns; i++) { 95 if (SQL_SUCCEEDED(SQLGetData(stmt, i, SQL_C_CHAR, buf , buf.length, &indicator))) {83 if (SQL_SUCCEEDED(SQLGetData(stmt, i, SQL_C_CHAR, buf.ptr, buf.length, &indicator))) { 96 84 if (indicator == SQL_NULL_DATA) { 97 85 buf[0 .. 4] = cast(SQLCHAR[])"null"; … … 101 89 row.addField(columnNames[i - 1], null, columnTypesName[i - 1], columnTypesNum[i - 1]); 102 90 } else { 103 row.addField(columnNames[i - 1], strip(cast(char[])buf[0 .. indicator]), columnTypesName[i - 1], columnTypesNum[i - 1]);91 row.addField(columnNames[i - 1], trim(cast(char[])buf[0 .. indicator]), columnTypesName[i - 1], columnTypesNum[i - 1]); 104 92 } 105 93 } … … 145 133 146 134 SQLGetDiagField(SQL_HANDLE_STMT, stmt, 0, SQL_DIAG_NUMBER, &errorNumber, 0, null); 147 SQLGetDiagRec(SQL_HANDLE_STMT, stmt, errorNumber, state , &nativeCode, text, text.length, &textLength);135 SQLGetDiagRec(SQL_HANDLE_STMT, stmt, errorNumber, state.ptr, &nativeCode, text.ptr, text.length, &textLength); 148 136 return cast(char[])state ~ " = " ~ cast(char[])text; 149 137 } … … 160 148 161 149 SQLGetDiagField(SQL_HANDLE_STMT, stmt, 0, SQL_DIAG_NUMBER, &errorNumber, 0, null); 162 SQLGetDiagRec(SQL_HANDLE_STMT, stmt, errorNumber, state , &nativeCode, text, text.length, &textLength);150 SQLGetDiagRec(SQL_HANDLE_STMT, stmt, errorNumber, state.ptr, &nativeCode, text.ptr, text.length, &textLength); 163 151 return nativeCode; 164 152 } 165 153 } 154 155 } trunk/bbconv/dbi/odbc/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 12 version (dbi_odbc) { 13 14 14 public import dbi.odbc.OdbcDatabase, 15 15 dbi.odbc.OdbcResult, 16 16 dbi.all; 17 18 } trunk/bbconv/dbi/oracle/OracleDatabase.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.oracle.OracleDatabase; 6 7 version (dbi_oracle) { 9 8 10 9 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; … … 71 70 */ 72 71 override void connect (char[] params, char[] username, char[] password) { 73 if (sword error = OCILogon(env, err, &svc, username , username.length, password, password.length, params, params.length) != OCI_SUCCESS) {72 if (sword error = OCILogon(env, err, &svc, username.ptr, username.length, password.ptr, password.length, params.ptr, params.length) != OCI_SUCCESS) { 74 73 throw new DBIException("Unable to connect to the Oracle database.", error); 75 74 } … … 153 152 OCIStmt* sql; 154 153 } 154 155 } trunk/bbconv/dbi/oracle/OracleResult.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.oracle.OracleResult; 6 7 version (dbi_oracle) { 9 8 10 9 private import dbi.DBIException, dbi.Result, dbi.Row; … … 20 19 public: 21 20 this () { 22 21 23 22 } 24 23 … … 37 36 */ 38 37 override void finish () { 39 38 40 39 } 41 40 42 41 private: 43 42 } 43 44 } trunk/bbconv/dbi/oracle/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 version (dbi_oracle) { 12 14 13 public import dbi.oracle.OracleDatabase, 15 14 dbi.oracle.OracleResult, 16 15 dbi.all; 16 17 } trunk/bbconv/dbi/oracle/imp/nzerror.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.nzerror; 15 16 17 version (dbi_oracle) { 16 18 17 19 /** … … 322 324 NZERROR_CERT_IN_CRL = 29178, /// Cert is in CRL - cert is revoked. 323 325 NZERROR_CERT_IN_CRL_CHECK_FAILED= 29179, /// Cert revocation check failed. 324 NZERROR_INVALID_CERT_STATUS_PROTOCOL = 29180, 326 NZERROR_INVALID_CERT_STATUS_PROTOCOL = 29180, 325 327 NZERROR_LDAP_OPEN_FAILED = 29181, /// ldap_open failed. 326 328 NZERROR_LDAP_BIND_FAILED = 29182, /// ldap_bind failed. … … 333 335 NZERROR_LDAP_NO_ENTRY_FOUND = 29189, /// No entry found in OID. 334 336 NZERROR_LDAP_MULTIPLE_ENTRIES_FOUND = 29190, /// Multiple entries in OID. 335 NZERROR_OID_INFO_NOT_SET = 29191, 337 NZERROR_OID_INFO_NOT_SET = 29191, 336 338 NZERROR_LDAP_VALMEC_NOT_SET = 29192, /// Validation mechanism not set in OID. 337 339 NZERROR_CRLDP_NO_CRL_FOUND = 29193, /// No CRL found using CRLDP mechanism. … … 419 421 // return ssl_error == SSLNoErr ? nzerror.NZERROR_OK : cast(nzerror)(ssl_error - SSLMemoryErr + cast(size_t)nzerror.NZERROR_SSLMemoryErr); 420 422 } 423 424 } trunk/bbconv/dbi/oracle/imp/nzt.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.nzt; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.nzerror; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.nzerror, dbi.oracle.imp.oratypes; 18 19 19 20 const uint NZT_MAX_SHA1 = 20; /// … … 143 144 /** 144 145 * Cert-version types. 145 * 146 * 146 147 * This is used to quickly look-up the cert-type. 147 148 */ … … 209 210 * 210 211 * Deprecated: 211 * 212 * 212 213 * 213 214 * What a persona will be used for? … … 263 264 * The flags_nzttBufferBlock member tells the function whether the 264 265 * buffer can be grown or not. If flags_nzttBufferBlock is 0, then 265 * the buffer will be realloc'ed automatically. 266 * the buffer will be realloc'ed automatically. 266 267 * 267 268 * The buflen_nzttBufferBLock member is set to the length of the … … 437 438 * wallet. The list of personas (and their associated identities) 438 439 * is built and stored into the wallet structure. 439 * 440 * Params: 441 * osscntxt = OSS context. 440 * 441 * Params: 442 * osscntxt = OSS context. 442 443 * wrllen = Length of WRL. 443 444 * wrl = WRL. 444 445 * pwdlen = Length of password. 445 446 * pwd = Password. 446 * wallet = Initialized wallet structure. 447 * 447 * wallet = Initialized wallet structure. 448 * 448 449 * Returns: 449 450 * NZERROR_OK Success. … … 463 464 * modified by an application but if it is not explicitly saved it 464 465 * reverts back to what was in the wallet. 465 * 466 * 466 467 * Params: 467 468 * osscntxt = OSS context. … … 491 492 * Retrieves a persona from the wallet based on the index number passed 492 493 * in. This persona is a COPY of the one stored in the wallet, therefore 493 * it is perfectly fine for the wallet to be closed after this call is 494 * it is perfectly fine for the wallet to be closed after this call is 494 495 * made. 495 496 * … … 497 498 * 498 499 * Params: 499 * osscntxt = OSS context. 500 * osscntxt = OSS context. 500 501 * wallet = Wallet. 501 502 * index = Which wallet index to remove (first persona is zero). … … 510 511 * Retrieve a persona based on its name. 511 512 * 512 * Retrieves a persona from the wallet based on the name of the persona. 513 * Retrieves a persona from the wallet based on the name of the persona. 513 514 * This persona is a COPY of the one stored in the wallet, therefore 514 515 * it is perfectly fine for the wallet to be closed after this call is … … 520 521 * osscntxt = OSS context. 521 522 * wallet = Wallet. 522 * name = Name of the persona 523 * name = Name of the persona 523 524 * persona = Persona found. 524 525 * … … 532 533 * 533 534 * Params: 534 * osscntxt = OSS context. 535 * osscntxt = OSS context. 535 536 * persona = Persona. 536 537 * … … 581 582 * Retrieve a trusted identity from a persona. 582 583 * 583 * Retrieves a trusted identity from the persona based on the index 584 * number passed in. This identity is a copy of the one stored in 584 * Retrieves a trusted identity from the persona based on the index 585 * number passed in. This identity is a copy of the one stored in 585 586 * the persona, therefore it is perfectly fine to close the persona 586 587 * after this call is made. 587 588 * 588 * The caller is responsible for freeing the memory of this object 589 * The caller is responsible for freeing the memory of this object 589 590 * by calling nztiAbortIdentity it is no longer needed. 590 591 * 591 592 * Params: 592 * osscntxt = OSS context. 593 * osscntxt = OSS context. 593 594 * persona = Persona. 594 595 * index = Which wallet index to remove (first element is zero). … … 604 605 * 605 606 * This function will only work for X.509 based persona which contain 606 * a private key. 607 * A copy of the private key is returned to the caller so that they do not 607 * a private key. 608 * A copy of the private key is returned to the caller so that they do not 608 609 * have to worry about the key changing "underneath them." 609 610 * Memory will be allocated for the vkey and therefore, the caller … … 627 628 * 628 629 * This funiction will only work for X.509 based persona which contain 629 * a certificate for the self identity. 630 * A copy of the certificate is returned to the caller so that they do not 630 * a certificate for the self identity. 631 * A copy of the certificate is returned to the caller so that they do not 631 632 * have to worry about the certificate changing "underneath them." 632 633 * Memory will be allocated for the cert and therefore, the caller … … 730 731 * 731 732 * Memory is allocated for the Identity Description. It 732 * is the caller's responsibility to free this memory by calling 733 * is the caller's responsibility to free this memory by calling 733 734 * nztiFreeIdentityDesc. 734 735 * … … 819 820 * persona = Persona. 820 821 * identity = Identity. 821 * validated = TRUE if identity was validated. 822 * validated = TRUE if identity was validated. 822 823 * 823 824 * Returns: … … 838 839 * input = The input. 839 840 * tdubuf = TDU buffer. 840 * 841 * 841 842 * Returns: 842 843 * NZERROR_OK Success. … … 896 897 * 897 898 * Params: 898 * osscntxt = OSS context. 899 * osscntxt = OSS context. 899 900 * persona = Persona. 900 901 * nrecipients = Number of recipients. … … 1108 1109 * 1109 1110 * Returns: 1110 * 1111 * 1111 1112 */ 1112 1113 extern (C) nzerror nztiGetSecInfo (nzctx* osscntxt, nzttPersona* persona, text** dname, ub4* dnamelen, text** issuername, ub4*, ub1**, ub4*); … … 1122 1123 * 1123 1124 * Returns: 1124 * 1125 * 1125 1126 */ 1126 1127 extern (C) nzerror nztiGetDName (nzctx* osscntxt, nzttIdentity* identity, text** dn, ub4* dnlen); … … 1136 1137 * 1137 1138 * Returns: 1138 * 1139 * 1139 1140 */ 1140 1141 extern (C) nzerror nztiGetIssuerName (nzctx* osscntxt, nzttIdentity* identity, text** issuername, ub4* issuernamelen); … … 1152 1153 * 1153 1154 * Returns: 1154 * 1155 * 1155 1156 */ 1156 1157 extern (C) nzerror nztgch_GetCertHash (nzctx* osscntxt, nzttIdentity* identity, ub1** certHash, ub4* hashLen); … … 1164 1165 * 1165 1166 * Returns: 1166 * 1167 * 1167 1168 */ 1168 1169 extern (C) nzerror nztdbuf_DestroyBuf (nzctx* osscntxt, dvoid** buf); … … 1178 1179 * 1179 1180 * Returns: 1180 * 1181 * 1181 1182 */ 1182 1183 extern (C) nzerror nztGetCertChain (nzctx* osscntxt, nzttWallet* ); … … 1234 1235 * targetIdentity = Target identity. 1235 1236 * sourceIdentity = Source identity. 1236 * 1237 * 1237 1238 * Returns: 1238 1239 * NZERROR_OK Success. … … 1248 1249 * target_ipriv = Target identityPrivate. 1249 1250 * source_ipriv = Source identityPrivate. 1250 * 1251 * 1251 1252 * Returns: 1252 1253 * NZERROR_OK Success. … … 1292 1293 * start_time = Start time of the certificate. 1293 1294 * end_time = End time of the certificate. 1294 * 1295 * 1295 1296 * Returns: 1296 1297 * NZERROR_OK Success. … … 1381 1382 * 1382 1383 * Params: 1383 * osscntxt = OSS context. 1384 * osscntxt = OSS context. 1384 1385 * persona = Persona. 1385 1386 * wallet = Wallet. … … 1454 1455 * osscntxt = Success. 1455 1456 * identity = Trusted Identity. 1456 * persona = Persona. 1457 * persona = Persona. 1457 1458 * 1458 1459 * Returns: … … 1512 1513 * 1513 1514 * Params: 1514 * osscntxt = OSS context. 1515 * osscntxt = OSS context. 1515 1516 * identity = Identity. 1516 1517 * … … 1824 1825 * An unknown parameter is missing from the documentation. 1825 1826 */ 1826 extern (C) nzerror nztGetVersion (nzctx*, nzttIdentity*, nzstrc*); 1827 extern (C) nzerror nztGetVersion (nzctx*, nzttIdentity*, nzstrc*); 1827 1828 1828 1829 /** … … 1849 1850 */ 1850 1851 extern (C) nzerror nztSearchNZDefault (nzctx*, boolean*); 1852 1853 } trunk/bbconv/dbi/oracle/imp/oci.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.oci; 15 16 17 version (dbi_oracle) { 18 19 version (Windows) { 20 pragma (lib, "oci.lib"); 21 } else version (linux) { 22 pragma (lib, "liboci.a"); 23 } else version (Posix) { 24 pragma (lib, "liboci.a"); 25 } else version (darwin) { 26 pragma (msg, "You will need to manually link in the Oracle library."); 27 } else { 28 pragma (msg, "You will need to manually link in the Oracle library."); 29 } 16 30 17 31 public import dbi.oracle.imp.nzerror, … … 269 283 const uint OCI_ATTR_RESERVED_2 = 147; /// Reserved. 270 284 271 285 272 286 const uint OCI_ATTR_SUBSCR_RECPT = 148; /// Recepient of subscription. 273 287 const uint OCI_ATTR_SUBSCR_RECPTPROTO = 149; /// Protocol for recepient. … … 371 385 372 386 const uint OCI_ATTR_CHNF_TABLENAMES = 401; /// Out: array of table names. 373 const uint OCI_ATTR_CHNF_ROWIDS = 402; /// In: rowids needed. 374 const uint OCI_ATTR_CHNF_OPERATIONS = 403; /// In: notification operation filter. 387 const uint OCI_ATTR_CHNF_ROWIDS = 402; /// In: rowids needed. 388 const uint OCI_ATTR_CHNF_OPERATIONS = 403; /// In: notification operation filter. 375 389 const uint OCI_ATTR_CHNF_CHANGELAG = 404; /// Txn lag between notifications. 376 390 … … 448 462 const uint OCI_SUCCESS = 0; /// Maps to SQL_SUCCESS of SAG CLI. 449 463 const uint OCI_SUCCESS_WITH_INFO = 1; /// Maps to SQL_SUCCESS_WITH_INFO. 450 const uint OCI_RESERVED_FOR_INT_USE = 200; /// Reserved. 464 const uint OCI_RESERVED_FOR_INT_USE = 200; /// Reserved. 451 465 const uint OCI_NO_DATA = 100; /// Maps to SQL_NO_DATA. 452 466 const int OCI_ERROR = -1; /// Maps to SQL_ERROR. … … 834 848 const uint OCI_ATTR_DISTINGUISHED_NAME = 300; /// Use DN as user name. 835 849 const uint OCI_ATTR_KERBEROS_TICKET = 301; /// Kerberos ticket as cred.. 836 850 837 851 const uint OCI_ATTR_ORA_DEBUG_JDWP = 302; /// ORA_DEBUG_JDWP attribute. 838 852 … … 1424 1438 * The offset in the lob data. The offset is specified in terms of bytes for 1425 1439 * BLOBs and BFILes. Character offsets are used for CLOBs, NCLOBs. 1426 * The maximum size of internal lob data is 4 gigabytes. FILE LOB 1440 * The maximum size of internal lob data is 4 gigabytes. FILE LOB 1427 1441 * size is limited by the operating system. 1428 1442 */ … … 1432 1446 * OCI Lob Length (of lob data). 1433 1447 * 1434 * Specifies the length of lob data in bytes for BLOBs and BFILes and in 1448 * Specifies the length of lob data in bytes for BLOBs and BFILes and in 1435 1449 * characters for CLOBs, NCLOBs. The maximum length of internal lob 1436 1450 * data is 4 gigabytes. The length of FILE LOBs is limited only by the … … 1444 1458 * The mode specifies the planned operations that will be performed on the 1445 1459 * FILE lob data. The FILE lob can be opened in read-only mode only. 1446 * 1460 * 1447 1461 * In the future, we may include read/write, append and truncate modes. Append 1448 1462 * is equivalent to read/write mode except that the FILE is positioned for … … 1684 1698 const uint OCI_MAJOR_VERSION = 10; /// Major release version. 1685 1699 const uint OCI_MINOR_VERSION = 2; /// Minor release version. 1700 1701 } trunk/bbconv/dbi/oracle/imp/oci1.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.oci1; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ociap; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.ociap, dbi.oracle.imp.oratypes; 18 19 19 20 /** … … 223 224 const uint OCI_EXTRACT_TYPE_INTEGER = 3; /// Key type is integer. 224 225 const uint OCI_EXTRACT_TYPE_OCINUM = 4; /// Key type is ocinum. 226 227 } trunk/bbconv/dbi/oracle/imp/oci8dp.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.oci8dp; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ocidfn, dbi.oracle.imp.oci; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oci, dbi.oracle.imp.oratypes; 18 19 19 20 /** … … 241 242 242 243 /** 243 * 244 * 244 245 * 245 246 * Params: … … 251 252 */ 252 253 extern (C) sword OCIDirPathStreamReset (OCIDirPathStream* dpstr, OCIError* errhp); 254 255 } trunk/bbconv/dbi/oracle/imp/ociap.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ociap; 16 15 17 private import std.c.stdarg; 16 version (dbi_oracle) { 17 18 version (Phobos) { 19 private import std.c.stdarg : va_list; 20 } else { 21 private import tango.stdc.stdarg : va_list; 22 } 18 23 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ocidfn, dbi.oracle.imp.nzt, dbi.oracle.imp.oci, dbi.oracle.imp.ort, dbi.oracle.imp.orl, dbi.oracle.imp.oro, dbi.oracle.imp.oci1; 19 24 … … 21 26 DESCRIPTION 22 27 ****************************************************************************** 23 Note: the descriptions of the functions are alphabetically arranged. Please 24 maintain the arrangement when adding a new function description. The actual 25 prototypes are below this comment section and do not follow any alphabetical 26 ordering. 28 Note: the descriptions of the functions are alphabetically arranged. Please 29 maintain the arrangement when adding a new function description. The actual 30 prototypes are below this comment section and do not follow any alphabetical 31 ordering. 27 32 28 33 … … 33 38 OCI Attribute Get 34 39 Purpose 35 This call is used to get a particular attribute of a handle. 40 This call is used to get a particular attribute of a handle. 36 41 Syntax 37 42 sword OCIAttrGet ( CONST dvoid *trgthndlp, … … 43 48 Comments 44 49 This call is used to get a particular attribute of a handle. 45 See Appendix B, "Handle Attributes", for a list of handle types and their 50 See Appendix B, "Handle Attributes", for a list of handle types and their 46 51 readable attributes. 47 52 Parameters 48 trgthndlp (IN) - is the pointer to a handle type. 49 trghndltyp (IN) - is the handle type. 50 attributep (OUT) - is a pointer to the storage for an attribute value. The 51 attribute value is filled in. 52 sizep (OUT) - is the size of the attribute value. 53 This can be passed in as NULL for most parameters as the size is well known. 54 For text* parameters, a pointer to a ub4 must be passed in to get the length 55 of the string. 53 trgthndlp (IN) - is the pointer to a handle type. 54 trghndltyp (IN) - is the handle type. 55 attributep (OUT) - is a pointer to the storage for an attribute value. The 56 attribute value is filled in. 57 sizep (OUT) - is the size of the attribute value. 58 This can be passed in as NULL for most parameters as the size is well known. 59 For text* parameters, a pointer to a ub4 must be passed in to get the length 60 of the string. 56 61 attrtype (IN) - is the type of attribute. 57 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 62 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 58 63 diagnostic information in the event of an error. 59 64 Related Functions … … 67 72 OCI Attribute Set 68 73 Purpose 69 This call is used to set a particular attribute of a handle or a descriptor. 74 This call is used to set a particular attribute of a handle or a descriptor. 70 75 Syntax 71 76 sword OCIAttrSet ( dvoid *trgthndlp, … … 76 81 OCIError *errhp ); 77 82 Comments 78 This call is used to set a particular attribute of a handle or a descriptor. 83 This call is used to set a particular attribute of a handle or a descriptor. 79 84 See Appendix B for a list of handle types and their writeable attributes. 80 85 Parameters 81 trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets 82 modified. 83 trghndltyp (IN/OUT) - is the handle type. 84 attributep (IN) - a pointer to an attribute value. 85 The attribute value is copied into the target handle. If the attribute value 86 trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets 87 modified. 88 trghndltyp (IN/OUT) - is the handle type. 89 attributep (IN) - a pointer to an attribute value. 90 The attribute value is copied into the target handle. If the attribute value 86 91 is a pointer, then only the pointer is copied, not the contents of the pointer. 87 size (IN) - is the size of an attribute value. This can be passed in as 0 for 92 size (IN) - is the size of an attribute value. This can be passed in as 0 for 88 93 most attributes as the size is already known by the OCI library. For text* 89 attributes, a ub4 must be passed in set to the length of the string. 94 attributes, a ub4 must be passed in set to the length of the string. 90 95 attrtype (IN) - the type of attribute being set. 91 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 92 diagnostic information in the event of an error. 96 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 97 diagnostic information in the event of an error. 93 98 Related Functions 94 99 OCIAttrGet() … … 108 113 sword OCIBindArrayOfStruct ( OCIBind *bindp, 109 114 OCIError *errhp, 110 ub4 pvskip, 111 ub4 indskip, 112 ub4 alskip, 115 ub4 pvskip, 116 ub4 indskip, 117 ub4 alskip, 113 118 ub4 rcskip ); 114 119 Comments 115 120 This call sets up the skip parameters necessary for a static array bind. 116 This call follows a call to OCIBindByName() or OCIBindByPos(). The bind 117 handle returned by that initial bind call is used as a parameter for the 121 This call follows a call to OCIBindByName() or OCIBindByPos(). The bind 122 handle returned by that initial bind call is used as a parameter for the 118 123 OCIBindArrayOfStruct() call. 119 For information about skip parameters, see the section "Arrays of Structures" 124 For information about skip parameters, see the section "Arrays of Structures" 120 125 on page 4-16. 121 126 Parameters 122 bindp (IN) - the handle to a bind structure. 123 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 127 bindp (IN) - the handle to a bind structure. 128 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 124 129 diagnostic information in the event of an error. 125 pvskip (IN) - skip parameter for the next data value. 126 indskip (IN) - skip parameter for the next indicator value or structure. 127 alskip (IN) - skip parameter for the next actual length value. 128 rcskip (IN) - skip parameter for the next column-level return code value. 130 pvskip (IN) - skip parameter for the next data value. 131 indskip (IN) - skip parameter for the next indicator value or structure. 132 alskip (IN) - skip parameter for the next actual length value. 133 rcskip (IN) - skip parameter for the next column-level return code value. 129 134 Related Functions 130 135 OCIAttrGet() … … 137 142 OCI Bind by Name 138 143 Purpose 139 Creates an association between a program variable and a placeholder in a SQL 144 Creates an association between a program variable and a placeholder in a SQL 140 145 statement or PL/SQL block. 141 146 Syntax 142 147 sword OCIBindByName ( 143 OCIStmt *stmtp, 148 OCIStmt *stmtp, 144 149 OCIBind **bindp, 145 150 OCIError *errhp, … … 153 158 ub2 *rcodep, 154 159 ub4 maxarr_len, 155 ub4 *curelep, 156 ub4 mode ); 160 ub4 *curelep, 161 ub4 mode ); 157 162 Description 158 This call is used to perform a basic bind operation. The bind creates an 159 association between the address of a program variable and a placeholder in a 160 SQL statement or PL/SQL block. The bind call also specifies the type of data 161 which is being bound, and may also indicate the method by which data will be 163 This call is used to perform a basic bind operation. The bind creates an 164 association between the address of a program variable and a placeholder in a 165 SQL statement or PL/SQL block. The bind call also specifies the type of data 166 which is being bound, and may also indicate the method by which data will be 162 167 provided at runtime. 163 This function also implicitly allocates the bind handle indicated by the bindp 168 This function also implicitly allocates the bind handle indicated by the bindp 164 169 parameter. 165 Data in an OCI application can be bound to placeholders statically or 166 dynamically. Binding is static when all the IN bind data and the OUT bind 167 buffers are well-defined just before the execute. Binding is dynamic when the 168 IN bind data and the OUT bind buffers are provided by the application on 169 demand at execute time to the client library. Dynamic binding is indicated by 170 Data in an OCI application can be bound to placeholders statically or 171 dynamically. Binding is static when all the IN bind data and the OUT bind 172 buffers are well-defined just before the execute. Binding is dynamic when the 173 IN bind data and the OUT bind buffers are provided by the application on 174 demand at execute time to the client library. Dynamic binding is indicated by 170 175 setting the mode parameter of this call to OCI_DATA_AT_EXEC. 171 Related Functions: For more information about dynamic binding, see 172 the section "Runtime Data Allocation and Piecewise Operations" on 176 Related Functions: For more information about dynamic binding, see 177 the section "Runtime Data Allocation and Piecewise Operations" on 173 178 page 5-16. 174 Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 175 which is implicitly allocated by the bind call A separate bind handle is 179 Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 180 which is implicitly allocated by the bind call A separate bind handle is 176 181 allocated for each placeholder the application is binding. 177 Additional bind calls may be required to specify particular attributes 178 necessary when binding certain data types or handling input data in certain 182 Additional bind calls may be required to specify particular attributes 183 necessary when binding certain data types or handling input data in certain 179 184 ways: 180 If arrays of structures are being utilized, OCIBindArrayOfStruct() must 185 If arrays of structures are being utilized, OCIBindArrayOfStruct() must 181 186 be called to set up the necessary skip parameters. 182 If data is being provided dynamically at runtime, and the application 183 will be using user-defined callback functions, OCIBindDynamic() must 187 If data is being provided dynamically at runtime, and the application 188 will be using user-defined callback functions, OCIBindDynamic() must 184 189 be called to register the callbacks. 185 If a named data type is being bound, OCIBindObject() must be called to 190 If a named data type is being bound, OCIBindObject() must be called to 186 191 specify additional necessary information. 187 192 Parameters 188 stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 193 stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 189 194 being processed. 190 bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 191 allocated by this call. The bind handle maintains all the bind information 192 for this particular input value. The handle is feed implicitly when the 195 bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 196 allocated by this call. The bind handle maintains all the bind information 197 for this particular input value. The handle is feed implicitly when the 193 198 statement handle is deallocated. 194 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 195 diagnostic information in the event of an error. 196 placeholder (IN) - the placeholder attributes are specified by name if 199 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 200 diagnostic information in the event of an error. 201 placeholder (IN) - the placeholder attributes are specified by name if 197 202 ocibindn() is being called. 198 203 placeh_len (IN) - the length of the placeholder name specified in placeholder. 199 valuep (IN/OUT) - a pointer to a data value or an array of data values of the 200 type specified in the dty parameter. An array of data values can be specified 201 for mapping into a PL/SQL table or for providing data for SQL multiple-row 202 operations. When an array of bind values is provided, this is called an array 203 bind in OCI terms. Additional attributes of the array bind (not bind to a 204 column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 205 For a REF, named data type bind, the valuep parameter is used only for IN 206 bind data. The pointers to OUT buffers are set in the pgvpp parameter 207 initialized by OCIBindObject(). For named data type and REF binds, the bind 208 values are unpickled into the Object Cache. The OCI object navigational calls 204 valuep (IN/OUT) - a pointer to a data value or an array of data values of the 205 type specified in the dty parameter. An array of data values can be specified 206 for mapping into a PL/SQL table or for providing data for SQL multiple-row 207 operations. When an array of bind values is provided, this is called an array 208 bind in OCI terms. Additional attributes of the array bind (not bind to a 209 column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 210 For a REF, named data type bind, the valuep parameter is used only for IN 211 bind data. The pointers to OUT buffers are set in the pgvpp parameter 212 initialized by OCIBindObject(). For named data type and REF binds, the bind 213 values are unpickled into the Object Cache. The OCI object navigational calls 209 214 can then be used to navigate the objects and the refs in the Object Cache. 210 If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 211 is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 212 OCIBindDynamic() must be invoked to provide callback functions if desired. 215 If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 216 is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 217 OCIBindDynamic() must be invoked to provide callback functions if desired. 213 218 value_sz (IN) - the size of a data value. In the case of an array bind, this is 214 the maximum size of any element possible with the actual sizes being specified 215 in the alenp parameter. 216 If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 219 the maximum size of any element possible with the actual sizes being specified 220 in the alenp parameter. 221 If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 217 222 size of the data that can be ever provided at runtime for data types other than 218 named data types or REFs. 219 dty (IN) - the data type of the value(s) being bound. Named data types 220 (SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 221 initialized in object mode. For named data types, or REFs, additional calls 223 named data types or REFs. 224 dty (IN) - the data type of the value(s) being bound. Named data types 225 (SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 226 initialized in object mode. For named data types, or REFs, additional calls 222 227 must be made with the bind handle to set up the datatype-specific attributes. 223 indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 224 types, this is a pointer to sb2 or an array of sb2s. For named data types, 225 this pointer is ignored and the actual pointer to the indicator structure or 226 an array of indicator structures is initialized by OCIBindObject(). 228 indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 229 types, this is a pointer to sb2 or an array of sb2s. For named data types, 230 this pointer is ignored and the actual pointer to the indicator structure or 231 an array of indicator structures is initialized by OCIBindObject(). 227 232 Ignored for dynamic binds. 228 See the section "Indicator Variables" on page 2-43 for more information about 233 See the section "Indicator Variables" on page 2-43 for more information about 229 234 indicator variables. 230 alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 231 element in alenp is the length of the data in the corresponding element in the 232 bind value array before and after the execute. This parameter is ignored for 235 alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 236 element in alenp is the length of the data in the corresponding element in the 237 bind value array before and after the execute. This parameter is ignored for 233 238 dynamic binds. 234 rcodep (OUT) - pointer to array of column level return codes. This parameter 239 rcodep (OUT) - pointer to array of column level return codes. This parameter 235 240 is ignored for dynamic binds. 236 maxarr_len (IN) - the maximum possible number of elements of type dty in a 237 PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 238 maxarr_len is non-zero, then either OCIBindDynamic() or 239 OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 240 curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 241 maxarr_len (IN) - the maximum possible number of elements of type dty in a 242 PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 243 maxarr_len is non-zero, then either OCIBindDynamic() or 244 OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 245 curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 241 246 is only required for PL/SQL binds. 242 247 mode (IN) - the valid modes for this parameter are: 243 248 OCI_DEFAULT. This is default mode. 244 OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 245 parameter defines the maximum size of the data that can be ever 246 provided at runtime. The application must be ready to provide the OCI 247 library runtime IN data buffers at any time and any number of times. 249 OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 250 parameter defines the maximum size of the data that can be ever 251 provided at runtime. The application must be ready to provide the OCI 252 library runtime IN data buffers at any time and any number of times. 248 253 Runtime data is provided in one of the two ways: 249 callbacks using a user-defined function which must be registered 250 with a subsequent call to OCIBindDynamic(). 251 a polling mechanism using calls supplied by the OCI. This mode 254 callbacks using a user-defined function which must be registered 255 with a subsequent call to OCIBindDynamic(). 256 a polling mechanism using calls supplied by the OCI. This mode 252 257 is assumed if no callbacks are defined. 253 For more information about using the OCI_DATA_AT_EXEC mode, see 254 the section "Runtime Data Allocation and Piecewise Operations" on 258 For more information about using the OCI_DATA_AT_EXEC mode, see 259 the section "Runtime Data Allocation and Piecewise Operations" on 255 260 page 5-16. 256 When the allocated buffers are not required any more, they should be 257 freed by the client. 261 When the allocated buffers are not required any more, they should be 262 freed by the client. 258 263 Related Functions 259 264 OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet() … … 268 273 OCI Bind by Position 269 274 Purpose 270 Creates an association between a program variable and a placeholder in a SQL 275 Creates an association between a program variable and a placeholder in a SQL 271 276 statement or PL/SQL block. 272 277 Syntax 273 sword OCIBindByPos ( 274 OCIStmt *stmtp, 278 sword OCIBindByPos ( 279 OCIStmt *stmtp, 275 280 OCIBind **bindp, 276 281 OCIError *errhp, … … 283 288 ub2 *rcodep, 284 289 ub4 maxarr_len, 285 ub4 *curelep, 290 ub4 *curelep, 286 291 ub4 mode); 287 292 288 293 Description 289 This call is used to perform a basic bind operation. The bind creates an 290 association between the address of a program variable and a placeholder in a 291 SQL statement or PL/SQL block. The bind call also specifies the type of data 292 which is being bound, and may also indicate the method by which data will be 294 This call is used to perform a basic bind operation. The bind creates an 295 association between the address of a program variable and a placeholder in a 296 SQL statement or PL/SQL block. The bind call also specifies the type of data 297 which is being bound, and may also indicate the method by which data will be 293 298 provided at runtime. 294 This function also implicitly allocates the bind handle indicated by the bindp 299 This function also implicitly allocates the bind handle indicated by the bindp 295 300 parameter. 296 Data in an OCI application can be bound to placeholders statically or 297 dynamically. Binding is static when all the IN bind data and the OUT bind 298 buffers are well-defined just before the execute. Binding is dynamic when the 299 IN bind data and the OUT bind buffers are provided by the application on 300 demand at execute time to the client library. Dynamic binding is indicated by 301 Data in an OCI application can be bound to placeholders statically or 302 dynamically. Binding is static when all the IN bind data and the OUT bind 303 buffers are well-defined just before the execute. Binding is dynamic when the 304 IN bind data and the OUT bind buffers are provided by the application on 305 demand at execute time to the client library. Dynamic binding is indicated by 301 306 setting the mode parameter of this call to OCI_DATA_AT_EXEC. 302 Related Functions: For more information about dynamic binding, see 303 the section "Runtime Data Allocation and Piecewise Operations" on 307 Related Functions: For more information about dynamic binding, see 308 the section "Runtime Data Allocation and Piecewise Operations" on 304 309 page 5-16 305 Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 306 which is implicitly allocated by the bind call A separate bind handle is 310 Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 311 which is implicitly allocated by the bind call A separate bind handle is 307 312 allocated for each placeholder the application is binding. 308 Additional bind calls may be required to specify particular attributes 309 necessary when binding certain data types or handling input data in certain 313 Additional bind calls may be required to specify particular attributes 314 necessary when binding certain data types or handling input data in certain 310 315 ways: 311 If arrays of structures are being utilized, OCIBindArrayOfStruct() must 316 If arrays of structures are being utilized, OCIBindArrayOfStruct() must 312 317 be called to set up the necessary skip parameters. 313 If data is being provided dynamically at runtime, and the application 314 will be using user-defined callback functions, OCIBindDynamic() must 318 If data is being provided dynamically at runtime, and the application 319 will be using user-defined callback functions, OCIBindDynamic() must 315 320 be called to register the callbacks. 316 If a named data type is being bound, OCIBindObject() must be called to 321 If a named data type is being bound, OCIBindObject() must be called to 317 322 specify additional necessary information. 318 323 Parameters 319 stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 324 stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 320 325 being processed. 321 bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 322 allocated by this call. The bind handle maintains all the bind information 323 for this particular input value. The handle is feed implicitly when the 326 bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 327 allocated by this call. The bind handle maintains all the bind information 328 for this particular input value. The handle is feed implicitly when the 324 329 statement handle is deallocated. 325 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 326 diagnostic information in the event of an error. 327 position (IN) - the placeholder attributes are specified by position if 330 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 331 diagnostic information in the event of an error. 332 position (IN) - the placeholder attributes are specified by position if 328 333 ocibindp() is being called. 329 valuep (IN/OUT) - a pointer to a data value or an array of data values of the 330 type specified in the dty parameter. An array of data values can be specified 331 for mapping into a PL/SQL table or for providing data for SQL multiple-row 332 operations. When an array of bind values is provided, this is called an array 333 bind in OCI terms. Additional attributes of the array bind (not bind to a 334 column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 335 For a REF, named data type bind, the valuep parameter is used only for IN 336 bind data. The pointers to OUT buffers are set in the pgvpp parameter 337 initialized by OCIBindObject(). For named data type and REF binds, the bind 338 values are unpickled into the Object Cache. The OCI object navigational calls 334 valuep (IN/OUT) - a pointer to a data value or an array of data values of the 335 type specified in the dty parameter. An array of data values can be specified 336 for mapping into a PL/SQL table or for providing data for SQL multiple-row 337 operations. When an array of bind values is provided, this is called an array 338 bind in OCI terms. Additional attributes of the array bind (not bind to a 339 column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 340 For a REF, named data type bind, the valuep parameter is used only for IN 341 bind data. The pointers to OUT buffers are set in the pgvpp parameter 342 initialized by OCIBindObject(). For named data type and REF binds, the bind 343 values are unpickled into the Object Cache. The OCI object navigational calls 339 344 can then be used to navigate the objects and the refs in the Object Cache. 340 If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 341 is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 342 OCIBindDynamic() must be invoked to provide callback functions if desired. 345 If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 346 is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 347 OCIBindDynamic() must be invoked to provide callback functions if desired. 343 348 value_sz (IN) - the size of a data value. In the case of an array bind, this is 344 349 the maximum size of any element possible with the actual sizes being specified 345 in the alenp parameter. 346 If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 350 in the alenp parameter. 351 If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 347 352 size of the data that can be ever provided at runtime for data types other than 348 named data types or REFs. 349 dty (IN) - the data type of the value(s) being bound. Named data types 350 (SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 351 initialized in object mode. For named data types, or REFs, additional calls 353 named data types or REFs. 354 dty (IN) - the data type of the value(s) being bound. Named data types 355 (SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 356 initialized in object mode. For named data types, or REFs, additional calls 352 357 must be made with the bind handle to set up the datatype-specific attributes. 353 indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 354 types, this is a pointer to sb2 or an array of sb2s. For named data types, 355 this pointer is ignored and the actual pointer to the indicator structure or 356 an array of indicator structures is initialized by OCIBindObject(). Ignored 358 indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 359 types, this is a pointer to sb2 or an array of sb2s. For named data types, 360 this pointer is ignored and the actual pointer to the indicator structure or 361 an array of indicator structures is initialized by OCIBindObject(). Ignored 357 362 for dynamic binds. 358 See the section "Indicator Variables" on page 2-43 for more information about 363 See the section "Indicator Variables" on page 2-43 for more information about 359 364 indicator variables. 360 alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 361 element in alenp is the length of the data in the corresponding element in the 362 bind value array before and after the execute. This parameter is ignored for 365 alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 366 element in alenp is the length of the data in the corresponding element in the 367 bind value array before and after the execute. This parameter is ignored for 363 368 dynamic binds. 364 rcodep (OUT) - pointer to array of column level return codes. This parameter 369 rcodep (OUT) - pointer to array of column level return codes. This parameter 365 370 is ignored for dynamic binds. 366 maxarr_len (IN) - the maximum possible number of elements of type dty in a 367 PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 368 maxarr_len is non-zero, then either OCIBindDynamic() or 369 OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 370 curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 371 maxarr_len (IN) - the maximum possible number of elements of type dty in a 372 PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 373 maxarr_len is non-zero, then either OCIBindDynamic() or 374 OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 375 curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 371 376 is only required for PL/SQL binds. 372 377 mode (IN) - the valid modes for this parameter are: 373 378 OCI_DEFAULT. This is default mode. 374 OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 375 parameter defines the maximum size of the data that can be ever 376 provided at runtime. The application must be ready to provide the OCI 377 library runtime IN data buffers at any time and any number of times. 379 OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 380 parameter defines the maximum size of the data that can be ever 381 provided at runtime. The application must be ready to provide the OCI 382 library runtime IN data buffers at any time and any number of times. 378 383 Runtime data is provided in one of the two ways: 379 callbacks using a user-defined function which must be registered 380 with a subsequent call to OCIBindDynamic() . 381 a polling mechanism using calls supplied by the OCI. This mode 384 callbacks using a user-defined function which must be registered 385 with a subsequent call to OCIBindDynamic() . 386 a polling mechanism using calls supplied by the OCI. This mode 382 387 is assumed if no callbacks are defined. 383 For more information about using the OCI_DATA_AT_EXEC mode, see 384 the section "Runtime Data Allocation and Piecewise Operations" on 388 For more information about using the OCI_DATA_AT_EXEC mode, see 389 the section "Runtime Data Allocation and Piecewise Operations" on 385 390 page 5-16. 386 When the allocated buffers are not required any more, they should be 387 freed by the client. 391 When the allocated buffers are not required any more, they should be 392 freed by the client. 388 393 Related Functions 389 394 OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet() … … 397 402 OCI Bind Dynamic Attributes 398 403 Purpose 399 This call is used to register user callbacks for dynamic data allocation. 404 This call is used to register user callbacks for dynamic data allocation. 400 405 Syntax 401 406 sword OCIBindDynamic( OCIBind *bindp, 402 407 OCIError *errhp, 403 dvoid *ictxp, 408 dvoid *ictxp, 404 409 OCICallbackInBind (icbfp)( 405 410 dvoid *ictxp, 406 411 OCIBind *bindp, 407 ub4 iter, 408 ub4 index, 412 ub4 iter, 413 ub4 index, 409 414 dvoid **bufpp, 410 415 ub4 *alenp, 411 ub1 *piecep, 416 ub1 *piecep, 412 417 dvoid **indp ), 413 418 dvoid *octxp, … … 415 420 dvoid *octxp, 416 421 OCIBind *bindp, 417 ub4 iter, 418 ub4 index, 419 dvoid **bufp, 422 ub4 iter, 423 ub4 index, 424 dvoid **bufp, 420 425 ub4 **alenpp, 421 426 ub1 *piecep, 422 dvoid **indpp, 427 dvoid **indpp, 423 428 ub2 **rcodepp) ); 424 429 Comments 425 This call is used to register user-defined callback functions for providing 426 data for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a 427 previous call to OCIBindByName() or OCIBindByPos(). 428 The callback function pointers must return OCI_CONTINUE if it the call is 429 successful. Any return code other than OCI_CONTINUE signals that the client 430 This call is used to register user-defined callback functions for providing 431 data for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a 432 previous call to OCIBindByName() or OCIBindByPos(). 433 The callback function pointers must return OCI_CONTINUE if it the call is 434 successful. Any return code other than OCI_CONTINUE signals that the client 430 435 wishes to abort processing immediately. 431 For more information about the OCI_DATA_AT_EXEC mode, see the section 436 For more information about the OCI_DATA_AT_EXEC mode, see the section 432 437 "Runtime Data Allocation and Piecewise Operations" on page 5-16. 433 438 Parameters 434 bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or 435 OCIBindByPos(). 436 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 437 diagnostic information in the event of an error. 438 ictxp (IN) - the context pointer required by the call back function icbfp. 439 icbfp (IN) - the callback function which returns a pointer to the IN bind 440 value or piece at run time. The callback takes in the following parameters. 441 ictxp (IN/OUT) - the context pointer for this callback function. 442 bindp (IN) - the bind handle passed in to uniquely identify this bind 443 variable. 444 iter (IN) - 1-based execute iteration value. 445 index (IN) - index of the current array, for an array bind. 1 based not 446 greater than curele parameter of the bind call. 447 index (IN) - index of the current array, for an array bind. This parameter 448 is 1-based, and may not be greater than curele parameter of the bind call. 449 bufpp (OUT) - the pointer to the buffer. 450 piecep (OUT) - which piece of the bind value. This can be one of the 451 following values - OCI_ONE_PIECE, OCI_FIRST_PIECE, 439 bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or 440 OCIBindByPos(). 441 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 442 diagnostic information in the event of an error. 443 ictxp (IN) - the context pointer required by the call back function icbfp. 444 icbfp (IN) - the callback function which returns a pointer to the IN bind 445 value or piece at run time. The callback takes in the following parameters. 446 ictxp (IN/OUT) - the context pointer for this callback function. 447 bindp (IN) - the bind handle passed in to uniquely identify this bind 448 variable. 449 iter (IN) - 1-based execute iteration value. 450 index (IN) - index of the current array, for an array bind. 1 based not 451 greater than curele parameter of the bind call. 452 index (IN) - index of the current array, for an array bind. This parameter 453 is 1-based, and may not be greater than curele parameter of the bind call. 454 bufpp (OUT) - the pointer to the buffer. 455 piecep (OUT) - which piece of the bind value. This can be one of the 456 following values - OCI_ONE_PIECE, OCI_FIRST_PIECE, 452 457 OCI_NEXT_PIECE and OCI_LAST_PIECE. 453 indp (OUT) - contains the indicator value. This is apointer to either an 454 sb2 value or a pointer to an indicator structure for binding named data 455 types. 456 indszp (OUT) - contains the indicator value size. A pointer containing 457 the size of either an sb2 or an indicator structure pointer. 458 octxp (IN) - the context pointer required by the callback function ocbfp. 459 ocbfp (IN) - the callback function which returns a pointer to the OUT bind 460 value or piece at run time. The callback takes in the following parameters. 461 octxp (IN/OUT) - the context pointer for this call back function. 462 bindp (IN) - the bind handle passed in to uniquely identify this bind 463 variable. 464 iter (IN) - 1-based execute iteration value. 465 index (IN) - index of the current array, for an array bind. This parameter 466 is 1-based, and must not be greater than curele parameter of the bind call. 467 bufpp (OUT) - a pointer to a buffer to write the bind value/piece. 468 buflp (OUT) - returns the buffer size. 469 alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind 470 value/piece after it has been read. 471 piecep (IN/OUT) - which piece of the bind value. It will be set by the 472 library to be one of the following values - OCI_ONE_PIECE or 473 OCI_NEXT_PIECE. The callback function can leave it unchanged or set 474 it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default - 475 OCI_ONE_PIECE. 476 indpp (OUT) - returns a pointer to contain the indicator value which 477 either an sb2 value or a pointer to an indicator structure for named data 478 types. 479 indszpp (OUT) - returns a pointer to return the size of the indicator 480 value which is either size of an sb2 or size of an indicator structure. 481 rcodepp (OUT) - returns a pointer to contains the return code. 458 indp (OUT) - contains the indicator value. This is apointer to either an 459 sb2 value or a pointer to an indicator structure for binding named data 460 types. 461 indszp (OUT) - contains the indicator value size. A pointer containing 462 the size of either an sb2 or an indicator structure pointer. 463 octxp (IN) - the context pointer required by the callback function ocbfp. 464 ocbfp (IN) - the callback function which returns a pointer to the OUT bind 465 value or piece at run time. The callback takes in the following parameters. 466 octxp (IN/OUT) - the context pointer for this call back function. 467 bindp (IN) - the bind handle passed in to uniquely identify this bind 468 variable. 469 iter (IN) - 1-based execute iteration value. 470 index (IN) - index of the current array, for an array bind. This parameter 471 is 1-based, and must not be greater than curele parameter of the bind call. 472 bufpp (OUT) - a pointer to a buffer to write the bind value/piece. 473 buflp (OUT) - returns the buffer size. 474 alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind 475 value/piece after it has been read. 476 piecep (IN/OUT) - which piece of the bind value. It will be set by the 477 library to be one of the following values - OCI_ONE_PIECE or 478 OCI_NEXT_PIECE. The callback function can leave it unchanged or set 479 it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default - 480 OCI_ONE_PIECE. 481 indpp (OUT) - returns a pointer to contain the indicator value which 482 either an sb2 value or a pointer to an indicator structure for named data 483 types. 484 indszpp (OUT) - returns a pointer to return the size of the indicator 485 value which is either size of an sb2 or size of an indicator structure. 486 rcodepp (OUT) - returns a pointer to contains the return code. 482 487 Related Functions 483 488 OCIAttrGet() … … 491 496 OCI Bind Object 492 497 Purpose 493 This function sets up additional attributes which are required for a named 498 This function sets up additional attributes which are required for a named 494 499 data type (object) bind. 495 500 Syntax 496 501 sword OCIBindObject ( OCIBind *bindp, 497 OCIError *errhp, 502 OCIError *errhp, 498 503 CONST OCIType *type, 499 dvoid **pgvpp, 500 ub4 *pvszsp, 501 dvoid **indpp, 504 dvoid **pgvpp, 505 ub4 *pvszsp, 506 dvoid **indpp, 502 507 ub4 *indszp, ); 503 508 Comments 504 This function sets up additional attributes which binding a named data type 505 or a REF. An error will be returned if this function is called when the OCI 506 environment has been initialized in non-object mode. 507 This call takes as a paramter a type descriptor object (TDO) of datatype 508 OCIType for the named data type being defined. The TDO can be retrieved 509 This function sets up additional attributes which binding a named data type 510 or a REF. An error will be returned if this function is called when the OCI 511 environment has been initialized in non-object mode. 512 This call takes as a paramter a type descriptor object (TDO) of datatype 513 OCIType for the named data type being defined. The TDO can be retrieved 509 514 with a call to OCITypeByName(). 510 If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the 511 pointers to the IN buffers are obtained either using the callback icbfp 512 registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call. 513 The buffers are dynamically allocated for the OUT data and the pointers to 514 these buffers are returned either by calling ocbfp() registered by the 515 OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed 516 in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned 517 OCI_NEED_DATA. The memory of these client library- allocated buffers must be 515 If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the 516 pointers to the IN buffers are obtained either using the callback icbfp 517 registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call. 518 The buffers are dynamically allocated for the OUT data and the pointers to 519 these buffers are returned either by calling ocbfp() registered by the 520 OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed 521 in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned 522 OCI_NEED_DATA. The memory of these client library- allocated buffers must be 518 523 freed when not in use anymore by using the OCIObjectFreee() call. 519 524 Parameters 520 bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName() 521 or OCIBindByPos(). 522 errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for 525 bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName() 526 or OCIBindByPos(). 527 errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for 523 528 diagnostic information in the event of an error. 524 type ( IN) - points to the TDO which describes the type of the program 529 type ( IN) - points to the TDO which describes the type of the program 525 530 variable being bound. Retrieved by calling OCITypeByName(). 526 pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an 527 array, pgvpp points to an array of pointers. When the bind variable is also an 528 OUT variable, the OUT Named Data Type value or REF is allocated 531 pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an 532 array, pgvpp points to an array of pointers. When the bind variable is also an 533 OUT variable, the OUT Named Data Type value or REF is allocated 529 534 (unpickled) in the Object Cache, and a pointer to the value or REF is returned, 530 At the end of execute, when all OUT values have been received, pgvpp points 531 to an array of pointer(s) to these newly allocated named data types in the 532 object cache. 533 pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named 534 Data Type buffers are requested at runtime. For static array binds, skip 535 factors may be specified using the OCIBindArrayOfStruct() call. The skip 536 factors are used to compute the address of the next pointer to the value, the 535 At the end of execute, when all OUT values have been received, pgvpp points 536 to an array of pointer(s) to these newly allocated named data types in the 537 object cache. 538 pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named 539 Data Type buffers are requested at runtime. For static array binds, skip 540 factors may be specified using the OCIBindArrayOfStruct() call. The skip 541 factors are used to compute the address of the next pointer to the value, the 537 542 indicator structure and their sizes. 538 pvszsp ( IN/OUT) - points to the size of the program variable. The size of the 539 named data type is not required on input. For an array, pvszsp is an array of 540 ub4s. On return, for OUT bind variables, this points to size(s) of the Named 541 Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC 543 pvszsp ( IN/OUT) - points to the size of the program variable. The size of the 544 named data type is not required on input. For an array, pvszsp is an array of 545 ub4s. On return, for OUT bind variables, this points to size(s) of the Named 546 Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC 542 547 mode is set. Then the size of the buffer is taken at runtime. 543 indpp ( IN/OUT) - points to a pointer to the program variable buffer 544 containing the parallel indicator structure. For an array, points to an array 545 of pointers. When the bind variable is also an OUT bind variable, memory is 546 allocated in the object cache, to store the unpickled OUT indicator values. At 547 the end of the execute when all OUT values have been received, indpp points 548 to the pointer(s) to these newly allocated indicator structure(s). 549 indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 548 indpp ( IN/OUT) - points to a pointer to the program variable buffer 549 containing the parallel indicator structure. For an array, points to an array 550 of pointers. When the bind variable is also an OUT bind variable, memory is 551 allocated in the object cache, to store the unpickled OUT indicator values. At 552 the end of the execute when all OUT values have been received, indpp points 553 to the pointer(s) to these newly allocated indicator structure(s). 554 indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 550 555 is requested at runtime. 551 indszp ( IN/OUT) - points to the size of the IN indicator structure program 552 variable. For an array, it is an array of sb2s. On return for OUT bind 556 indszp ( IN/OUT) - points to the size of the IN indicator structure program 557 variable. For an array, it is an array of sb2s. On return for OUT bind 553 558 variables, this points to size(s) of the received OUT indicator structures. 554 indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 559 indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 555 560 size is requested at runtime. 556 561 Related Functions … … 566 571 OCI Break 567 572 Purpose 568 This call performs an immediate (asynchronous) abort of any currently 573 This call performs an immediate (asynchronous) abort of any currently 569 574 executing OCI function that is associated with a server . 570 575 Syntax … … 572 577 OCIError *errhp); 573 578 Comments 574 This call performs an immediate (asynchronous) abort of any currently 575 executing OCI function that is associated with a server. It is normally used 579 This call performs an immediate (asynchronous) abort of any currently 580 executing OCI function that is associated with a server. It is normally used 576 581 to stop a long-running OCI call being processed on the server. 577 This call can take either the service context handle or the server context 582 This call can take either the service context handle or the server context 578 583 handle as a parameter to identify the function to be aborted. 579 584 Parameters 580 585 hndlp (IN) - the service context handle or the server context handle. 581 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 586 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 582 587 diagnostic information in the event of an error. 583 588 Related Functions … … 592 597 Syntax: 593 598 OCIConnectionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp, 594 OraText **poolName, sb4 *poolNameLen, 599 OraText **poolName, sb4 *poolNameLen, 595 600 CONST Oratext *dblink, sb4 dblinkLen, 596 601 ub4 connMin, ub4 connMax, ub4 connIncr, 597 602 CONST OraText *poolUsername, sb4 poolUserLen, 598 CONST OraText *poolPassword, sb4 poolPassLen, 603 CONST OraText *poolPassword, sb4 poolPassLen, 599 604 ub4 mode) 600 605 Comments: … … 607 612 errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet(). 608 613 poolhp (IN/OUT) - An uninitialiazed pool handle. 609 poolName (OUT) - The connection pool name. 610 poolNameLen (OUT) - The length of the connection pool name 614 poolName (OUT) - The connection pool name. 615 poolNameLen (OUT) - The length of the connection pool name 611 616 dblink (IN/OUT) - Specifies the database(server) to connect. This will also 612 617 be used as the default pool name. … … 630 635 poolPassLen (IN) - This represents the length of pool_password. 631 636 632 mode (IN) - The modes supported are OCI_DEFAULT and 633 OCI_CPOOL_REINITIALIZE 637 mode (IN) - The modes supported are OCI_DEFAULT and 638 OCI_CPOOL_REINITIALIZE 634 639 635 640 Related Functions … … 663 668 ----------------------------------------------------------------------------- 664 669 ----------------------------OCISessionPoolCreate----------------------------- 665 Name: 670 Name: 666 671 OCISessionPoolCreate 667 672 … … 670 675 671 676 Syntax: 672 sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp, 673 OraText **poolName, ub4 *poolNameLen, 677 sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp, 678 OraText **poolName, ub4 *poolNameLen, 674 679 CONST OraText *connStr, ub4 connStrLen, 675 680 ub4 sessMin, ub4 sessMax, ub4 sessIncr, … … 805 810 specified. In this case, the session is labelled with this tag and 806 811 returned to the pool. If this is NULL, then the session is untagged. 807 tag_len (IN) - Length of the tag. This is ignored unless mode 812 tag_len (IN) - Length of the tag. This is ignored unless mode 808 813 OCI_RLS_SPOOL_RETAG is set. 809 814 mode (IN) - The supported modes are OCI_DEFAULT, OCI_RLS_SPOOL_DROPSESS, 810 815 OCI_RLS_SPOOL_RETAG. The last 2 are only valid for Session Pooling. 811 816 When OCI_RLS_SPOOL_DROPSESS is specified, the session 812 will be removed from the session pool. If OCI_RLS_SPOOL_RETAG 813 is set, the tag on the session will be altered. If this mode is 817 will be removed from the session pool. If OCI_RLS_SPOOL_RETAG 818 is set, the tag on the session will be altered. If this mode is 814 819 not set, the tag and tag_len parameters will be ignored. 815 820 … … 822 827 ----------------------------------------------------------------------------- 823 828 ------------------------------OCIDateTimeAssign -------------------------- 824 sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 829 sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 825 830 OCIDateTime *to); 826 831 NAME: OCIDateTimeAssign - OCIDateTime Assignment … … 838 843 839 844 ------------------------------OCIDateTimeCheck---------------------------- 840 sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 845 sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 841 846 ub4 *valid ); 842 847 NAME: OCIDateTimeCheck - OCIDateTime CHecK if the given date is valid 843 848 PARAMETERS: 844 hndl (IN) - Session/Env handle. 849 hndl (IN) - Session/Env handle. 845 850 err (IN/OUT) - error handle. If there is an error, it is 846 851 recorded in 'err' and this function returns OCI_ERROR. … … 848 853 OCIErrorGet(). 849 854 date (IN) - date to be checked 850 valid (OUT) - returns zero for a valid date, otherwise 855 valid (OUT) - returns zero for a valid date, otherwise 851 856 the ORed combination of all error bits specified below: 852 857 Macro name Bit number Error … … 884 889 885 890 ------------------------------- OCIDateTimeCompare---------------------------- 886 sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 891 sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 887 892 CONST OCIDateTime *date2, sword *result ); 888 893 NAME: OCIDateTimeCompare - OCIDateTime CoMPare dates 889 894 PARAMETERS: 890 hndl (IN) - Session/Env handle. 895 hndl (IN) - Session/Env handle. 891 896 err (IN/OUT) - error handle. If there is an error, it is 892 897 recorded in 'err' and this function returns OCI_ERROR. … … 894 899 OCIErrorGet(). 895 900 date1, date2 (IN) - dates to be compared 896 result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 901 result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 897 902 1 if date1 > date2 898 903 DESCRIPTION: 899 The function OCIDateCompare compares two dates. It returns -1 if 900 date1 is smaller than date2, 0 if they are equal, and 1 if date1 is 904 The function OCIDateCompare compares two dates. It returns -1 if 905 date1 is smaller than date2, 0 if they are equal, and 1 if date1 is 901 906 greater than date2. 902 907 RETURNS: … … 908 913 909 914 ------------------------------OCIDateTimeConvert---------------------- 910 sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, 915 sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, 911 916 OCIDateTime *outdate); 912 917 NAME: OCIDateTimeConvert - Conversion between different DATETIME types 913 918 PARAMETERS: 914 hndl (IN) - Session/Env handle. 919 hndl (IN) - Session/Env handle. 915 920 err (IN/OUT) - error handle. If there is an error, it is 916 921 recorded in 'err' and this function returns OCI_ERROR. … … 918 923 OCIErrorGet(). 919 924 indate (IN) - pointer to input date 920 outdate (OUT) - pointer to output datetime 925 outdate (OUT) - pointer to output datetime 921 926 DESCRIPTION: Converts one datetime type to another. The result type is 922 927 the type of the 'outdate' descriptor. … … 926 931 OCI_ERROR if 927 932 conversion not possible. 928 933 929 934 ---------------------------- OCIDateTimeFromText----------------------- 930 sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 935 sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 931 936 size_t d_str_length, CONST OraText *fmt, ub1 fmt_length, 932 937 CONST OraText *lang_name, size_t lang_length, OCIDateTime *date ); 933 938 NAME: OCIDateTimeFromText - OCIDateTime convert String FROM Date 934 939 PARAMETERS: 935 hndl (IN) - Session/Env handle. If Session Handle is passed, the 940 hndl (IN) - Session/Env handle. If Session Handle is passed, the 936 941 conversion takes place in session NLS_LANGUAGE and 937 942 session NLS_CALENDAR, otherwise the default is used. … … 949 954 lang_name (IN) - language in which the names and abbreviations of 950 955 days and months are specified, if null i.e. (OraText *)0, 951 the default language of session is used, 956 the default language of session is used, 952 957 lang_length (IN) - length of the 'lang_name' parameter 953 958 date (OUT) - given string converted to date 954 959 DESCRIPTION: 955 Converts the given string to Oracle datetime type set in the 956 OCIDateTime descriptor according to the specified format. Refer to 957 "TO_DATE" conversion function described in "Oracle SQL Language 960 Converts the given string to Oracle datetime type set in the 961 OCIDateTime descriptor according to the specified format. Refer to 962 "TO_DATE" conversion function described in "Oracle SQL Language 958 963 Reference Manual" for a description of format. 959 964 RETURNS: … … 966 971 967 972 --------------------------- OCIDateTimeGetDate------------------------- 968 sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 973 sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 969 974 sb2 *year, ub1 *month, ub1 *day ); 970 NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day) 971 portion of DATETIME. 975 NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day) 976 portion of DATETIME. 972 977 PARAMETERS: 973 hndl (IN) - Session/Env handle. 978 hndl (IN) - Session/Env handle. 974 979 err (IN/OUT) - error handle. If there is an error, it is 975 980 recorded in 'err' and this function returns OCI_ERROR. 976 981 The error recorded in 'err' can be retrieved by calling 977 982 OCIErrorGet(). 978 datetime (IN) - Pointer to OCIDateTime 983 datetime (IN) - Pointer to OCIDateTime 979 984 year (OUT) - year value 980 985 month (OUT) - month value … … 984 989 sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime, 985 990 ub1 *hour, ub1 *minute, ub1 *sec, ub4 *fsec); 986 NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, 987 fractional second) of DATETIME. 991 NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, 992 fractional second) of DATETIME. 988 993 PARAMETERS: 989 hndl (IN) - Session/Env handle. 994 hndl (IN) - Session/Env handle. 990 995 err (IN/OUT) - error handle. If there is an error, it is 991 996 recorded in 'err' and this function returns OCI_ERROR. 992 997 The error recorded in 'err' can be retrieved by calling 993 998 OCIErrorGet(). 994 datetime (IN) - Pointer to OCIDateTime 999 datetime (IN) - Pointer to OCIDateTime 995 1000 hour (OUT) - hour value 996 1001 minute (OUT) - minute value … … 999 1004 1000 1005 --------------------------- OCIDateTimeGetTimeZoneOffset ---------------------- 1001 sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST 1006 sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST 1002 1007 OCIDateTime *datetime,sb1 *hour,sb1 *minute); 1003 1008 1004 NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute) 1005 portion of DATETIME. 1009 NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute) 1010 portion of DATETIME. 1006 1011 PARAMETERS: 1007 hndl (IN) - Session/Env handle. 1012 hndl (IN) - Session/Env handle. 1008 1013 err (IN/OUT) - error handle. If there is an error, it is 1009 1014 recorded in 'err' and this function returns OCI_ERROR. 1010 1015 The error recorded in 'err' can be retrieved by calling 1011 1016 OCIErrorGet(). 1012 datetime (IN) - Pointer to OCIDateTime 1017 datetime (IN) - Pointer to OCIDateTime 1013 1018 hour (OUT) - TimeZone Hour value 1014 1019 minute (OUT) - TimeZone Minute value 1015 1020 1016 1021 --------------------------- OCIDateTimeSysTimeStamp--------------------- 1017 sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 1022 sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 1018 1023 OCIDateTime *sys_date ); 1019 1020 NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with 1024 1025 NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with 1021 1026 timezone 1022 1027 PARAMETERS: 1023 hndl (IN) - Session/Env handle. 1028 hndl (IN) - Session/Env handle. 1024 1029 err (IN/OUT) - error handle. If there is an error, it is 1025 1030 recorded in 'err' and this function returns OCI_ERROR. … … 1027 1032 OCIErrorGet(). 1028 1033 sys_date (OUT) - Pointer to output timestamp 1029 1030 DESCRIPTION: 1034 1035 DESCRIPTION: 1031 1036 Gets the system current date and time as a timestamp with timezone 1032 1037 RETURNS: … … 1046 1051 OCIErrorGet(). 1047 1052 datetime (IN) - pointer to input datetime 1048 inter (IN) - pointer to interval 1049 outdatetime (IN) - pointer to output datetime. The output datetime 1053 inter (IN) - pointer to interval 1054 outdatetime (IN) - pointer to output datetime. The output datetime 1050 1055 will be of same type as input datetime 1051 DESCRIPTION: 1056 DESCRIPTION: 1052 1057 Adds an interval to a datetime to produce a resulting datetime 1053 1058 RETURNS: … … 1063 1068 NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetime 1064 1069 PARAMETERS: 1065 hndl (IN) - Session/Env handle. 1070 hndl (IN) - Session/Env handle. 1066 1071 err (IN/OUT) - error handle. If there is an error, it is 1067 1072 recorded in 'err' and this function returns OCI_ERROR. … … 1069 1074 OCIErrorGet(). 1070 1075 datetime (IN) - pointer to input datetime 1071 inter (IN) - pointer to interval 1072 outdatetime (IN) - pointer to output datetime. The output datetime 1076 inter (IN) - pointer to interval 1077 outdatetime (IN) - pointer to output datetime. The output datetime 1073 1078 will be of same type as input datetime 1074 DESCRIPTION: 1079 DESCRIPTION: 1075 1080 Subtracts an interval from a datetime and stores the result in a 1076 1081 datetime … … 1090 1095 fields for the OCIDateTime descriptor types are used. 1091 1096 PARAMETERS: 1092 hndl (IN) - Session/Env handle. 1097 hndl (IN) - Session/Env handle. 1093 1098 err (IN/OUT) - error handle. If there is an error, it is 1094 1099 recorded in 'err' and this function returns OCI_ERROR. 1095 1100 The error recorded in 'err' can be retrieved by calling 1096 1101 OCIErrorGet(). 1097 datetime (IN) - Pointer to OCIDateTime 1102 datetime (IN) - Pointer to OCIDateTime 1098 1103 year (IN) - year value 1099 1104 month (IN) - month value 1100 day (IN) - day value 1105 day (IN) - day value 1101 1106 hour (IN) - hour value 1102 1107 min (IN) - minute value … … 1118 1123 1119 1124 ------------------------------OCIDateTimeSubtract----------------------- 1120 sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 1125 sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 1121 1126 OCIDateTime *indate2, OCIInterval *inter); 1122 1127 NAME: OCIDateTimeSubtract - subtracts two datetimes to return an interval 1123 1128 PARAMETERS: 1124 hndl (IN) - Session/Env handle. 1129 hndl (IN) - Session/Env handle. 1125 1130 err (IN/OUT) - error handle. If there is an error, it is 1126 1131 recorded in 'err' and this function returns OCI_ERROR. … … 1130 1135 indate2(IN) - pointer to minuend 1131 1136 inter (OUT) - pointer to output interval 1132 DESCRIPTION: 1133 Takes two datetimes as input and stores their difference in an 1137 DESCRIPTION: 1138 Takes two datetimes as input and stores their difference in an 1134 1139 interval. The type of the interval is the type of the 'inter' 1135 1140 descriptor. … … 1141 1146 1142 1147 --------------------------- OCIDateTimeToText-------------------------- 1143 sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 1144 CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 1145 CONST OraText *lang_name, size_t lang_length, 1148 sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 1149 CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 1150 CONST OraText *lang_name, size_t lang_length, 1146 1151 ub4 *buf_size, OraText *buf ); 1147 NAME: OCIDateTimeToText - OCIDateTime convert date TO String 1152 NAME: OCIDateTimeToText - OCIDateTime convert date TO String 1148 1153 PARAMETERS: 1149 hndl (IN) - Session/Env handle. If Session Handle is passed, the 1154 hndl (IN) - Session/Env handle. If Session Handle is passed, the 1150 1155 conversion takes place in session NLS_LANGUAGE and 1151 1156 session NLS_CALENDAR, otherwise the default is used. … … 1161 1166 fsprec (IN) - specifies the fractional second precision in which the 1162 1167 fractional seconds is returned. 1163 lang_name (IN) - specifies the language in which the names and 1168 lang_name (IN) - specifies the language in which the names and 1164 1169 abbreviations of months and days are returned; 1165 default language of session is used if 'lang_name' 1170 default language of session is used if 'lang_name' 1166 1171 is null i.e. (OraText *)0 1167 1172 lang_length (IN) - length of the 'nls_params' parameter … … 1185 1190 1186 1191 ----------------------------OCIDateTimeGetTimeZoneName------------------------ 1187 sword OCIDateTimeGetTimeZoneName(dvoid *hndl, 1192 sword OCIDateTimeGetTimeZoneName(dvoid *hndl, 1188 1193 OCIError *err, 1189 1194 CONST OCIDateTime *datetime, … … 1202 1207 DESCRIPTION: 1203 1208 Returns either the timezone region name or the absolute hour and minute 1204 offset. If the DateTime was created with a region id then the region 1205 name will be returned in the buf. If the region id is zero, then the 1209 offset. If the DateTime was created with a region id then the region 1210 name will be returned in the buf. If the region id is zero, then the 1206 1211 hour and minute offset is returned as "[-]HH:MM". 1207 1212 RETURNS: … … 1211 1216 buffer too small 1212 1217 error retrieving timezone data 1213 invalid region 1218 invalid region 1214 1219 invalid LdiDateTime type 1215 1220 1216 1221 ---------------------------------OCIDateTimeToArray---------------------------- 1217 sword OCIDateTimeToArray(dvoid *hndl, 1222 sword OCIDateTimeToArray(dvoid *hndl, 1218 1223 OCIError *err, 1219 1224 CONST OCIDateTime *datetime, … … 1241 1246 buffer too small 1242 1247 error retrieving timezone data 1243 invalid region 1248 invalid region 1244 1249 invalid LdiDateTime type 1245 1250 1246 1251 --------------------------------OCIDateTimeFromArray--------------------------- 1247 sword OCIDateTimeFromArray(dvoid *hndl, 1252 sword OCIDateTimeFromArray(dvoid *hndl, 1248 1253 OCIError *err, 1249 1254 ub1 *inarray, … … 1268 1273 fsprec (IN) - fractionl seconds digits of precision (0-9). 1269 1274 DESCRIPTION: 1270 Returns a pointer to an OCIDateTime of type type converted from 1275 Returns a pointer to an OCIDateTime of type type converted from 1271 1276 the inarray. 1272 1277 RETURNS: … … 1276 1281 buffer too small 1277 1282 error retrieving timezone data 1278 invalid region 1283 invalid region 1279 1284 invalid LdiDateTime type 1280 1285 … … 1284 1289 1285 1290 Purpose 1286 Converts physical/logical (universal) ROWID to chracter extended (Base 64) 1287 representation into user provided buffer outbfp of length outbflp. After 1288 execution outbflp contains amount of bytes converted.In case of truncation 1291 Converts physical/logical (universal) ROWID to chracter extended (Base 64) 1292 representation into user provided buffer outbfp of length outbflp. After 1293 execution outbflp contains amount of bytes converted.In case of truncation 1289 1294 error, outbflp contains required size to make this conversion successful 1290 1295 and returns ORA-1405. 1291 1296 1292 1297 Syntax 1293 sword OCIRowidToChar( OCIRowid *rowidDesc, 1294 OraText *outbfp, 1295 ub2 *outbflp, 1298 sword OCIRowidToChar( OCIRowid *rowidDesc, 1299 OraText *outbfp, 1300 ub2 *outbflp, 1296 1301 OCIError *errhp) 1297 1302 … … 1299 1304 After this conversion, ROWID in character format can be bound using 1300 1305 OCIBindByPos or OCIBindByName call and used to query a row at a 1301 desired ROWID. 1306 desired ROWID. 1302 1307 1303 1308 Parameters 1304 1309 rowidDesc (IN) - rowid DESCriptor which is allocated from OCIDescritorAlloc 1305 1310 and populated by a prior SQL statement execution 1306 outbfp (OUT) - pointer to the buffer where converted rowid in character 1311 outbfp (OUT) - pointer to the buffer where converted rowid in character 1307 1312 representation is stored after successful execution. 1308 1313 outbflp (IN/OUT) - pointer to output buffer length variable. 1309 1314 Before execution (IN mode) *outbflp contains the size of 1310 1315 outbfp, after execution (OUT mode) *outbflp contains amount 1311 of bytes converted. In an event of truncation during 1316 of bytes converted. In an event of truncation during 1312 1317 conversion *outbflp contains the required length to make 1313 1318 conversion successful. … … 1326 1331 sword OCIDefineArrayOfStruct ( OCIDefine *defnp, 1327 1332 OCIError *errhp, 1328 ub4 pvskip, 1329 ub4 indskip, 1333 ub4 pvskip, 1334 ub4 indskip, 1330 1335 ub4 rlskip, 1331 1336 ub4 rcskip ); 1332 1337 Comments 1333 This call specifies additional attributes necessary for an array define, 1338 This call specifies additional attributes necessary for an array define, 1334 1339 used in an array of structures (multi-row, multi-column) fetch. 1335 For more information about skip parameters, see the section "Skip Parameters" 1340 For more information about skip parameters, see the section "Skip Parameters" 1336 1341 on page 4-17. 1337 1342 Parameters 1338 defnp (IN) - the handle to the define structure which was returned by a call 1343 defnp (IN) - the handle to the define structure which was returned by a call 1339 1344 to OCIDefineByPos(). 1340 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 1345 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 1341 1346 diagnostic information in the event of an error. 1342 1347 pvskip (IN) - skip parameter for the next data value. 1343 indskip (IN) - skip parameter for the next indicator location. 1348 indskip (IN) - skip parameter for the next indicator location. 1344 1349 rlskip (IN) - skip parameter for the next return length value. 1345 1350 rcskip (IN) - skip parameter for the next return code. … … 1355 1360 OCI Define By Position 1356 1361 Purpose 1357 Associates an item in a select-list with the type and output data buffer. 1358 Syntax 1359 sb4 OCIDefineByPos ( 1360 OCIStmt *stmtp, 1362 Associates an item in a select-list with the type and output data buffer. 1363 Syntax 1364 sb4 OCIDefineByPos ( 1365 OCIStmt *stmtp, 1361 1366 OCIDefine **defnp, 1362 1367 OCIError *errhp, … … 1370 1375 ub4 mode ); 1371 1376 Comments 1372 This call defines an output buffer which will receive data retreived from 1373 Oracle. The define is a local step which is necessary when a SELECT statement 1377 This call defines an output buffer which will receive data retreived from 1378 Oracle. The define is a local step which is necessary when a SELECT statement 1374 1379 returns data to your OCI application. 1375 1380 This call also implicitly allocates the define handle for the select-list item. 1376 Defining attributes of a column for a fetch is done in one or more calls. The 1377 first call is to OCIDefineByPos(), which defines the minimal attributes 1378 required to specify the fetch. 1379 This call takes as a parameter a define handle, which must have been 1381 Defining attributes of a column for a fetch is done in one or more calls. The 1382 first call is to OCIDefineByPos(), which defines the minimal attributes 1383 required to specify the fetch. 1384 This call takes as a parameter a define handle, which must have been 1380 1385 previously allocated with a call to OCIHandleAlloc(). 1381 Following the call to OCIDefineByPos() additional define calls may be 1386 Following the call to OCIDefineByPos() additional define calls may be 1382 1387 necessary for certain data types or fetch modes: 1383 A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters 1388 A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters 1384 1389 for an array fetch of multiple columns. 1385 A call to OCIDefineObject() is necessary to set up the appropriate 1386 attributes of a named data type fetch. In this case the data buffer pointer 1390 A call to OCIDefineObject() is necessary to set up the appropriate 1391 attributes of a named data type fetch. In this case the data buffer pointer 1387 1392 in ocidefn() is ignored. 1388 Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called 1389 after ocidefn() in order to fetch multiple rows with a column of named 1393 Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called 1394 after ocidefn() in order to fetch multiple rows with a column of named 1390 1395 data types. 1391 For a LOB define, the buffer pointer must be a lob locator of type 1392 OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not 1393 LOB values, are always returned for a LOB column. LOB values can then be 1396 For a LOB define, the buffer pointer must be a lob locator of type 1397 OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not 1398 LOB values, are always returned for a LOB column. LOB values can then be 1394 1399 fetched using OCI LOB calls on the fetched locator. 1395 For NCHAR (fixed and varying length), the buffer pointer must point to an 1396 array of bytes sufficient for holding the required NCHAR characters. 1397 Nested table columns are defined and fetched like any other named data type. 1398 If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client 1400 For NCHAR (fixed and varying length), the buffer pointer must point to an 1401 array of bytes sufficient for holding the required NCHAR characters. 1402 Nested table columns are defined and fetched like any other named data type. 1403 If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client 1399 1404 application can fetch data dynamically at runtime. 1400 1405 Runtime data can be provided in one of two ways: 1401 callbacks using a user-defined function which must be registered with a 1402 subsequent call to OCIDefineDynamic(). When the client library needs a 1403 buffer to return the fetched data, the callback will be invoked and the 1404 runtime buffers provided will return a piece or the whole data. 1405 a polling mechanism using calls supplied by the OCI. This mode is 1406 assumed if no callbacks are defined. In this case, the fetch call returns the 1407 OCI_NEED_DATA error code, and a piecewise polling method is used 1406 callbacks using a user-defined function which must be registered with a 1407 subsequent call to OCIDefineDynamic(). When the client library needs a 1408 buffer to return the fetched data, the callback will be invoked and the 1409 runtime buffers provided will return a piece or the whole data. 1410 a polling mechanism using calls supplied by the OCI. This mode is 1411 assumed if no callbacks are defined. In this case, the fetch call returns the 1412 OCI_NEED_DATA error code, and a piecewise polling method is used 1408 1413 to provide the data. 1409 Related Functions: For more information about using the 1410 OCI_DYNAMIC_FETCH mode, see the section "Runtime Data 1414 Related Functions: For more information about using the 1415 OCI_DYNAMIC_FETCH mode, see the section "Runtime Data 1411 1416 Allocation and Piecewise Operations" on page 5-16 of Volume 1.. 1412 For more information about the define step, see the section "Defining" 1417 For more information about the define step, see the section "Defining" 1413 1418 on page 2-30. 1414 1419 Parameters 1415 1420 stmtp (IN) - a handle to the requested SQL query operation. 1416 defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly 1417 allocated by this call. This handle is used to store the define information 1421 defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly 1422 allocated by this call. This handle is used to store the define information 1418 1423 for this column. 1419 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 1424 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 1420 1425 diagnostic information in the event of an error. 1421 position (IN) - the position of this value in the select list. Positions are 1422 1-based and are numbered from left to right. For example, in the SELECT 1426 position (IN) - the position of this value in the select list. Positions are 1427 1-based and are numbered from left to right. For example, in the SELECT 1423 1428 statement 1424 1429 SELECT empno, ssn, mgrno FROM employees; 1425 1430 empno is at position 1, ssn is at position 2, and mgrno is at position 3. 1426 valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type 1427 specified in the dty parameter. A number of buffers can be specified when 1431 valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type 1432 specified in the dty parameter. A number of buffers can be specified when 1428 1433 results for more than one row are desired in a single fetch call. 1429 value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored 1430 internally in VARCHAR2 format, the number of characters desired, if different 1431 from the buffer size in bytes, may be additionally specified by the using 1432 OCIAttrSet(). 1433 In an NLS conversion environment, a truncation error will be generated if the 1434 number of bytes specified is insufficient to handle the number of characters 1434 value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored 1435 internally in VARCHAR2 format, the number of characters desired, if different 1436 from the buffer size in bytes, may be additionally specified by the using 1437 OCIAttrSet(). 1438 In an NLS conversion environment, a truncation error will be generated if the 1439 number of bytes specified is insufficient to handle the number of characters 1435 1440 desired. 1436 dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF) 1437 are valid only if the environment has been intialized with in object mode. 1438 indp - pointer to an indicator variable or array. For scalar data types, 1439 pointer to sb2 or an array of sb2s. Ignored for named data types. For named 1440 data types, a pointer to a named data type indicator structure or an array of 1441 named data type indicator structures is associated by a subsequent 1442 OCIDefineObject() call. 1443 See the section "Indicator Variables" on page 2-43 for more information about 1441 dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF) 1442 are valid only if the environment has been intialized with in object mode. 1443 indp - pointer to an indicator variable or array. For scalar data types, 1444 pointer to sb2 or an array of sb2s. Ignored for named data types. For named 1445 data types, a pointer to a named data type indicator structure or an array of 1446 named data type indicator structures is associated by a subsequent 1447 OCIDefineObject() call. 1448 See the section "Indicator Variables" on page 2-43 for more information about 1444 1449 indicator variables. 1445 rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in 1446 rlenp is the length of the data in the corresponding element in the row after 1447 the fetch. 1450 rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in 1451 rlenp is the length of the data in the corresponding element in the row after 1452 the fetch. 1448 1453 rcodep (OUT) - pointer to array of column-level return codes 1449 1454 mode (IN) - the valid modes are: 1450 1455 OCI_DEFAULT. This is the default mode. 1451 OCI_DYNAMIC_FETCH. For applications requiring dynamically 1452 allocated data at the time of fetch, this mode must be used. The user may 1453 additionally call OCIDefineDynamic() to set up a callback function that 1454 will be invoked to receive the dynamically allocated buffers and to set 1455 up the memory allocate/free callbacks and the context for the callbacks. 1456 valuep and value_sz are ignored in this mode. 1456 OCI_DYNAMIC_FETCH. For applications requiring dynamically 1457 allocated data at the time of fetch, this mode must be used. The user may 1458 additionally call OCIDefineDynamic() to set up a callback function that 1459 will be invoked to receive the dynamically allocated buffers and to set 1460 up the memory allocate/free callbacks and the context for the callbacks. 1461 valuep and value_sz are ignored in this mode. 1457 1462 Related Functions 1458 1463 OCIDefineArrayOfStruct(), OCIDefineDynamic(), OCIDefineObject() … … 1465 1470 OCI Define Dynamic Fetch Attributes 1466 1471 Purpose 1467 This call is used to set the additional attributes required if the 1468 OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos(). 1472 This call is used to set the additional attributes required if the 1473 OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos(). 1469 1474 Syntax 1470 1475 sword OCIDefineDynamic( OCIDefine *defnp, 1471 1476 OCIError *errhp, 1472 dvoid *octxp, 1477 dvoid *octxp, 1473 1478 OCICallbackDefine (ocbfp)( 1474 1479 dvoid *octxp, 1475 1480 OCIDefine *defnp, 1476 ub4 iter, 1481 ub4 iter, 1477 1482 dvoid **bufpp, 1478 1483 ub4 **alenpp, … … 1481 1486 ub2 **rcodep) ); 1482 1487 Comments 1483 This call is used to set the additional attributes required if the 1484 OCI_DYNAMIC_FETCH mode has been selected in a call to 1485 OCIDefineByPos(). 1486 When the OCI_DYNAMIC_FETCH mode is selected, buffers will be 1487 dynamically allocated for REF, and named data type, values to receive the 1488 data. The pointers to these buffers will be returned. 1489 If OCI_DYNAMIC_FETCH mode was selected, and the call to 1490 OCIDefineDynamic() is skipped, then the application can fetch data piecewise 1488 This call is used to set the additional attributes required if the 1489 OCI_DYNAMIC_FETCH mode has been selected in a call to 1490 OCIDefineByPos(). 1491 When the OCI_DYNAMIC_FETCH mode is selected, buffers will be 1492 dynamically allocated for REF, and named data type, values to receive the 1493 data. The pointers to these buffers will be returned. 1494 If OCI_DYNAMIC_FETCH mode was selected, and the call to 1495 OCIDefineDynamic() is skipped, then the application can fetch data piecewise 1491 1496 using OCI calls. 1492 For more information about OCI_DYNAMIC_FETCH mode, see the section 1497 For more information about OCI_DYNAMIC_FETCH mode, see the section 1493 1498 "Runtime Data Allocation and Piecewise Operations" on page 5-16. 1494 1499 Parameters 1495 defnp (IN/OUT) - the handle to a define structure returned by a call to 1500 defnp (IN/OUT) - the handle to a define structure returned by a call to 1496 1501 OCIDefineByPos(). 1497 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1498 diagnostic information in the event of an error. 1499 octxp (IN) - points to a context for the callback function. 1500 ocbfp (IN) - points to a callback function. This is invoked at runtime to get 1501 a pointer to the buffer into which the fetched data or a piece of it will be 1502 retreived. The callback also specifies the indicator, the return code and the 1503 lengths of the data piece and indicator. The callback has the following 1502 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1503 diagnostic information in the event of an error. 1504 octxp (IN) - points to a context for the callback function. 1505 ocbfp (IN) - points to a callback function. This is invoked at runtime to get 1506 a pointer to the buffer into which the fetched data or a piece of it will be 1507 retreived. The callback also specifies the indicator, the return code and the 1508 lengths of the data piece and indicator. The callback has the following 1504 1509 parameters: 1505 octxp (IN) - a context pointer passed as an argument to all the callback 1510 octxp (IN) - a context pointer passed as an argument to all the callback 1506 1511 functions. 1507 1512 defnp (IN) - the define handle. 1508 1513 iter (IN) - which row of this current fetch. 1509 bufpp (OUT) - returns a pointer to a buffer to store the column value, ie. 1514 bufpp (OUT) - returns a pointer to a buffer to store the column value, ie. 1510 1515 *bufp points to some appropriate storage for the column value. 1511 alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp 1512 contains the size of the buffer after return from callback. Gets set to 1516 alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp 1517 contains the size of the buffer after return from callback. Gets set to 1513 1518 actual data size after fetch. 1514 1519 piecep (IN/OUT) - returns a piece value, as follows: 1515 The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or 1520 The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or 1516 1521 OCI_NEXT_PIECE. 1517 The OUT value can be OCI_ONE_PIECE if the IN value was 1522 The OUT value can be OCI_ONE_PIECE if the IN value was 1518 1523 OCI_ONE_PIECE. 1519 The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if 1524 The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if 1520 1525 the IN value was OCI_FIRST_PIECE. 1521 The OUT value can only be OCI_NEXT_PIECE or 1522 OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE. 1526 The OUT value can only be OCI_NEXT_PIECE or 1527 OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE. 1523 1528 indpp (IN) - indicator variable pointer 1524 1529 rcodep (IN) - return code variable pointer … … 1539 1544 OCIError *errhp, 1540 1545 CONST OCIType *type, 1541 dvoid **pgvpp, 1542 ub4 *pvszsp, 1543 dvoid **indpp, 1546 dvoid **pgvpp, 1547 ub4 *pvszsp, 1548 dvoid **indpp, 1544 1549 ub4 *indszp ); 1545 1550 Comments 1546 1551 This call sets up additional attributes necessary for a Named Data Type define. 1547 An error will be returned if this function is called when the OCI environment 1552 An error will be returned if this function is called when the OCI environment 1548 1553 has been initialized in non-Object mode. 1549 This call takes as a paramter a type descriptor object (TDO) of datatype 1550 OCIType for the named data type being defined. The TDO can be retrieved 1554 This call takes as a paramter a type descriptor object (TDO) of datatype 1555 OCIType for the named data type being defined. The TDO can be retrieved 1551 1556 with a call to OCITypeByName(). 1552 See the description of OCIInitialize() on page 13 - 43 for more information 1557 See the description of OCIInitialize() on page 13 - 43 for more information 1553 1558 about initializing the OCI process environment. 1554 1559 Parameters 1555 defnp (IN/OUT) - a define handle previously allocated in a call to 1556 OCIDefineByPos(). 1557 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1560 defnp (IN/OUT) - a define handle previously allocated in a call to 1561 OCIDefineByPos(). 1562 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1558 1563 diagnostic information in the event of an error. 1559 type (IN, optional) - points to the Type Descriptor Object (TDO) which 1560 describes the type of the program variable. Only used for program variables 1561 of type SQLT_NTY. This parameter is optional, and may be passed as NULL 1564 type (IN, optional) - points to the Type Descriptor Object (TDO) which 1565 describes the type of the program variable. Only used for program variables 1566 of type SQLT_NTY. This parameter is optional, and may be passed as NULL 1562 1567 if it is not being used. 1563 pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an 1564 array, pgvpp points to an array of pointers. Memory for the fetched named data 1565 type instance(s) is dynamically allocated in the object cache. At the end of 1566 the fetch when all the values have been received, pgvpp points to the 1567 pointer(s) to these newly allocated named data type instance(s). The 1568 application must call OCIObjectMarkDel() to deallocate the named data type 1569 instance(s) when they are no longer needed. 1570 pvszsp (IN/OUT) - points to the size of the program variable. For an array, it 1571 is an array of ub4s. On return points to the size(s) of unpickled fetched 1568 pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an 1569 array, pgvpp points to an array of pointers. Memory for the fetched named data 1570 type instance(s) is dynamically allocated in the object cache. At the end of 1571 the fetch when all the values have been received, pgvpp points to the 1572 pointer(s) to these newly allocated named data type instance(s). The 1573 application must call OCIObjectMarkDel() to deallocate the named data type 1574 instance(s) when they are no longer needed. 1575 pvszsp (IN/OUT) - points to the size of the program variable. For an array, it 1576 is an array of ub4s. On return points to the size(s) of unpickled fetched 1572 1577 values. 1573 indpp (IN/OUT) - points to a pointer to the program variable buffer 1574 containing the parallel indicator structure. For an array, points to an array 1575 of pointers. Memory is allocated to store the indicator structures in the 1576 object cache. At the end of the fetch when all values have been received, 1578 indpp (IN/OUT) - points to a pointer to the program variable buffer 1579 containing the parallel indicator structure. For an array, points to an array 1580 of pointers. Memory is allocated to store the indicator structures in the 1581 object cache. At the end of the fetch when all values have been received, 1577 1582 indpp points to the pointer(s) to these newly allocated indicator structure(s). 1578 indszp (IN/OUT) - points to the size(s) of the indicator structure program 1583 indszp (IN/OUT) - points to the size(s) of the indicator structure program 1579 1584 variable. For an array, it is an array of ub4s. On return points to the size(s) 1580 1585 of the unpickled fetched indicator values. … … 1588 1593 OCI Get DESCriptor or lob locator 1589 1594 Purpose 1590 Allocates storage to hold certain data types. The descriptors can be used as 1595 Allocates storage to hold certain data types. The descriptors can be used as 1591 1596 bind or define variables. 1592 1597 Syntax 1593 1598 sword OCIDescAlloc ( CONST dvoid *parenth, 1594 dvoid **descpp, 1599 dvoid **descpp, 1595 1600 ub4 type, 1596 1601 size_t xtramem_sz, 1597 1602 dvoid **usrmempp); 1598 1603 Comments 1599 Returns a pointer to an allocated and initialized structure, corresponding to 1600 the type specified in type. A non-NULL descriptor or LOB locator is returned 1604 Returns a pointer to an allocated and initialized structure, corresponding to 1605 the type specified in type. A non-NULL descriptor or LOB locator is returned 1601 1606 on success. No diagnostics are available on error. 1602 This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if 1603 an out-of-memory error occurs. 1604 Parameters 1605 parenth (IN) - an environment handle. 1606 descpp (OUT) - returns a descriptor or LOB locator of desired type. 1607 type (IN) - specifies the type of descriptor or LOB locator to be allocated. 1607 This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if 1608 an out-of-memory error occurs. 1609 Parameters 1610 parenth (IN) - an environment handle. 1611 descpp (OUT) - returns a descriptor or LOB locator of desired type. 1612 type (IN) - specifies the type of descriptor or LOB locator to be allocated. 1608 1613 The specific types are: 1609 OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C 1614 OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C 1610 1615 type - OCISnapshot 1611 OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C 1616 OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C 1612 1617 type - OCILobLocator 1613 OCI_DTYPE_RSET - specifies generation of a descriptor of C type 1614 OCIResult that references a result set (a number of rows as a result of a 1615 query). This descriptor is bound to a bind variable of data type 1616 SQLT_RSET (result set). The descriptor has to be converted into a 1617 statement handle using a function - OCIResultSetToStmt() - which can 1618 then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the 1618 OCI_DTYPE_RSET - specifies generation of a descriptor of C type 1619 OCIResult that references a result set (a number of rows as a result of a 1620 query). This descriptor is bound to a bind variable of data type 1621 SQLT_RSET (result set). The descriptor has to be converted into a 1622 statement handle using a function - OCIResultSetToStmt() - which can 1623 then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the 1619 1624 rows of the result set. 1620 OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C 1625 OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C 1621 1626 type OCIRowid. 1622 OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a 1623 complex object retrieval descriptor of C type 1627 OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a 1628 complex object retrieval descriptor of C type 1624 1629 OCIComplexObjectComp. 1625 xtramemsz (IN) - specifies an amount of user memory to be allocated for use 1626 by the application. 1627 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1628 allocated by the call for the user. 1630 xtramemsz (IN) - specifies an amount of user memory to be allocated for use 1631 by the application. 1632 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1633 allocated by the call for the user. 1629 1634 Related Functions 1630 1635 OCIDescFree() … … 1643 1648 Comments 1644 1649 This call frees up storage associated with the descriptor, corresponding to the 1645 type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE. 1646 All descriptors must be explicitly deallocated. OCI will not deallocate a 1650 type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE. 1651 All descriptors must be explicitly deallocated. OCI will not deallocate a 1647 1652 descriptor if the environment handle is deallocated. 1648 1653 Parameters 1649 descp (IN) - an allocated descriptor. 1650 type (IN) - specifies the type of storage to be freed. The specific types are: 1654 descp (IN) - an allocated descriptor. 1655 type (IN) - specifies the type of storage to be freed. The specific types are: 1651 1656 OCI_DTYPE_SNAP - snapshot descriptor 1652 1657 OCI_DTYPE_LOB - a LOB data type descriptor 1653 OCI_DTYPE_RSET - a descriptor that references a result set (a number 1658 OCI_DTYPE_RSET - a descriptor that references a result set (a number 1654 1659 of rows as a result of a query). 1655 1660 OCI_DTYPE_ROWID - a ROWID descriptor 1656 OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval 1661 OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval 1657 1662 descriptor 1658 1663 Related Functions … … 1677 1682 Comments 1678 1683 This is a generic describe call that describes existing schema objects: tables, 1679 views, synonyms, procedures, functions, packages, sequences, and types. As a 1680 result of this call, the describe handle is populated with the object-specific 1684 views, synonyms, procedures, functions, packages, sequences, and types. As a 1685 result of this call, the describe handle is populated with the object-specific 1681 1686 attributes which can be obtained through an OCIAttrGet() call. 1682 An OCIParamGet() on the describe handle returns a parameter descriptor for a 1683 specified position. Parameter positions begin with 1. Calling OCIAttrGet() on 1684 the parameter descriptor returns the specific attributes of a stored procedure 1685 or function parameter or a table column descriptor as the case may be. 1686 These subsequent calls do not need an extra round trip to the server because 1687 the entire schema object description cached on the client side by 1688 OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return 1687 An OCIParamGet() on the describe handle returns a parameter descriptor for a 1688 specified position. Parameter positions begin with 1. Calling OCIAttrGet() on 1689 the parameter descriptor returns the specific attributes of a stored procedure 1690 or function parameter or a table column descriptor as the case may be. 1691 These subsequent calls do not need an extra round trip to the server because 1692 the entire schema object description cached on the client side by 1693 OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return 1689 1694 the total number of positions. 1690 See the section "Describing" on page 2-33 for more information about describe 1695 See the section "Describing" on page 2-33 for more information about describe 1691 1696 operations. 1692 1697 Parameters 1693 1698 TO BE UPDATED 1694 1699 svchp (IN/OUT) - a service context handle. 1695 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1700 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 1696 1701 diagnostic information in the event of an error. 1697 objptr (IN) - the name of the object (a null-terminated string) to be 1698 described. Only procedure or function names are valid when connected to an 1702 objptr (IN) - the name of the object (a null-terminated string) to be 1703 described. Only procedure or function names are valid when connected to an 1699 1704 Oracle7 Server. 1700 1705 objptr_len (IN) - the length of the string. Must be non-zero. … … 1702 1707 info_level (IN) - reserved for future extensions. Pass OCI_DEFAULT. 1703 1708 objtype (IN/OUT) - object type. 1704 dschp (IN/OUT) - a describe handle that is populated with describe 1709 dschp (IN/OUT) - a describe handle that is populated with describe 1705 1710 information about the object after the call. 1706 1711 Related Functions … … 1717 1722 the OCIInitialize and OCIEnvInit calls. 1718 1723 Syntax 1719 sword OCIEnvCreate ( OCIEnv **envhpp, 1720 ub4 mode, 1721 CONST dvoid *ctxp, 1722 CONST dvoid *(*malocfp) 1723 (dvoid *ctxp, 1724 size_t size), 1725 CONST dvoid *(*ralocfp) 1726 (dvoid *ctxp, 1727 dvoid *memptr, 1728 size_t newsize), 1729 CONST void (*mfreefp) 1730 ( dvoid *ctxp, 1724 sword OCIEnvCreate ( OCIEnv **envhpp, 1725 ub4 mode, 1726 CONST dvoid *ctxp, 1727 CONST dvoid *(*malocfp) 1728 (dvoid *ctxp, 1729 size_t size), 1730 CONST dvoid *(*ralocfp) 1731 (dvoid *ctxp, 1732 dvoid *memptr, 1733 size_t newsize), 1734 CONST void (*mfreefp) 1735 ( dvoid *ctxp, 1731 1736 dvoid *memptr)) 1732 1737 size_t xtramemsz, 1733 1738 dvoid **usrmempp ); 1734 1739 1735 1740 Comments 1736 1741 This call creates an environment for all the OCI calls using the modes … … 1738 1743 OCIInitialize and OCIEnvInit. This function returns an environment handle 1739 1744 which is then used by the remaining OCI functions. There can be multiple 1740 environments in OCI each with its own environment modes. This function 1745 environments in OCI each with its own environment modes. This function 1741 1746 also performs any process level initialization if required by any mode. 1742 1747 For example if the user wants to initialize an environment as OCI_THREADED, 1743 1748 then all libraries that are used by OCI are also initialized in the 1744 threaded mode. 1749 threaded mode. 1745 1750 1746 1751 This call should be invoked before anny other OCI call and should be used 1747 1752 instead of the OCIInitialize and OCIEnvInit calls. This is the recommended 1748 1753 call, although OCIInitialize and OCIEnvInit calls will still be supported 1749 for backward compatibility. 1750 1751 envpp (OUT) - a pointer to a handle to the environment. 1754 for backward compatibility. 1755 1756 envpp (OUT) - a pointer to a handle to the environment. 1752 1757 mode (IN) - specifies initialization of the mode. The valid modes are: 1753 1758 OCI_DEFAULT - default mode. 1754 OCI_THREADED - threaded environment. In this mode, internal data 1755 structures are protected from concurrent accesses by multiple threads. 1756 OCI_OBJECT - will use navigational object interface. 1757 ctxp (IN) - user defined context for the memory call back routines. 1758 malocfp (IN) - user-defined memory allocation function. If mode is 1759 OCI_THREADED - threaded environment. In this mode, internal data 1760 structures are protected from concurrent accesses by multiple threads. 1761 OCI_OBJECT - will use navigational object interface. 1762 ctxp (IN) - user defined context for the memory call back routines. 1763 malocfp (IN) - user-defined memory allocation function. If mode is 1759 1764 OCI_THREADED, this memory allocation routine must be thread safe. 1760 1765 ctxp - context pointer for the user-defined memory allocation function. 1761 size - size of memory to be allocated by the user-defined memory 1766 size - size of memory to be allocated by the user-defined memory 1762 1767 allocation function 1763 ralocfp (IN) - user-defined memory re-allocation function. If mode is 1768 ralocfp (IN) - user-defined memory re-allocation function. If mode is 1764 1769 OCI_THREADED, this memory allocation routine must be thread safe. 1765 ctxp - context pointer for the user-defined memory reallocation 1770 ctxp - context pointer for the user-defined memory reallocation 1766 1771 function. 1767 1772 memp - pointer to memory block 1768 1773 newsize - new size of memory to be allocated 1769 mfreefp (IN) - user-defined memory free function. If mode is 1774 mfreefp (IN) - user-defined memory free function. If mode is 1770 1775 OCI_THREADED, this memory free routine must be thread safe. 1771 1776 ctxp - context pointer for the user-defined memory free function. 1772 1777 memptr - pointer to memory to be freed 1773 xtramemsz (IN) - specifies the amount of user memory to be allocated. 1774 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1778 xtramemsz (IN) - specifies the amount of user memory to be allocated. 1779 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1775 1780 allocated by the call for the user. 1776 1781 … … 1810 1815 be used to replace the ones specified in NLS_LANG or NLS_NCHAR. Moreover, 1811 1816 OCI_UTF16ID is allowed to be set as charset and ncharset. 1812 On the other hand, OCI_UTF16 mode is deprecated with this function. 1813 Applications can achieve the same effects by setting 1817 On the other hand, OCI_UTF16 mode is deprecated with this function. 1818 Applications can achieve the same effects by setting 1814 1819 both charset and ncharset as OCI_UTF16ID. 1815 1820 … … 1826 1831 dvoid **usrmempp ); 1827 1832 Comments 1828 Initializes the OCI environment handle. No changes are done on an initialized 1829 handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the 1830 environment handle can be used to obtain ORACLE specific errors and 1833 Initializes the OCI environment handle. No changes are done on an initialized 1834 handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the 1835 environment handle can be used to obtain ORACLE specific errors and 1831 1836 diagnostics. 1832 1837 This call is processed locally, without a server round-trip. 1833 1838 Parameters 1834 envpp (OUT) - a pointer to a handle to the environment. 1835 mode (IN) - specifies initialization of an environment mode. The only valid 1839 envpp (OUT) - a pointer to a handle to the environment. 1840 mode (IN) - specifies initialization of an environment mode. The only valid 1836 1841 mode is OCI_DEFAULT for default mode 1837 xtramemsz (IN) - specifies the amount of user memory to be allocated. 1838 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1842 xtramemsz (IN) - specifies the amount of user memory to be allocated. 1843 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 1839 1844 allocated by the call for the user. 1840 1845 Example 1841 See the description of OCISessionBegin() on page 13-84 for an example showing 1842 the use of OCIEnvInit(). 1846 See the description of OCISessionBegin() on page 13-84 for an example showing 1847 the use of OCIEnvInit(). 1843 1848 Related Functions 1844 1849 … … 1852 1857 Returns an error message in the buffer provided and an ORACLE error. 1853 1858 Syntax 1854 sword OCIErrorGet ( dvoid *hndlp, 1859 sword OCIErrorGet ( dvoid *hndlp, 1855 1860 ub4 recordno, 1856 1861 OraText *sqlstate, 1857 ub4 *errcodep, 1862 ub4 *errcodep, 1858 1863 OraText *bufp, 1859 1864 ub4 bufsiz, 1860 1865 ub4 type ); 1861 1866 Comments 1862 Returns an error message in the buffer provided and an ORACLE error. 1863 Currently does not support SQL state. This call can be called a multiple 1867 Returns an error message in the buffer provided and an ORACLE error. 1868 Currently does not support SQL state. This call can be called a multiple 1864 1869 number of times if there are more than one diagnostic record for an error. 1865 1870 The error handle is originally allocated with a call to OCIHandleAlloc(). 1866 1871 Parameters 1867 hndlp (IN) - the error handle, in most cases, or the environment handle (for 1872 hndlp (IN) - the error handle, in most cases, or the environment handle (for 1868 1873 errors on OCIEnvInit(), OCIHandleAlloc()). 1869 recordno (IN) - indicates the status record from which the application seeks 1870 info. Starts from 1. 1874 recordno (IN) - indicates the status record from which the application seeks 1875 info. Starts from 1. 1871 1876 sqlstate (OUT) - Not supported in Version 8.0. 1872 1877 errcodep (OUT) - an ORACLE Error is returned. … … 1879 1884 OCIExtractInit 1880 1885 Name 1881 OCI Extract Initialize 1882 Purpose 1883 This function initializes the parameter manager. 1886 OCI Extract Initialize 1887 Purpose 1888 This function initializes the parameter manager. 1884 1889 Syntax 1885 1890 sword OCIExtractInit(dvoid *hndl, OCIError *err); 1886 1891 Comments 1887 It must be called before calling any other parameter manager routine. The NLS 1888 information is stored inside the parameter manager context and used in 1892 It must be called before calling any other parameter manager routine. The NLS 1893 information is stored inside the parameter manager context and used in 1889 1894 subsequent calls to OCIExtract routines. 1890 1895 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR 1891 1896 Parameters 1892 1897 hndl (IN/OUT) - The OCI environment or session handle. 1893 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1894 err and this function returns OCI_ERROR. Diagnostic information 1898 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1899 err and this function returns OCI_ERROR. Diagnostic information 1895 1900 can be obtained by calling OCIErrorGet(). 1896 1901 Related Functions … … 1901 1906 OCI Extract Terminate 1902 1907 Purpose 1903 This function releases all dynamically allocated storage and may perform 1908 This function releases all dynamically allocated storage and may perform 1904 1909 other internal bookkeeping functions. 1905 1910 Syntax … … 1910 1915 Parameters 1911 1916 hndl (IN/OUT) - The OCI environment or session handle. 1912 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1913 err and this function returns OCI_ERROR. Diagnostic information 1917 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1918 err and this function returns OCI_ERROR. Diagnostic information 1914 1919 can be obtained by calling OCIErrorGet(). 1915 1920 Related Functions … … 1920 1925 OCI Extract Reset 1921 1926 Purpose 1922 The memory currently used for parameter storage, key definition storage, and 1927 The memory currently used for parameter storage, key definition storage, and 1923 1928 parameter value lists is freed and the structure is reinitialized. 1924 1929 Syntax … … 1928 1933 Parameters 1929 1934 hndl (IN/OUT) - The OCI environment or session handle. 1930 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1931 err and this function returns OCI_ERROR. Diagnostic information 1935 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1936 err and this function returns OCI_ERROR. Diagnostic information 1932 1937 can be obtained by calling OCIErrorGet(). 1933 1938 Related Functions … … 1941 1946 sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys); 1942 1947 Comments 1943 This routine must be called prior to the first call of OCIExtractSetKey(). 1948 This routine must be called prior to the first call of OCIExtractSetKey(). 1944 1949 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR 1945 1950 Parameters 1946 1951 hndl (IN/OUT) - The OCI environment or session handle. 1947 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1948 err and this function returns OCI_ERROR. Diagnostic information 1952 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1953 err and this function returns OCI_ERROR. Diagnostic information 1949 1954 can be obtained by calling OCIErrorGet(). 1950 numkeys (IN) - The number of keys that will be registered with 1955 numkeys (IN) - The number of keys that will be registered with 1951 1956 OCIExtractSetKey(). 1952 1957 Related Functions … … 1959 1964 Registers information about a key with the parameter manager. 1960 1965 Syntax 1961 sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 1966 sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 1962 1967 ub1 type, ub4 flag, CONST dvoid *defval, 1963 1968 CONST sb4 *intrange, CONST OraText *CONST *strlist); 1964 1969 Comments 1965 This routine must be called after calling OCIExtractSetKey() and before 1966 calling OCIExtractFromFile() or OCIExtractFromStr(). 1970 This routine must be called after calling OCIExtractSetKey() and before 1971 calling OCIExtractFromFile() or OCIExtractFromStr(). 1967 1972 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR 1968 1973 Parameters 1969 1974 hndl (IN/OUT) - The OCI environment or session handle. 1970 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1971 err and this function returns OCI_ERROR. Diagnostic information 1975 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 1976 err and this function returns OCI_ERROR. Diagnostic information 1972 1977 can be obtained by calling OCIErrorGet(). 1973 1978 name (IN) - The name of the key. 1974 type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER, 1975 OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or 1979 type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER, 1980 OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or 1976 1981 OCI_EXTRACT_TYPE_BOOLEAN). 1977 flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values 1982 flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values 1978 1983 or 0 otherwise. 1979 defval (IN) - Set to the default value for the key. May be NULL if there is 1980 no default. A string default must be a (text*) type, an 1981 integer default must be an (sb4*) type, and a boolean default 1984 defval (IN) - Set to the default value for the key. May be NULL if there is 1985 no default. A string default must be a (text*) type, an 1986 integer default must be an (sb4*) type, and a boolean default 1982 1987 must be a (ub1*) type. 1983 intrange (IN) - Starting and ending values for the allowable range of integer 1984 values. May be NULL if the key is not an integer type or if 1988 intrange (IN) - Starting and ending values for the allowable range of integer 1989 values. May be NULL if the key is not an integer type or if 1985 1990 all integer values are acceptable. 1986 strlist (IN) - List of all acceptable text strings for the key. May be NULL 1987 if the key is not a string type or if all text values are 1991 strlist (IN) - List of all acceptable text strings for the key. May be NULL 1992 if the key is not a string type or if all text values are 1988 1993 acceptable. 1989 1994 Related Functions … … 1994 1999 OCI Extract parameters From File 1995 2000 Purpose 1996 The keys and their values in the given file are processed. 1997 Syntax 1998 sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 2001 The keys and their values in the given file are processed. 2002 Syntax 2003 sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 1999 2004 OraText *filename); 2000 2005 Comments … … 2002 2007 Parameters 2003 2008 hndl (IN/OUT) - The OCI environment or session handle. 2004 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2005 err and this function returns OCI_ERROR. Diagnostic information 2009 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2010 err and this function returns OCI_ERROR. Diagnostic information 2006 2011 can be obtained by calling OCIErrorGet(). 2007 flag (IN) - Zero or has one or more of the following bits set: 2008 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 2009 OCI_EXTRACT_APPEND_VALUES. 2012 flag (IN) - Zero or has one or more of the following bits set: 2013 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 2014 OCI_EXTRACT_APPEND_VALUES. 2010 2015 filename (IN) - Null-terminated filename string. 2011 2016 Related Functions … … 2015 2020 OCI Extract parameters From String 2016 2021 Purpose 2017 The keys and their values in the given string are processed. 2022 The keys and their values in the given string are processed. 2018 2023 Syntax 2019 2024 sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input); … … 2022 2027 Parameters 2023 2028 hndl (IN/OUT) - The OCI environment or session handle. 2024 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2025 err and this function returns OCI_ERROR. Diagnostic information 2029 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2030 err and this function returns OCI_ERROR. Diagnostic information 2026 2031 can be obtained by calling OCIErrorGet(). 2027 flag (IN) - Zero or has one or more of the following bits set: 2028 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 2029 OCI_EXTRACT_APPEND_VALUES. 2032 flag (IN) - Zero or has one or more of the following bits set: 2033 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 2034 OCI_EXTRACT_APPEND_VALUES. 2030 2035 input (IN) - Null-terminated input string. 2031 2036 Related Functions … … 2037 2042 Gets the integer value for the specified key. 2038 2043 Syntax 2039 sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, 2044 sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, 2040 2045 uword valno, sb4 *retval); 2041 2046 Comments 2042 2047 The valno'th value (starting with 0) is returned. 2043 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2048 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2044 2049 OCI_NO_DATA means that there is no valno'th value for this key. 2045 2050 Parameters 2046 2051 hndl (IN) - The OCI environment or session handle. 2047 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2048 err and this function returns OCI_ERROR. Diagnostic information 2052 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2053 err and this function returns OCI_ERROR. Diagnostic information 2049 2054 can be obtained by calling OCIErrorGet(). 2050 2055 keyname (IN) - Key name. … … 2057 2062 OCI Extract To Boolean 2058 2063 Purpose 2059 Gets the boolean value for the specified key. 2060 Syntax 2061 sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 2064 Gets the boolean value for the specified key. 2065 Syntax 2066 sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 2062 2067 uword valno, ub1 *retval); 2063 2068 Comments 2064 2069 The valno'th value (starting with 0) is returned. 2065 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2070 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2066 2071 OCI_NO_DATA means that there is no valno'th value for this key. 2067 2072 Parameters 2068 2073 hndl (IN) - The OCI environment or session handle. 2069 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2070 err and this function returns OCI_ERROR. Diagnostic information 2074 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2075 err and this function returns OCI_ERROR. Diagnostic information 2071 2076 can be obtained by calling OCIErrorGet(). 2072 2077 keyname (IN) - Key name. … … 2081 2086 Gets the string value for the specified key. 2082 2087 Syntax 2083 sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 2088 sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 2084 2089 uword valno, OraText *retval, uword buflen); 2085 2090 Comments 2086 2091 The valno'th value (starting with 0) is returned. 2087 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2092 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2088 2093 OCI_NO_DATA means that there is no valno'th value for this key. 2089 2094 Parameters 2090 2095 hndl (IN) - The OCI environment or session handle. 2091 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2092 err and this function returns OCI_ERROR. Diagnostic information 2096 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2097 err and this function returns OCI_ERROR. Diagnostic information 2093 2098 can be obtained by calling OCIErrorGet(). 2094 2099 keyname (IN) - Key name. … … 2106 2111 Gets the OCINumber value for the specified key. 2107 2112 Syntax 2108 sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 2113 sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 2109 2114 uword valno, OCINumber *retval); 2110 2115 Comments 2111 2116 The valno'th value (starting with 0) is returned. 2112 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2117 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 2113 2118 OCI_NO_DATA means that there is no valno'th value for this key. 2114 2119 Parameters 2115 2120 hndl (IN) - The OCI environment or session handle. 2116 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2117 err and this function returns OCI_ERROR. Diagnostic information 2121 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2122 err and this function returns OCI_ERROR. Diagnostic information 2118 2123 can be obtained by calling OCIErrorGet(). 2119 2124 keyname (IN) - Key name. … … 2126 2131 OCI Extract To parameter List 2127 2132 Purpose 2128 Generates a list of parameters from the parameter structures that are stored 2129 in memory. 2133 Generates a list of parameters from the parameter structures that are stored 2134 in memory. 2130 2135 Syntax 2131 2136 sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys); … … 2135 2140 Parameters 2136 2141 hndl (IN) - The OCI environment or session handle. 2137 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2138 err and this function returns OCI_ERROR. Diagnostic information 2142 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2143 err and this function returns OCI_ERROR. Diagnostic information 2139 2144 can be obtained by calling OCIErrorGet(). 2140 2145 numkeys (OUT) - Number of distinct keys stored in memory. … … 2148 2153 Generates a list of values for the a parameter in the parameter list. 2149 2154 Syntax 2150 sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, 2151 OraText *name, ub1 *type, uword *numvals, 2155 sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, 2156 OraText *name, ub1 *type, uword *numvals, 2152 2157 dvoid*** values); 2153 2158 Comments 2154 Parameters are specified by an index. OCIExtractToList() must be called prior 2155 to calling this routine to generate the parameter list from the parameter 2156 structures that are stored in memory. 2159 Parameters are specified by an index. OCIExtractToList() must be called prior 2160 to calling this routine to generate the parameter list from the parameter 2161 structures that are stored in memory. 2157 2162 Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR 2158 2163 Parameters 2159 2164 hndl (IN) - The OCI environment or session handle. 2160 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2161 err and this function returns OCI_ERROR. Diagnostic information 2165 err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 2166 err and this function returns OCI_ERROR. Diagnostic information 2162 2167 can be obtained by calling OCIErrorGet(). 2163 2168 name (OUT) - Name of the key for the current parameter. 2164 type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING, 2165 OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or 2169 type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING, 2170 OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or 2166 2171 OCI_EXTRACT_TYPE_BOOLEAN) 2167 2172 numvals (OUT) - Number of values for this parameter. … … 2172 2177 2173 2178 ************************ OCIFileClose() *********************************** 2174 2179 2175 2180 Name 2176 2181 OCIFileClose - Oracle Call Interface FILE i/o CLOSE … … 2180 2185 2181 2186 Syntax 2182 sword OCIFileClose ( dvoid *hndl, 2187 sword OCIFileClose ( dvoid *hndl, 2183 2188 OCIError *err, 2184 2189 OCIFileObject *filep ) … … 2186 2191 Comments 2187 2192 This function will close a previously opened file. If the function succeeds 2188 then OCI_SUCCESS will be returned, else OCI_ERROR. 2189 2193 then OCI_SUCCESS will be returned, else OCI_ERROR. 2194 2190 2195 Parameters 2191 2196 hndl (IN) - the OCI environment or session handle. … … 2194 2199 2195 2200 Related Functions 2196 OCIFileOpen. 2201 OCIFileOpen. 2197 2202 2198 2203 … … 2207 2212 2208 2213 Syntax 2209 sword OCIFileExists ( dvoid *hndl, 2210 OCIError *err, 2214 sword OCIFileExists ( dvoid *hndl, 2215 OCIError *err, 2211 2216 OraText *filename, 2212 2217 OraText *path, … … 2217 2222 be set to FALSE. 2218 2223 The function will return OCI_ERROR if any error is encountered, else 2219 it will return OCI_ERROR. 2224 it will return OCI_ERROR. 2220 2225 2221 2226 Parameters … … 2228 2233 Related Functions. 2229 2234 None. 2230 2235 2231 2236 2232 2237 **************************** OCIFileFlush() ****************************** … … 2240 2245 2241 2246 Syntax 2242 sword OCIFileFlush ( dvoid *hndl, 2247 sword OCIFileFlush ( dvoid *hndl, 2243 2248 OCIError *err, 2244 2249 OCIFileObject *filep ) … … 2248 2253 it will return OCI_ERROR. 2249 2254 2250 Parameters 2255 Parameters 2251 2256 hndl (IN) - the OCI environment or session handle. 2252 2257 err (OUT) - the OCI error handle … … 2267 2272 2268 2273 Syntax 2269 OCIFileGetLength(dvoid *hndl, 2274 OCIFileGetLength(dvoid *hndl, 2270 2275 OCIError *err, 2271 2276 OraText *filename, … … 2277 2282 The function will return OCI_ERROR if any error is encountered, else 2278 2283 it will return OCI_ERROR. 2279 2284 2280 2285 Parameters 2281 2286 hndl (IN) - the OCI environment or session handle. 2282 err (OUT) - the OCI error handle. If there is an error, it is recorded 2283 in err and this function returns OCI_ERROR. Diagnostic information can be 2287 err (OUT) - the OCI error handle. If there is an error, it is recorded 2288 in err and this function returns OCI_ERROR. Diagnostic information can be 2284 2289 obtained by calling OCIErrorGet(). 2285 2290 filename (IN) - file name. … … 2294 2299 2295 2300 ******************************** OCIFileInit() ***************************** 2296 2301 2297 2302 Name 2298 2303 OCIFileInit - Oracle Call Interface FILE i/o INITialize … … 2302 2307 2303 2308 Syntax 2304 sword OCIFileInit ( dvoid *hndl, 2309 sword OCIFileInit ( dvoid *hndl, 2305 2310 OCIError *err) 2306 2311 … … 2310 2315 The function will return OCI_ERROR if any error is encountered, else 2311 2316 it will return OCI_ERROR. 2312 2317 2313 2318 Parameters 2314 2319 hndl(IN) - OCI environment or session handle. … … 2317 2322 Related Functions 2318 2323 OCIFileTerm 2319 2324 2320 2325 2321 2326 … … 2329 2334 2330 2335 Syntax 2331 sword OCIFileOpen ( dvoid *hndl, 2336 sword OCIFileOpen ( dvoid *hndl, 2332 2337 OCIError *err, 2333 2338 OCIFileObject **filep, … … 2335 2340 OraText *path, 2336 2341 ub4 mode, 2337 ub4 create, 2342 ub4 create, 2338 2343 ub4 type ) 2339 2344 2340 2345 Comments 2341 2346 OCIFileOpen returns a handle to the open file in filep if the file is 2342 successfully opened. 2347 successfully opened. 2343 2348 If one wants to use the standard file objects (stdin, stdout & stderr) 2344 then OCIFileOpen whould be called with the type filed containing the 2345 appropriate type (see the parameter type). If any of the standard files 2349 then OCIFileOpen whould be called with the type filed containing the 2350 appropriate type (see the parameter type). If any of the standard files 2346 2351 are specified then filename, path, mode and create are ignored. 2347 2352 The function will return OCI_ERROR if any error is encountered, else … … 2350 2355 Parameters 2351 2356 hndl (OUT) - the OCI environment or session handle. 2352 err (OUT) - the OCI error handle. If there is an error, it is recorded 2353 in err and this function returns OCI_ERROR. Diagnostic information can be 2357 err (OUT) - the OCI error handle. If there is an error, it is recorded 2358 in err and this function returns OCI_ERROR. Diagnostic information can be 2354 2359 obtained by calling OCIErrorGet(). 2355 2360 filep (OUT) - the file object to be returned. … … 2359 2364 OCI_FILE_WRITEONLY, OCI_FILE_READ_WRITE). 2360 2365 create - should the file be created if it does not exist. Valid values 2361 are: 2362 OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists. 2366 are: 2367 OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists. 2363 2368 If the file already exists overwrite it. 2364 2369 OCI_FILE_EXIST - open it if it exists, else fail. 2365 2370 OCI_FILE_EXCL - fail if the file exists, else create. 2366 2371 OCI_FILE_CREATE - open the file if it exists, and create it if it doesn't. 2367 OCI_FILE_APPEND - set the file pointer to the end of the file prior to 2372 OCI_FILE_APPEND - set the file pointer to the end of the file prior to 2368 2373 writing(this flag can be OR'ed with OCI_FILE_EXIST or 2369 2374 OCI_FILE_CREATE). 2370 type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN, 2375 type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN, 2371 2376 OCI_FILE_STDIN, OCI_FILE_STDOUT and OCI_FILE_STDERR. 2372 2377 If any of the standard files are specified then filename, path, mode … … 2379 2384 2380 2385 ************************** OCIFileRead() ************************************ 2381 2386 2382 2387 Name 2383 2388 OCIFileRead - Oracle Call Interface FILE i/o READ … … 2387 2392 2388 2393 Syntax 2389 sword OCIFileRead ( dvoid *hndl, 2394 sword OCIFileRead ( dvoid *hndl, 2390 2395 OCIError *err, 2391 2396 OCIFileObject *filep, … … 2403 2408 Parameters 2404 2409 hndl (IN) - the OCI environment or session handle. 2405 err (OUT) - the OCI error handle. If there is an error, it is recorded 2406 in err and this function returns OCI_ERROR. Diagnostic information can be 2410 err (OUT) - the OCI error handle. If there is an error, it is recorded 2411 in err and this function returns OCI_ERROR. Diagnostic information can be 2407 2412 obtained by calling OCIErrorGet(). 2408 2413 filep (IN/OUT) - a File Object that uniquely references the file. 2409 bufp (IN) - the pointer to a buffer into which the data will be read. The 2410 length of the allocated memory is assumed to be bufl. 2411 bufl - the length of the buffer in bytes. 2414 bufp (IN) - the pointer to a buffer into which the data will be read. The 2415 length of the allocated memory is assumed to be bufl. 2416 bufl - the length of the buffer in bytes. 2412 2417 bytesread (OUT) - the number of bytes read. 2413 2418 … … 2426 2431 2427 2432 Syntax 2428 sword OCIFileSeek ( dvoid *hndl, 2429 OCIError *err, 2433 sword OCIFileSeek ( dvoid *hndl, 2434 OCIError *err, 2430 2435 OCIFileObject *filep, 2431 2436 uword origin, … … 2439 2444 Parameters 2440 2445 hndl (IN) - the OCI environment or session handle. 2441 err (OUT) - the OCI error handle. If there is an error, it is recorded 2442 in err and this function returns OCI_ERROR. Diagnostic information can be 2446 err (OUT) - the OCI error handle. If there is an error, it is recorded 2447 in err and this function returns OCI_ERROR. Diagnostic information can be 2443 2448 obtained by calling OCIErrorGet(). 2444 2449 filep (IN/OUT) - a file handle that uniquely references the file. 2445 origin - The starting point we want to seek from. NOTE: The starting 2446 point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT 2447 (current position), or OCI_FILE_SEEK_END (end of file). 2448 offset - The number of bytes from the origin we want to start reading from. 2449 dir - The direction we want to go from the origin. NOTE: The direction 2450 can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD. 2451 2450 origin - The starting point we want to seek from. NOTE: The starting 2451 point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT 2452 (current position), or OCI_FILE_SEEK_END (end of file). 2453 offset - The number of bytes from the origin we want to start reading from. 2454 dir - The direction we want to go from the origin. NOTE: The direction 2455 can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD. 2456 2452 2457 Related Function 2453 2458 OCIFileOpen, OCIFileRead, OCIFileWrite … … 2464 2469 2465 2470 Syntax 2466 sword OCIFileTerm ( dvoid *hndl, 2471 sword OCIFileTerm ( dvoid *hndl, 2467 2472 OCIError *err ) 2468 2473 … … 2471 2476 The function will return OCI_ERROR if any error is encountered, else 2472 2477 it will return OCI_ERROR. 2473 2478 2474 2479 Parameters 2475 2480 hndl(IN) - OCI environment or session handle. 2476 err(OUT) - OCI error structure. 2477 2478 Related Functions 2479 OCIFileInit 2480 2481 2482 ********************************* OCIFileWrite() **************************** 2483 2484 Name 2481 err(OUT) - OCI error structure. 2482 2483 Related Functions 2484 OCIFileInit 2485 2486 2487 ********************************* OCIFileWrite() **************************** 2488 2489 Name 2485 2490 OCIFileWrite - Oracle Call Interface FILE i/o WRITE 2486 2491 … … 2489 2494 2490 2495 Syntax 2491 sword OCIFileWrite ( dvoid *hndl, 2492 OCIError *err, 2496 sword OCIFileWrite ( dvoid *hndl, 2497 OCIError *err, 2493 2498 OCIFileObject *filep, 2494 dvoid *bufp, 2499 dvoid *bufp, 2495 2500 ub4 buflen 2496 2501 ub4 *byteswritten ) … … 2503 2508 Parameters 2504 2509 hndl (IN) - the OCI environment or session handle. 2505 err (OUT) - the OCI error handle. If there is an error, it is recorded 2506 in err and this function returns OCI_ERROR. Diagnostic information can be 2510 err (OUT) - the OCI error handle. If there is an error, it is recorded 2511 in err and this function returns OCI_ERROR. Diagnostic information can be 2507 2512 obtained by calling OCIErrorGet(). 2508 2513 filep (IN/OUT) - a file handle that uniquely references the file. 2509 bufp (IN) - the pointer to a buffer from which the data will be written. 2514 bufp (IN) - the pointer to a buffer from which the data will be written. 2510 2515 The length of the allocated memory is assumed to be the value passed 2511 in bufl. 2516 in bufl. 2512 2517 bufl - the length of the buffer in bytes. 2513 2518 byteswritten (OUT) - the number of bytes written. 2514 2515 Related Functions 2516 OCIFileOpen, OCIFileSeek, OCIFileRead 2517 2518 2519 2520 2521 2522 OCIHandleAlloc() 2519 2520 Related Functions 2521 OCIFileOpen, OCIFileSeek, OCIFileRead 2522 2523 2524 2525 2526 2527 OCIHandleAlloc() 2523 2528 Name 2524 2529 OCI Get HaNDLe … … 2527 2532 Syntax 2528 2533 sword OCIHandleAlloc ( CONST dvoid *parenth, 2529 dvoid **hndlpp, 2530 ub4 type, 2534 dvoid **hndlpp, 2535 ub4 type, 2531 2536 size_t xtramem_sz, 2532 2537 dvoid **usrmempp); 2533 2538 Comments 2534 Returns a pointer to an allocated and initialized structure, corresponding to 2535 the type specified in type. A non-NULL handle is returned on success. Bind 2539 Returns a pointer to an allocated and initialized structure, corresponding to 2540 the type specified in type. A non-NULL handle is returned on success. Bind 2536 2541 handle and define handles are allocated with respect to a statement handle. All 2537 other handles are allocated with respect to an environment handle which is 2542 other handles are allocated with respect to an environment handle which is 2538 2543 passed in as a parent handle. 2539 No diagnostics are available on error. This call returns OCI_SUCCESS if 2544 No diagnostics are available on error. This call returns OCI_SUCCESS if 2540 2545 successful, or OCI_INVALID_HANDLE if an out-of-memory error occurs. 2541 Handles must be allocated using OCIHandleAlloc() before they can be passed 2546 Handles must be allocated using OCIHandleAlloc() before they can be passed 2542 2547 into an OCI call. 2543 2548 Parameters 2544 parenth (IN) - an environment or a statement handle. 2545 hndlpp (OUT) - returns a handle to a handle type. 2546 type (IN) - specifies the type of handle to be allocated. The specific types 2547 are: 2548 OCI_HTYPE_ERROR - specifies generation of an error report handle of 2549 parenth (IN) - an environment or a statement handle. 2550 hndlpp (OUT) - returns a handle to a handle type. 2551 type (IN) - specifies the type of handle to be allocated. The specific types 2552 are: 2553 OCI_HTYPE_ERROR - specifies generation of an error report handle of 2549 2554 C type OCIError 2550 OCI_HTYPE_SVCCTX - specifies generation of a service context handle 2555 OCI_HTYPE_SVCCTX - specifies generation of a service context handle 2551 2556 of C type OCISvcCtx 2552 OCI_HTYPE_STMT - specifies generation of a statement (application 2557 OCI_HTYPE_STMT - specifies generation of a statement (application 2553 2558 request) handle of C type OCIStmt 2554 OCI_HTYPE_BIND - specifies generation of a bind information handle 2559 OCI_HTYPE_BIND - specifies generation of a bind information handle 2555 2560 of C type OCIBind 2556 OCI_HTYPE_DEFINE - specifies generation of a column definition 2561 OCI_HTYPE_DEFINE - specifies generation of a column definition 2557 2562 handle of C type OCIDefine 2558 OCI_HTYPE_DESCRIBE - specifies generation of a select list 2563 OCI_HTYPE_DESCRIBE - specifies generation of a select list 2559 2564 description handle of C type OCIDesc 2560 OCI_HTYPE_SERVER - specifies generation of a server context handle 2565 OCI_HTYPE_SERVER - specifies generation of a server context handle 2561 2566 of C type OCIServer 2562 OCI_HTYPE_SESSION - specifies generation of an authentication 2567 OCI_HTYPE_SESSION - specifies generation of an authentication 2563 2568 context handle of C type OCISession 2564 2569 OCI_HTYPE_TRANS - specifies generation of a transaction context 2565 2570 handle of C type OCITrans 2566 OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex 2571 OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex 2567 2572 object retrieval handle of C type OCIComplexObject 2568 OCI_HTYPE_SECURITY - specifies generation of a security handle of C 2573 OCI_HTYPE_SECURITY - specifies generation of a security handle of C 2569 2574 type OCISecurity 2570 2575 xtramem_sz (IN) - specifies an amount of user memory to be allocated. 2571 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 2572 allocated by the call for the user. 2576 usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 2577 allocated by the call for the user. 2573 2578 Related Functions 2574 2579 OCIHandleFree() … … 2585 2590 ub4 type); 2586 2591 Comments 2587 This call frees up storage associated with a handle, corresponding to the type 2592 This call frees up storage associated with a handle, corresponding to the type 2588 2593 specified in the type parameter. 2589 2594 This call returns either OCI_SUCCESS or OCI_INVALID_HANDLE. 2590 All handles must be explicitly deallocated. OCI will not deallocate a child 2595 All handles must be explicitly deallocated. OCI will not deallocate a child 2591 2596 handle if the parent is deallocated. 2592 2597 Parameters 2593 2598 hndlp (IN) - an opaque pointer to some storage. 2594 type (IN) - specifies the type of storage to be allocated. The specific types 2599 type (IN) - specifies the type of storage to be allocated. The specific types 2595 2600 are: 2596 2601 OCI_HTYPE_ENV - an environment handle … … 2619 2624 Syntax 2620 2625 sword OCIInitialize ( ub4 mode, 2621 CONST dvoid *ctxp, 2622 CONST dvoid *(*malocfp) 2626 CONST dvoid *ctxp, 2627 CONST dvoid *(*malocfp) 2623 2628 ( dvoid *ctxp, 2624 2629 size_t size ), … … 2632 2637 Comments 2633 2638 This call initializes the OCI process environment. 2634 OCIInitialize() must be invoked before any other OCI call. 2639 OCIInitialize() must be invoked before any other OCI call. 2635 2640 Parameters 2636 2641 mode (IN) - specifies initialization of the mode. The valid modes are: 2637 2642 OCI_DEFAULT - default mode. 2638 OCI_THREADED - threaded environment. In this mode, internal data 2639 structures are protected from concurrent accesses by multiple threads. 2640 OCI_OBJECT - will use navigational object interface. 2641 ctxp (IN) - user defined context for the memory call back routines. 2642 malocfp (IN) - user-defined memory allocation function. If mode is 2643 OCI_THREADED - threaded environment. In this mode, internal data 2644 structures are protected from concurrent accesses by multiple threads. 2645 OCI_OBJECT - will use navigational object interface. 2646 ctxp (IN) - user defined context for the memory call back routines. 2647 malocfp (IN) - user-defined memory allocation function. If mode is 2643 2648 OCI_THREADED, this memory allocation routine must be thread safe. 2644 2649 ctxp - context pointer for the user-defined memory allocation function. 2645 size - size of memory to be allocated by the user-defined memory 2650 size - size of memory to be allocated by the user-defined memory 2646 2651 allocation function 2647 ralocfp (IN) - user-defined memory re-allocation function. If mode is 2652 ralocfp (IN) - user-defined memory re-allocation function. If mode is 2648 2653 OCI_THREADED, this memory allocation routine must be thread safe. 2649 ctxp - context pointer for the user-defined memory reallocation 2654 ctxp - context pointer for the user-defined memory reallocation 2650 2655 function. 2651 2656 memp - pointer to memory block 2652 2657 newsize - new size of memory to be allocated 2653 mfreefp (IN) - user-defined memory free function. If mode is 2658 mfreefp (IN) - user-defined memory free function. If mode is 2654 2659 OCI_THREADED, this memory free routine must be thread safe. 2655 2660 ctxp - context pointer for the user-defined memory free function. 2656 2661 memptr - pointer to memory to be freed 2657 2662 Example 2658 See the description of OCIStmtPrepare() on page 13-96 for an example showing 2663 See the description of OCIStmtPrepare() on page 13-96 for an example showing 2659 2664 the use of OCIInitialize(). 2660 2665 Related Functions … … 2691 2696 OCI Application context Set 2692 2697 Purpose 2693 Set an attribute and its value for a particular application context 2698 Set an attribute and its value for a particular application context 2694 2699 namespace 2695 2700 Syntax … … 2701 2706 Please note that the information set on the session handle is sent to the server during the next OCIStatementExecute or OCISessionBegin. 2702 2707 2703 This information is cleared from the session handle, once the information 2708 This information is cleared from the session handle, once the information 2704 2709 has been sent over to the server,and should be setup again if needed. 2705 2710 … … 2716 2721 2717 2722 Returns 2718 error if any 2723 error if any 2719 2724 Example 2720 2725 … … 2740 2745 attributes are cleared 2741 2746 nsptrlen (IN) - length of the nsptr 2742 errhp (OUT) - Error from the API 2747 errhp (OUT) - Error from the API 2743 2748 mode (IN) - mode of operation (OCI_DEFAULT) 2744 2749 Example … … 2749 2754 Related Functions 2750 2755 OCIAppCtxSet 2751 ---------------------- OCIIntervalAssign --------------------------------- 2752 sword OCIIntervalAssign(dvoid *hndl, OCIError *err, 2756 ---------------------- OCIIntervalAssign --------------------------------- 2757 sword OCIIntervalAssign(dvoid *hndl, OCIError *err, 2753 2758 CONST OCIInterval *inpinter, OCIInterval *outinter ); 2754 2759 … … 2761 2766 The error recorded in 'err' can be retrieved by calling 2762 2767 OCIErrorGet(). 2763 (IN) inpinter - Input Interval 2764 (OUT) outinter - Output Interval 2768 (IN) inpinter - Input Interval 2769 (OUT) outinter - Output Interval 2765 2770 RETURNS 2766 2771 OCI_INVALID_HANDLE if 'err' is NULL. 2767 2772 OCI_SUCCESS otherwise 2768 2773 2769 ---------------------- OCIIntervalCheck ------------------------------------ 2774 ---------------------- OCIIntervalCheck ------------------------------------ 2770 2775 sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval, 2771 2776 ub4 *valid ); … … 2779 2784 The error recorded in 'err' can be retrieved by calling 2780 2785 OCIErrorGet(). 2781 (IN) interval - Interval to be checked 2786 (IN) interval - Interval to be checked 2782 2787 (OUT) valid - Zero if the interval is valid, else returns an Ored 2783 2788 combination of the following codes. … … 2800 2805 OCI_INTER_FRACSEC_BELOW_VALID 0x2000 Bad fractional second Low/High 2801 2806 2802 2807 2803 2808 RETURNS 2804 2809 OCI_SUCCESS if interval is okay 2805 2810 OCI_INVALID_HANDLE if 'err' is NULL. 2806 2811 2807 ---------------------- OCIIntervalCompare ----------------------------------- 2808 sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 2812 ---------------------- OCIIntervalCompare ----------------------------------- 2813 sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 2809 2814 OCIInterval *inter2, sword *result ); 2810 2815 2811 2816 DESCRIPTION 2812 Compares two intervals, returns 0 if equal, -1 if inter1 < inter2, 2817 Compares two intervals, returns 0 if equal, -1 if inter1 < inter2, 2813 2818 1 if inter1 > inter2 2814 2819 PARAMETERS 2815 hndl (IN) - Session/Env handle. 2820 hndl (IN) - Session/Env handle. 2816 2821 err (IN/OUT) - error handle. If there is an error, it is 2817 2822 recorded in 'err' and this function returns OCI_ERROR. 2818 2823 The error recorded in 'err' can be retrieved by calling 2819 2824 OCIErrorGet(). 2820 inter1 (IN) - Interval to be compared 2821 inter2 (IN) - Interval to be compared 2822 result (OUT) - comparison result, 0 if equal, -1 if inter1 < inter2, 2825 inter1 (IN) - Interval to be compared 2826 inter2 (IN) - Interval to be compared 2827 result (OUT) - comparison result, 0 if equal, -1 if inter1 < inter2, 2823 2828 1 if inter1 > inter2 2824 2829 … … 2826 2831 OCI_SUCCESS on success 2827 2832 OCI_INVALID_HANDLE if 'err' is NULL. 2828 OCI_ERROR if 2833 OCI_ERROR if 2829 2834 the two input datetimes are not mutually comparable. 2830 2835 2831 ---------------------- OCIIntervalDivide ------------------------------------ 2832 sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 2836 ---------------------- OCIIntervalDivide ------------------------------------ 2837 sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 2833 2838 OCINumber *divisor, OCIInterval *result ); 2834 2839 2835 2840 DESCRIPTION 2836 2841 Divides an interval by an Oracle Number to produce an interval 2837 2842 PARAMETERS 2838 hndl (IN) - Session/Env handle. 2843 hndl (IN) - Session/Env handle. 2839 2844 err (IN/OUT) - error handle. If there is an error, it is 2840 2845 recorded in 'err' and this function returns OCI_ERROR. 2841 2846 The error recorded in 'err' can be retrieved by calling 2842 2847 OCIErrorGet(). 2843 dividend (IN) - Interval to be divided 2844 divisor (IN) - Oracle Number dividing `dividend' 2845 result (OUT) - resulting interval (dividend / divisor) 2848 dividend (IN) - Interval to be divided 2849 divisor (IN) - Oracle Number dividing `dividend' 2850 result (OUT) - resulting interval (dividend / divisor) 2846 2851 RETURNS 2847 2852 OCI_SUCCESS on success 2848 2853 OCI_INVALID_HANDLE if 'err' is NULL. 2849 2854 2850 ---------------------- OCIIntervalFromNumber -------------------- 2851 sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, 2855 ---------------------- OCIIntervalFromNumber -------------------- 2856 sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, 2852 2857 OCIInterval *inter, OCINumber *number); 2853 2858 DESCRIPTION 2854 2859 Converts an interval to an Oracle Number 2855 2860 PARAMETERS 2856 hndl (IN) - Session/Env handle. 2861 hndl (IN) - Session/Env handle. 2857 2862 err (IN/OUT) - error handle. If there is an error, it is 2858 2863 recorded in 'err' and this function returns OCI_ERROR. 2859 2864 The error recorded in 'err' can be retrieved by calling 2860 2865 OCIErrorGet(). 2861 (OUT) interval - Interval to be converted 2866 (OUT) interval - Interval to be converted 2862 2867 (IN) number - Oracle number result (in years for YEARMONTH interval 2863 2868 and in days for DAYSECOND) 2864 2869 RETURNS 2865 OCI_SUCCESS on success 2870 OCI_SUCCESS on success 2866 2871 OCI_INVALID_HANDLE if 'err' is NULL. 2867 2872 OCI_ERROR on error. … … 2870 2875 the unit chosen is hours) will be included in the Oracle number produced. 2871 2876 Excess precision will be truncated. 2872 2873 ---------------------- OCIIntervalFromText --------------------------------- 2874 sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 2877 2878 ---------------------- OCIIntervalFromText --------------------------------- 2879 sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 2875 2880 size_t str_len, OCIInterval *result ); 2876 2881 … … 2880 2885 PARAMETERS 2881 2886 2882 hndl (IN) - Session/Env handle. 2887 hndl (IN) - Session/Env handle. 2883 2888 err (IN/OUT) - error handle. If there is an error, it is 2884 2889 recorded in 'err' and this function returns OCI_ERROR. 2885 2890 The error recorded in 'err' can be retrieved by calling 2886 2891 OCIErrorGet(). 2887 (IN) inpstr - Input string 2888 (IN) str_len - Length of input string 2889 (OUT) result - Resultant interval 2892 (IN) inpstr - Input string 2893 (IN) str_len - Length of input string 2894 (OUT) result - Resultant interval 2890 2895 RETURNS 2891 2896 OCI_SUCCESS on success … … 2904 2909 2905 2910 2906 ---------------------- OCIIntervalGetDaySecond -------------------- 2911 ---------------------- OCIIntervalGetDaySecond -------------------- 2907 2912 2908 2913 DESCRIPTION … … 2913 2918 recorded in 'err' and this function returns OCI_ERROR. 2914 2919 The error recorded in 'err' can be retrieved by calling 2915 OCIErrorGet(). 2920 OCIErrorGet(). 2916 2921 day (OUT) - number of days 2917 2922 hour (OUT) - number of hours … … 2919 2924 sec (OUT) - number of secs 2920 2925 fsec (OUT) - number of fractional seconds 2921 result (IN) - resulting interval 2926 result (IN) - resulting interval 2922 2927 RETURNS 2923 2928 OCI_SUCCESS on success … … 2925 2930 2926 2931 2927 ---------------------- OCIIntervalGetYearMonth -------------------- 2932 ---------------------- OCIIntervalGetYearMonth -------------------- 2928 2933 2929 2934 DESCRIPTION … … 2934 2939 recorded in 'err' and this function returns OCI_ERROR. 2935 2940 The error recorded in 'err' can be retrieved by calling 2936 OCIErrorGet(). 2941 OCIErrorGet(). 2937 2942 year (OUT) - year value 2938 2943 month (OUT) - month value 2939 result (IN) - resulting interval 2944 result (IN) - resulting interval 2940 2945 RETURNS 2941 2946 OCI_SUCCESS on success … … 2945 2950 2946 2951 -------------------------- OCIIntervalAdd ------------------------------ 2947 sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 2952 sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 2948 2953 OCIInterval *addend2, OCIInterval *result ); 2949 NAME OCIIntervalAdd - Adds two intervals 2954 NAME OCIIntervalAdd - Adds two intervals 2950 2955 PARAMETERS 2951 hndl (IN) - Session/Env handle. 2956 hndl (IN) - Session/Env handle. 2952 2957 err (IN/OUT) - error handle. If there is an error, it is 2953 2958 recorded in 'err' and this function returns OCI_ERROR. 2954 2959 The error recorded in 'err' can be retrieved by calling 2955 2960 OCIErrorGet(). 2956 addend1 (IN) - Interval to be added 2957 addend2 (IN) - Interval to be added 2958 result (OUT) - resulting interval (addend1 + addend2) 2961 addend1 (IN) - Interval to be added 2962 addend2 (IN) - Interval to be added 2963 result (OUT) - resulting interval (addend1 + addend2) 2959 2964 DESCRIPTION 2960 2965 Adds two intervals to produce a resulting interval … … 2969 2974 The two input intervals must be mutually comparable 2970 2975 2971 ---------------------- OCIIntervalSubtract ------------------------------- 2972 sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 2976 ---------------------- OCIIntervalSubtract ------------------------------- 2977 sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 2973 2978 OCIInterval *subtrahend, OCIInterval *result ); 2974 2979 NAME - OCIIntervalSubtract - subtracts two intervals … … 2978 2983 recorded in 'err' and this function returns OCI_ERROR. 2979 2984 The error recorded in 'err' can be retrieved by calling 2980 OCIErrorGet(). 2981 minuend (IN) - interval to be subtracted from 2982 subtrahend (IN) - interval subtracted from minuend 2983 result (OUT) - resulting interval (minuend - subtrahend) 2985 OCIErrorGet(). 2986 minuend (IN) - interval to be subtracted from 2987 subtrahend (IN) - interval subtracted from minuend 2988 result (OUT) - resulting interval (minuend - subtrahend) 2984 2989 DESCRIPTION 2985 2990 Subtracts two intervals and stores the result in an interval … … 2989 2994 OCI_ERROR if: 2990 2995 the two input intervals are not mutually comparable. 2991 the resulting leading field would go below SB4MINVAL 2996 the resulting leading field would go below SB4MINVAL 2992 2997 the resulting leading field would go above SB4MAXVAL 2993 2998 2994 ---------------------- OCIIntervalMultiply --------------------------------- 2999 ---------------------- OCIIntervalMultiply --------------------------------- 2995 3000 sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter, 2996 3001 OCINumber *nfactor, OCIInterval *result ); … … 2999 3004 Multiplies an interval by an Oracle Number to produce an interval 3000 3005 PARAMETERS 3001 hndl (IN) - Session/Env handle. 3006 hndl (IN) - Session/Env handle. 3002 3007 err (IN/OUT) - error handle. If there is an error, it is 3003 3008 recorded in 'err' and this function returns OCI_ERROR. 3004 3009 The error recorded in 'err' can be retrieved by calling 3005 3010 OCIErrorGet(). 3006 inter (IN) - Interval to be multiplied 3007 nfactor (IN) - Oracle Number to be multiplied 3008 result (OUT) - resulting interval (ifactor * nfactor) 3011 inter (IN) - Interval to be multiplied 3012 nfactor (IN) - Oracle Number to be multiplied 3013 result (OUT) - resulting interval (ifactor * nfactor) 3009 3014 RETURNS 3010 3015 OCI_SUCCESS on success … … 3015 3020 3016 3021 3017 ---------------------- OCIIntervalSetDaySecond -------------------- 3022 ---------------------- OCIIntervalSetDaySecond -------------------- 3018 3023 3019 3024 DESCRIPTION … … 3024 3029 recorded in 'err' and this function returns OCI_ERROR. 3025 3030 The error recorded in 'err' can be retrieved by calling 3026 OCIErrorGet(). 3031 OCIErrorGet(). 3027 3032 day (IN) - number of days 3028 3033 hour (IN) - number of hours … … 3030 3035 sec (IN) - number of secs 3031 3036 fsec (IN) - number of fractional seconds 3032 result (OUT) - resulting interval 3037 result (OUT) - resulting interval 3033 3038 RETURNS 3034 3039 OCI_SUCCESS on success … … 3036 3041 3037 3042 3038 ---------------------- OCIIntervalSetYearMonth -------------------- 3043 ---------------------- OCIIntervalSetYearMonth -------------------- 3039 3044 3040 3045 DESCRIPTION … … 3045 3050 recorded in 'err' and this function returns OCI_ERROR. 3046 3051 The error recorded in 'err' can be retrieved by calling 3047 OCIErrorGet(). 3052 OCIErrorGet(). 3048 3053 year (IN) - year value 3049 3054 month (IN) - month value 3050 result (OUT) - resulting interval 3055 result (OUT) - resulting interval 3051 3056 RETURNS 3052 3057 OCI_SUCCESS on success … … 3061 3066 Converts an interval to an Oracle Number 3062 3067 PARAMETERS 3063 hndl (IN) - Session/Env handle. 3068 hndl (IN) - Session/Env handle. 3064 3069 err (IN/OUT) - error handle. If there is an error, it is 3065 3070 recorded in 'err' and this function returns OCI_ERROR. 3066 3071 The error recorded in 'err' can be retrieved by calling 3067 3072 OCIErrorGet(). 3068 (IN) inter - Interval to be converted 3073 (IN) inter - Interval to be converted 3069 3074 (OUT) number - Oracle number result (in years for YEARMONTH interval 3070 3075 and in days for DAYSECOND) 3071 3076 RETURNS 3072 3077 OCI_INVALID_HANDLE if 'err' is NULL. 3073 OCI_SUCCESS on success 3078 OCI_SUCCESS on success 3074 3079 NOTES 3075 3080 Fractional portions of the date (for instance, minutes and seconds if 3076 3081 the unit chosen is hours) will be included in the Oracle number produced. 3077 3082 Excess precision will be truncated. 3078 3083 3079 3084 ------------------------------- OCIIntervalToText ------------------------- 3080 3085 sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter, 3081 ub1 lfprec, ub1 fsprec, OraText *buffer, 3086 ub1 lfprec, ub1 fsprec, OraText *buffer, 3082 3087 size_t buflen, size_t *resultlen ); 3083 3088 … … 3085 3090 Given an interval, produces a string representing the interval. 3086 3091 PARAMETERS 3087 hndl (IN) - Session/Env handle. 3092 hndl (IN) - Session/Env handle. 3088 3093 err (IN/OUT) - error handle. If there is an error, it is 3089 3094 recorded in 'err' and this function returns OCI_ERROR. 3090 3095 The error recorded in 'err' can be retrieved by calling 3091 3096 OCIErrorGet(). 3092 (IN) inter - Interval to be converted 3097 (IN) inter - Interval to be converted 3093 3098 (IN) lfprec - Leading field precision. Number of digits used to 3094 3099 represent the leading field. 3095 3100 (IN) fsprec - Fractional second precision of the interval. Number of 3096 3101 digits used to represent the fractional seconds. 3097 (OUT) buffer - buffer to hold result 3098 (IN) buflen - length of above buffer 3099 (OUT) resultlen - length of result placed into buffer 3100 3102 (OUT) buffer - buffer to hold result 3103 (IN) buflen - length of above buffer 3104 (OUT) resultlen - length of result placed into buffer 3105 3101 3106 RETURNS 3102 3107 OCI_SUCCESS on success 3103 3108 OCI_INVALID_HANDLE if 'err' is NULL. 3104 OCI_ERROR 3109 OCI_ERROR 3105 3110 if the buffer is not large enough to hold the result 3106 3111 NOTES … … 3110 3115 DAY-TIME intervals (where optional fields are surrounded by brackets). 3111 3116 3112 ---------------------- OCIIntervalFromTZ -------------------- 3117 ---------------------- OCIIntervalFromTZ -------------------- 3113 3118 sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring, 3114 3119 size_t str_len, OCIInterval *result); … … 3126 3131 inpstring (IN) - pointer to the input string 3127 3132 str_len (IN) - inpstring length 3128 result - Output Interval 3133 result - Output Interval 3129 3134 RETURNS 3130 3135 OCI_SUCCESS on success … … 3137 3142 3138 3143 ----------------------- OCIKerbAttrSet --------------------- 3139 sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 auth_mode, 3140 ub1 *ftgt_ticket, ub4 ftgt_ticket_len, 3141 ub1 *ftgt_sesskey, ub4 ftgt_sesskey_len, 3142 ub2 ftgt_keytype, ub4 ftgt_ticket_flags, 3143 sb4 ftgt_auth_time, sb4 ftgt_start_time, 3144 sb4 ftgt_end_time, sb4 ftgt_renew_time, 3144 sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 auth_mode, 3145 ub1 *ftgt_ticket, ub4 ftgt_ticket_len, 3146 ub1 *ftgt_sesskey, ub4 ftgt_sesskey_len, 3147 ub2 ftgt_keytype, ub4 ftgt_ticket_flags, 3148 sb4 ftgt_auth_time, sb4 ftgt_start_time, 3149 sb4 ftgt_end_time, sb4 ftgt_renew_time, 3145 3150 text *ftgt_principal, ub4 ftgt_principal_len, 3146 text *ftgt_realm, ub4 ftgt_realm_len, 3151 text *ftgt_realm, ub4 ftgt_realm_len, 3147 3152 OCIError *errhp); 3148 3153 … … 3156 3161 be set. Options are: 3157 3162 3158 OCI_KERBCRED_PROXY 3163 OCI_KERBCRED_PROXY 3159 3164 - Set Kerberos credentials for use with 3160 3165 proxy authentication. 3161 OCI_KERBCRED_CLIENT_IDENTIFIER 3166 OCI_KERBCRED_CLIENT_IDENTIFIER 3162 3167 - Set Kerberos credentials for use 3163 3168 with secure client identifier. … … 3196 3201 Lda_Def *ldap ); 3197 3202 Comments 3198 Converts a V7 Lda_Def to a V8 service context handle. The action of this call 3199 can be reversed by passing the resulting service context handle to the 3203 Converts a V7 Lda_Def to a V8 service context handle. The action of this call 3204 can be reversed by passing the resulting service context handle to the 3200 3205 OCISvcCtxToLda() function. 3201 3206 Parameters 3202 svchpp (IN/OUT) - the service context handle. 3203 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3207 svchpp (IN/OUT) - the service context handle. 3208 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3204 3209 diagnostic information in the event of an error. 3205 ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from 3210 ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from 3206 3211 this service context. 3207 3212 Related Functions … … 3217 3222 3218 3223 Purpose 3219 Appends a LOB value at the end of another LOB. 3224 Appends a LOB value at the end of another LOB. 3220 3225 3221 3226 Syntax … … 3225 3230 OCILobLocator *src_locp ); 3226 3231 Comments 3227 Appends a LOB value at the end of LOB. The data is 3228 copied from the source to the destination at the end of the destination. The 3229 source and the destination must already exist. The destination LOB is 3232 Appends a LOB value at the end of LOB. The data is 3233 copied from the source to the destination at the end of the destination. The 3234 source and the destination must already exist. The destination LOB is 3230 3235 extended to accommodate the newly written data. 3231 3236 3232 It is an error to extend the destination LOB beyond the maximum length 3233 allowed or to try to copy from a NULL LOB. 3234 3235 Parameters 3236 svchp (IN) - the service context handle. 3237 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3238 diagnostic information in the event of an error. 3239 dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 3240 src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 3237 It is an error to extend the destination LOB beyond the maximum length 3238 allowed or to try to copy from a NULL LOB. 3239 3240 Parameters 3241 svchp (IN) - the service context handle. 3242 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3243 diagnostic information in the event of an error. 3244 dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 3245 src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 3241 3246 3242 3247 Related Functions … … 3257 3262 3258 3263 Syntax 3259 sword OCILobAssign ( OCIEnv *envhp, 3260 OCIError *errhp, 3261 CONST OCILobLocator *src_locp, 3264 sword OCILobAssign ( OCIEnv *envhp, 3265 OCIError *errhp, 3266 CONST OCILobLocator *src_locp, 3262 3267 OCILobLocator **dst_locpp ); 3263 3268 3264 3269 Comments 3265 Assign source locator to destination locator. After the assignment, both 3266 locators refer to the same LOB data. For internal LOBs, the source locator's 3267 LOB data gets copied to the destination locator's LOB data only when the 3268 destination locator gets stored in the table. Therefore, issuing a flush of 3269 the object containing the destination locator will copy the LOB data. For 3270 Assign source locator to destination locator. After the assignment, both 3271 locators refer to the same LOB data. For internal LOBs, the source locator's 3272 LOB data gets copied to the destination locator's LOB data only when the 3273 destination locator gets stored in the table. Therefore, issuing a flush of 3274 the object containing the destination locator will copy the LOB data. For 3270 3275 FILEs only the locator that refers to the OS file is copied to the table. The 3271 3276 OS file is not copied. … … 3276 3281 Parameters 3277 3282 envhp (IN/OUT) - OCI environment handle initialized in object mode. 3278 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 3279 in errhp and this function returns OCI_ERROR. Diagnostic information can be 3283 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 3284 in errhp and this function returns OCI_ERROR. Diagnostic information can be 3280 3285 obtained by calling OCIErrorGet(). 3281 3286 src_locp (IN) - LOB locator to copy from. 3282 dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space 3287 dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space 3283 3288 for the OCILobLocator by calling OCIDescriptorAlloc(). 3284 3289 … … 3299 3304 3300 3305 Syntax 3301 sword OCILobCharSetForm ( OCIEnv *envhp, 3302 OCIError *errhp, 3303 CONST OCILobLocator *locp, 3306 sword OCILobCharSetForm ( OCIEnv *envhp, 3307 OCIError *errhp, 3308 CONST OCILobLocator *locp, 3304 3309 ub1 *csfrm ); 3305 3310 3306 3311 Comments 3307 Returns the character set form of the input LOB locator in the csfrm output 3308 parameter. 3312 Returns the character set form of the input LOB locator in the csfrm output 3313 parameter. 3309 3314 3310 3315 Parameters 3311 3316 envhp (IN/OUT) - OCI environment handle initialized in object mode. 3312 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3313 is recorded in err and this function returns OCI_ERROR. Diagnostic 3317 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3318 is recorded in err and this function returns OCI_ERROR. Diagnostic 3314 3319 information can be obtained by calling OCIErrorGet(). 3315 3320 locp (IN) - LOB locator for which to get the character set form. 3316 csfrm(OUT) - character set form of the input LOB locator. If the input 3317 locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept 3318 of a character set for binary LOBs/FILEs. The caller must allocate space for 3321 csfrm(OUT) - character set form of the input LOB locator. If the input 3322 locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept 3323 of a character set for binary LOBs/FILEs. The caller must allocate space for 3319 3324 the csfrm (ub1) and not write into the space. 3320 3325 See also … … 3332 3337 3333 3338 Syntax 3334 sword OCILobCharSetId ( OCIEnv *envhp, 3335 OCIError *errhp, 3336 CONST OCILobLocator *locp, 3339 sword OCILobCharSetId ( OCIEnv *envhp, 3340 OCIError *errhp, 3341 CONST OCILobLocator *locp, 3337 3342 ub2 *csid ); 3338 3343 3339 3344 Comments 3340 Returns the character set ID of the input LOB locator in the cid output 3341 parameter. 3345 Returns the character set ID of the input LOB locator in the cid output 3346 parameter. 3342 3347 3343 3348 Parameters 3344 3349 envhp (IN/OUT) - OCI environment handle initialized in object mode. 3345 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3346 is recorded in err and this function returns OCI_ERROR. Diagnostic 3350 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3351 is recorded in err and this function returns OCI_ERROR. Diagnostic 3347 3352 information can be obtained by calling OCIErrorGet(). 3348 3353 locp (IN) - LOB locator for which to get the character set ID. 3349 csid (OUT) - character set ID of the input LOB locator. If the input locator 3350 is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a 3351 character set for binary LOBs/FILEs. The caller must allocate space for the 3354 csid (OUT) - character set ID of the input LOB locator. If the input locator 3355 is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a 3356 character set for binary LOBs/FILEs. The caller must allocate space for the 3352 3357 character set id of type ub2 and not write into the space. 3353 3358 … … 3375 3380 3376 3381 Comments 3377 Copies a portion of a LOB value into another LOB as specified. The data 3378 is copied from the source to the destination. The source (src_locp) and the 3382 Copies a portion of a LOB value into another LOB as specified. The data 3383 is copied from the source to the destination. The source (src_locp) and the 3379 3384 destination (dlopb) LOBs must already exist. 3380 If the data already exists at the destination's start position, it is 3381 overwritten with the source data. If the destination's start position is 3385 If the data already exists at the destination's start position, it is 3386 overwritten with the source data. If the destination's start position is 3382 3387 beyond the end of the current data, a hole is created from the end of the data 3383 to the beginning of the newly written data from the source. The destination 3384 LOB is extended to accommodate the newly written data if it extends 3385 beyond the current length of the destination LOB. 3386 It is an error to extend the destination LOB beyond the maximum length 3388 to the beginning of the newly written data from the source. The destination 3389 LOB is extended to accommodate the newly written data if it extends 3390 beyond the current length of the destination LOB. 3391 It is an error to extend the destination LOB beyond the maximum length 3387 3392 allowed or to try to copy from a NULL LOB. 3388 3393 Parameters 3389 svchp (IN) - the service context handle. 3390 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3391 diagnostic information in the event of an error. 3392 dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 3393 src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 3394 svchp (IN) - the service context handle. 3395 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3396 diagnostic information in the event of an error. 3397 dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 3398 src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 3394 3399 amount (IN) - the number of character or bytes, as appropriate, to be copied. 3395 dst_offset (IN) - this is the absolute offset for the destination LOB. 3396 For character LOBs it is the number of characters from the beginning of the 3397 LOB at which to begin writing. For binary LOBs it is the number of bytes from 3400 dst_offset (IN) - this is the absolute offset for the destination LOB. 3401 For character LOBs it is the number of characters from the beginning of the 3402 LOB at which to begin writing. For binary LOBs it is the number of bytes from 3398 3403 the beginning of the lob from which to begin reading. The offset starts at 1. 3399 src_offset (IN) - this is the absolute offset for the source LOB. 3400 For character LOBs it is the number of characters from the beginning of the 3404 src_offset (IN) - this is the absolute offset for the source LOB. 3405 For character LOBs it is the number of characters from the beginning of the 3401 3406 LOB, for binary LOBs it is the number of bytes. Starts at 1. 3402 3407 3403 See Also 3408 See Also 3404 3409 OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim() 3405 3410 … … 3424 3429 3425 3430 Comments 3426 svchp (IN) - the service context handle. 3427 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3428 diagnostic information in the event of an error. 3431 svchp (IN) - the service context handle. 3432 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3433 diagnostic information in the event of an error. 3429 3434 locp (IN/OUT) - a locator which points to the temporary Lob 3430 3435 csid (IN) - the character set id 3431 3436 csfrm(IN) - the character set form 3432 lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB, 3437 lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB, 3433 3438 OCI_TEMP_CLOB and OCI_TEMP_NCLOB 3434 3439 cache(IN)- TRUE if the temporary LOB goes through the cache; FALSE, if not. 3435 duration(IN)- duration of the temporary LOB; Can be a valid duration id or one 3440 duration(IN)- duration of the temporary LOB; Can be a valid duration id or one 3436 3441 of the values: OCI_DURATION_SESSION, OCI_DURATION_CALL 3437 3442 Note: OCI_DURATION_TRANSACTION is NOT supported in 8.1 … … 3459 3464 read/written from/to the lob through the input locator, the lob 3460 3465 buffering subsystem is *not* used. Note that this call does *not* 3461 implicitly flush the changes made in the buffering subsystem. The 3466 implicitly flush the changes made in the buffering subsystem. The 3462 3467 user must explicitly call OCILobFlushBuffer() to do this. 3463 3468 3464 3469 Parameters 3465 svchp (IN) - the service context handle. 3466 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3467 diagnostic information in the event of an error. 3468 locp (IN/OUT) - a locator uniquely referencing the LOB. 3470 svchp (IN) - the service context handle. 3471 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3472 diagnostic information in the event of an error. 3473 locp (IN/OUT) - a locator uniquely referencing the LOB. 3469 3474 3470 3475 Related Functions … … 3494 3499 Enable lob buffering for the input locator. The next time data is 3495 3500 read/written from/to the lob through the input locator, the lob 3496 buffering subsystem is used. 3497 3498 Once lob buffering is enabled for a locator, if that locator is passed to 3501 buffering subsystem is used. 3502 3503 Once lob buffering is enabled for a locator, if that locator is passed to 3499 3504 one of the following routines, an error is returned: 3500 3505 OCILobCopy, OCILobAppend, OCILobErase, OCILobGetLength, OCILobTrim 3501 3506 3502 3507 Parameters 3503 svchp (IN) - the service context handle. 3504 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3505 diagnostic information in the event of an error. 3506 locp (IN/OUT) - a locator uniquely referencing the LOB. 3508 svchp (IN) - the service context handle. 3509 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3510 diagnostic information in the event of an error. 3511 locp (IN/OUT) - a locator uniquely referencing the LOB. 3507 3512 3508 3513 Related Functions … … 3533 3538 Comments 3534 3539 Erases a specified portion of the LOB data starting at a specified offset. 3535 The actual number of characters/bytes erased is returned. The actual number 3536 of characters/bytes and the requested number of characters/bytes will differ 3537 if the end of the LOB data is reached before erasing the requested number of 3540 The actual number of characters/bytes erased is returned. The actual number 3541 of characters/bytes and the requested number of characters/bytes will differ 3542 if the end of the LOB data is reached before erasing the requested number of 3538 3543 characters/bytes. 3539 If a section of data from the middle of the LOB data is erased, a hole is 3544 If a section of data from the middle of the LOB data is erased, a hole is 3540 3545 created. When data from that hole is read, 0's are returned. If the LOB is 3541 3546 NULL, this routine will indicate that 0 characters/bytes were erased. … … 3543 3548 Parameters 3544 3549 svchp (IN) - the service context handle. 3545 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3550 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3546 3551 diagnostic information in the event of an error. 3547 3552 locp (IN/OUT) - the LOB for which to erase a section of data. 3548 amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT, 3553 amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT, 3549 3554 the actual number of characters/bytes erased. 3550 offset (IN) - absolute offset from the beginning of the LOB data from which 3555 offset (IN) - absolute offset from the beginning of the LOB data from which 3551 3556 to start erasing data. Starts at 1. 3552 3557 … … 3573 3578 not opened before using them. A LOB has to be closed before 3574 3579 the transaction commits else the transaction is rolled back. 3575 Open locators are closed if the transaction aborts. Multiple 3580 Open locators are closed if the transaction aborts. Multiple 3576 3581 users can open the same lob on different locators. 3577 3582 Parameters 3578 3583 svchp (IN) - the service context handle. 3579 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3584 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3580 3585 diagnostic information in the event of an error. 3581 3586 locp (IN/OUT) - locator points to the LOB to be opened 3582 3587 mode (IN) - mode in which to open the lob. The valid modes are 3583 read-only - OCI_FILE_READONLY, read-write - OCI_FILE_READWRITE 3588 read-only - OCI_FILE_READONLY, read-write - OCI_FILE_READWRITE 3584 3589 3585 3590 OCILobClose() … … 3599 3604 Comments 3600 3605 It is an error if the lob is not open at this time. All LOBs 3601 that have been opened in a transaction have to be closed 3606 that have been opened in a transaction have to be closed 3602 3607 before the transaction commits, else the transaction gets 3603 3608 rolled back. … … 3605 3610 Parameters 3606 3611 svchp (IN) - the service context handle. 3607 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3612 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3608 3613 diagnostic information in the event of an error. 3609 3614 locp (IN) - A locator that was opened using OCILobOpen() … … 3628 3633 Parameters 3629 3634 svchp (IN) - the service context handle. 3630 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3635 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3631 3636 diagnostic information in the event of an error. 3632 3637 filep (IN/OUT) - a pointer to a FILE locator to be closed. … … 3648 3653 3649 3654 Syntax 3650 sword OCILobFileCLoseAll ( OCISvcCtx *svchp, 3655 sword OCILobFileCLoseAll ( OCISvcCtx *svchp, 3651 3656 OCIError *errhp ); 3652 3657 … … 3656 3661 Parameters 3657 3662 svchp (IN) - the service context handle. 3658 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3663 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3659 3664 diagnostic information in the event of an error. 3660 3665 … … 3686 3691 Parameters 3687 3692 svchp (IN) - the OCI service context handle. 3688 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, 3689 it is recorded in err and this function returns OCI_ERROR. Diagnostic 3693 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, 3694 it is recorded in err and this function returns OCI_ERROR. Diagnostic 3690 3695 information can be obtained by calling OCIErrorGet(). 3691 3696 filep (IN) - pointer to the FILE locator that refers to the file. … … 3708 3713 Syntax 3709 3714 sword OCILobFileGetName ( OCIEnv *envhp, 3710 OCIError *errhp, 3711 CONST OCILobLocator *filep, 3715 OCIError *errhp, 3716 CONST OCILobLocator *filep, 3712 3717 OraText *dir_alias, 3713 ub2 *d_length, 3714 OraText *filename, 3718 ub2 *d_length, 3719 OraText *filename, 3715 3720 ub2 *f_length ); 3716 3721 3717 3722 Comments 3718 Returns the directory alias and file name associated with this file locator. 3723 Returns the directory alias and file name associated with this file locator. 3719 3724 3720 3725 Parameters 3721 3726 envhp (IN/OUT) - OCI environment handle initialized in object mode. 3722 errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in 3723 errhp and this function returns OCI_ERROR. Diagnostic information can be 3727 errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in 3728 errhp and this function returns OCI_ERROR. Diagnostic information can be 3724 3729 obtained by calling OCIErrorGet(). 3725 3730 filep (IN) - FILE locator for which to get the directory alias and file name. 3726 dir_alias (OUT) - buffer into which the directory alias name is placed. The 3727 caller must allocate enough space for the directory alias name and must not 3731 dir_alias (OUT) - buffer into which the directory alias name is placed. The 3732 caller must allocate enough space for the directory alias name and must not 3728 3733 write into the space. 3729 d_length (IN/OUT) 3734 d_length (IN/OUT) 3730 3735 - IN: length of the input dir_alias string; 3731 3736 - OUT: length of the returned dir_alias string. 3732 filename (OUT) - buffer into which the file name is placed. The caller must 3737 filename (OUT) - buffer into which the file name is placed. The caller must 3733 3738 allocate enough space for the file name and must not write into the space. 3734 f_length (IN/OUT) 3739 f_length (IN/OUT) 3735 3740 - IN: length of the input filename string; 3736 3741 - OUT: lenght of the returned filename string. … … 3761 3766 Parameters 3762 3767 svchp (IN) - the OCI service context handle. 3763 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3764 is recorded in err and this function returns OCI_ERROR. Diagnostic 3768 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 3769 is recorded in err and this function returns OCI_ERROR. Diagnostic 3765 3770 information can be obtained by calling OCIErrorGet(). 3766 filep (IN) - pointer to the FILE locator being examined. If the input file 3767 locator was never passed to OCILobFileOpen(), the file is considered not to 3768 be opened by this locator. However, a different locator may have opened the 3769 file. More than one file opens can be performed on the same file using 3771 filep (IN) - pointer to the FILE locator being examined. If the input file 3772 locator was never passed to OCILobFileOpen(), the file is considered not to 3773 be opened by this locator. However, a different locator may have opened the 3774 file. More than one file opens can be performed on the same file using 3770 3775 different locators. 3771 flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if 3772 it is not. 3776 flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if 3777 it is not. 3773 3778 3774 3779 See also 3775 OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE 3780 OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE 3776 3781 DIRECTORY SQL command 3777 3782 … … 3792 3797 3793 3798 Comments 3794 Opens a FILE. The FILE can be opened for read-only access only. FILEs may not 3799 Opens a FILE. The FILE can be opened for read-only access only. FILEs may not 3795 3800 be written to throough ORACLE. 3796 3801 3797 Parameters 3798 svchp (IN) - the service context handle. 3799 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3802 Parameters 3803 svchp (IN) - the service context handle. 3804 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3800 3805 diagnostic information in the event of an error. 3801 filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a 3802 FILE. 3803 mode (IN) - mode in which to open the file. The only valid mode is 3804 read-only - OCI_FILE_READONLY. 3806 filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a 3807 FILE. 3808 mode (IN) - mode in which to open the file. The only valid mode is 3809 read-only - OCI_FILE_READONLY. 3805 3810 3806 3811 See Also 3807 OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen, 3808 OCILobFileSetName, CREATE DIRECTORY 3812 OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen, 3813 OCILobFileSetName, CREATE DIRECTORY 3809 3814 3810 3815 … … 3824 3829 OCILobLocator **filepp, 3825 3830 OraText *dir_alias, 3826 ub2 d_length, 3827 OraText *filename, 3831 ub2 d_length, 3832 OraText *filename, 3828 3833 ub2 f_length ); 3829 3834 Comments 3830 Sets the directory alias and file name in the LOB file locator. 3835 Sets the directory alias and file name in the LOB file locator. 3831 3836 Parameters 3832 3837 envhp (IN/OUT) - OCI environment handle initialized in object mode. 3833 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 3834 in errhp and this function returns OCI_ERROR. Diagnostic information can be 3838 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 3839 in errhp and this function returns OCI_ERROR. Diagnostic information can be 3835 3840 obtained by calling OCIErrorGet(). 3836 3841 filepp (IN/OUT) - FILE locator for which to set the directory alias name. 3837 3842 The caller must have already allocated space for the locator by calling 3838 3843 OCIDescriptorAlloc(). 3839 dir_alias (IN) - buffer that contains the directory alias name to set in the 3844 dir_alias (IN) - buffer that contains the directory alias name to set in the 3840 3845 locator. 3841 3846 d_length (IN) - length of the input dir_alias parameter. … … 3865 3870 Comments 3866 3871 3867 Flushes to the server, changes made to the buffering subsystem that 3868 are associated with the lob referenced by the input locator. This 3869 routine will actually write the data in the buffer to the lob in 3870 the database. Lob buffering must have already been enabled for the 3872 Flushes to the server, changes made to the buffering subsystem that 3873 are associated with the lob referenced by the input locator. This 3874 routine will actually write the data in the buffer to the lob in 3875 the database. Lob buffering must have already been enabled for the 3871 3876 input lob locator. 3872 3877 … … 3877 3882 3878 3883 Parameters 3879 svchp (IN/OUT) - the service context handle. 3880 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3881 diagnostic information in the event of an error. 3882 locp (IN/OUT) - a locator uniquely referencing the LOB. 3884 svchp (IN/OUT) - the service context handle. 3885 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3886 diagnostic information in the event of an error. 3887 locp (IN/OUT) - a locator uniquely referencing the LOB. 3883 3888 flag (IN) - to indicate if the buffer resources need to be freed 3884 3889 after a flush. Default value is OCI_LOB_BUFFER_NOFREE. … … 3911 3916 3912 3917 Parameters 3913 svchp (IN/OUT) - the service context handle. 3914 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3915 diagnostic information in the event of an error. 3918 svchp (IN/OUT) - the service context handle. 3919 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3920 diagnostic information in the event of an error. 3916 3921 locp (IN/OUT) - a locator uniquely referencing the LOB 3917 3922 … … 3929 3934 LOB data layer when accessing/modifying the LOB value. Part of the chunk is 3930 3935 used to store system-related information and the rest stores the LOB value. 3931 This function returns the amount of space used in the LOB chunk to store 3936 This function returns the amount of space used in the LOB chunk to store 3932 3937 the LOB value. 3933 3938 … … 3940 3945 Comments 3941 3946 Performance will be improved if the user issues read/write 3942 requests using a multiple of this chunk size. For writes, there is an added 3947 requests using a multiple of this chunk size. For writes, there is an added 3943 3948 benefit since LOB chunks are versioned and, if all writes are done on chunk 3944 basis, no extra/excess versioning is done nor duplicated. Users could batch 3949 basis, no extra/excess versioning is done nor duplicated. Users could batch 3945 3950 up the write until they have enough for a chunk instead of issuing several 3946 3951 write calls for the same chunk. … … 3948 3953 Parameters 3949 3954 svchp (IN) - the service context handle. 3950 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3955 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3951 3956 diagnostic information in the event of an error. 3952 3957 locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal 3953 LOBs, this locator must be a locator that was obtained from the server 3958 LOBs, this locator must be a locator that was obtained from the server 3954 3959 specified by svchp. For FILEs, this locator can be initialized by a Select or 3955 3960 OCILobFileSetName. 3956 chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for 3957 character LOBs it is the number of characters, for binary LOBs it is the 3961 chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for 3962 character LOBs it is the number of characters, for binary LOBs it is the 3958 3963 number of bytes in the LOB. 3959 3964 … … 3966 3971 3967 3972 Purpose 3968 Gets the length of a LOB/FILE. 3973 Gets the length of a LOB/FILE. 3969 3974 3970 3975 Syntax … … 3975 3980 3976 3981 Comments 3977 Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is 3982 Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is 3978 3983 undefined. 3979 3984 3980 3985 Parameters 3981 3986 svchp (IN) - the service context handle. 3982 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3987 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 3983 3988 diagnostic information in the event of an error. 3984 3989 locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal 3985 LOBs, this locator must be a locator that was obtained from the server 3990 LOBs, this locator must be a locator that was obtained from the server 3986 3991 specified by svchp. For FILEs, this locator can be initialized by a Select or 3987 3992 OCILobFileSetName. 3988 lenp (OUT) - On output, it is the length of the LOB if not NULL - for 3989 character LOBs it is the number of characters, for binary LOBs it is the 3993 lenp (OUT) - On output, it is the length of the LOB if not NULL - for 3994 character LOBs it is the number of characters, for binary LOBs it is the 3990 3995 number of bytes in the LOB. 3991 3996 … … 4011 4016 4012 4017 Comments 4013 Compares the given LOB locators for equality. Two LOB locators are equal if 4018 Compares the given LOB locators for equality. Two LOB locators are equal if 4014 4019 and only if they both refer to the same LOB data. 4015 4020 Two NULL locators are considered not equal by this function. … … 4036 4041 Comments 4037 4042 Checks if the LOB locator was opened before. flag is set to TRUE 4038 if opened; FALSE otherwise 4039 4040 4041 Parameters 4042 svchp (IN) - the service context handle. 4043 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4044 diagnostic information in the event of an error. 4043 if opened; FALSE otherwise 4044 4045 4046 Parameters 4047 svchp (IN) - the service context handle. 4048 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4049 diagnostic information in the event of an error. 4045 4050 locp (IN) - the locator to test for temporary LOB 4046 4051 flag(OUT) - TRUE, if the LOB locator points to is open … … 4068 4073 4069 4074 Parameters 4070 envhp (IN) - the environment handle. 4071 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4072 diagnostic information in the event of an error. 4075 envhp (IN) - the environment handle. 4076 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4077 diagnostic information in the event of an error. 4073 4078 locp (IN) - the locator to test for temporary LOB 4074 4079 is_temporary(OUT) - TRUE, if the LOB locator points to a temporary LOB; … … 4097 4102 4098 4103 Comments 4099 Loads/copies a portion or all of a file value into an internal LOB as 4100 specified. The data is copied from the source file to the destination 4101 internal LOB (BLOB/CLOB). No character set conversions are performed 4104 Loads/copies a portion or all of a file value into an internal LOB as 4105 specified. The data is copied from the source file to the destination 4106 internal LOB (BLOB/CLOB). No character set conversions are performed 4102 4107 when copying the bfile data to a clob/nclob. The bfile data must already 4103 4108 be in the same character set as the clob/nclob in the database. No 4104 4109 error checking is performed to verify this. 4105 4110 The source (src_filep) and the destination (dst_locp) LOBs must already exist. 4106 If the data already exists at the destination's start position, it is 4107 overwritten with the source data. If the destination's start position is 4111 If the data already exists at the destination's start position, it is 4112 overwritten with the source data. If the destination's start position is 4108 4113 beyond the end of the current data, a hole is created from the end of the data 4109 to the beginning of the newly written data from the source. The destination 4110 LOB is extended to accommodate the newly written data if it extends 4111 beyond the current length of the destination LOB. 4112 It is an error to extend the destination LOB beyond the maximum length 4114 to the beginning of the newly written data from the source. The destination 4115 LOB is extended to accommodate the newly written data if it extends 4116 beyond the current length of the destination LOB. 4117 It is an error to extend the destination LOB beyond the maximum length 4113 4118 allowed or to try to copy from a NULL LOB. 4114 4119 Parameters 4115 svchp (IN) - the service context handle. 4116 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4117 diagnostic information in the event of an error. 4118 dst_locp (IN/OUT) - a locator uniquely referencing the destination internal 4119 LOB which may be of type blob, clob, or nclob. 4120 src_filep (IN/OUT) - a locator uniquely referencing the source BFILE. 4120 svchp (IN) - the service context handle. 4121 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4122 diagnostic information in the event of an error. 4123 dst_locp (IN/OUT) - a locator uniquely referencing the destination internal 4124 LOB which may be of type blob, clob, or nclob. 4125 src_filep (IN/OUT) - a locator uniquely referencing the source BFILE. 4121 4126 amount (IN) - the number of bytes to be copied. 4122 dst_offset (IN) - this is the absolute offset for the destination LOB. 4123 For character LOBs it is the number of characters from the beginning of the 4124 LOB at which to begin writing. For binary LOBs it is the number of bytes from 4127 dst_offset (IN) - this is the absolute offset for the destination LOB. 4128 For character LOBs it is the number of characters from the beginning of the 4129 LOB at which to begin writing. For binary LOBs it is the number of bytes from 4125 4130 the beginning of the lob from which to begin reading. The offset starts at 1. 4126 src_offset (IN) - this is the absolute offset for the source BFILE. It is 4131 src_offset (IN) - this is the absolute offset for the source BFILE. It is 4127 4132 the number of bytes from the beginning of the LOB. The offset starts at 1. 4128 4133 4129 See Also 4134 See Also 4130 4135 OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim(), OCILobCopy() 4131 4136 … … 4139 4144 4140 4145 Syntax 4141 sword OCILobLocatorAssign ( OCISvcCtx *svchp, 4142 OCIError *errhp, 4143 CONST OCILobLocator *src_locp, 4146 sword OCILobLocatorAssign ( OCISvcCtx *svchp, 4147 OCIError *errhp, 4148 CONST OCILobLocator *src_locp, 4144 4149 OCILobLocator **dst_locpp ); 4145 4150 4146 4151 Comments 4147 Assign source locator to destination locator. After the assignment, both 4148 locators refer to the same LOB data. For internal LOBs, the source locator's 4149 LOB data gets copied to the destination locator's LOB data only when the 4150 destination locator gets stored in the table. Therefore, issuing a flush of 4151 the object containing the destination locator will copy the LOB data. For 4152 Assign source locator to destination locator. After the assignment, both 4153 locators refer to the same LOB data. For internal LOBs, the source locator's 4154 LOB data gets copied to the destination locator's LOB data only when the 4155 destination locator gets stored in the table. Therefore, issuing a flush of 4156 the object containing the destination locator will copy the LOB data. For 4152 4157 FILEs only the locator that refers to the OS file is copied to the table. The 4153 4158 OS file is not copied. … … 4157 4162 Parameters 4158 4163 svchp (IN/OUT) - OCI service handle initialized in object mode. 4159 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 4160 in errhp and this function returns OCI_ERROR. Diagnostic information can be 4164 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 4165 in errhp and this function returns OCI_ERROR. Diagnostic information can be 4161 4166 obtained by calling OCIErrorGet(). 4162 4167 src_locp (IN) - LOB locator to copy from. 4163 dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space 4168 dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space 4164 4169 for the OCILobLocator by calling OCIDescriptorAlloc(). 4165 4170 … … 4192 4197 Parameters 4193 4198 envhp (IN/OUT) - OCI environment handle initialized in object mode. 4194 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 4195 is recorded in err and this function returns OCI_ERROR. Diagnostic 4199 errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 4200 is recorded in err and this function returns OCI_ERROR. Diagnostic 4196 4201 information can be obtained by calling OCIErrorGet(). 4197 4202 locp (IN) - the LOB locator being tested 4198 is_initialized (OUT) - returns TRUE if the given LOB locator is initialized; 4203 is_initialized (OUT) - returns TRUE if the given LOB locator is initialized; 4199 4204 FALSE if it is not. 4200 4205 … … 4211 4216 4212 4217 Purpose 4213 Reads a portion of a LOB/FILE as specified by the call into a buffer. 4218 Reads a portion of a LOB/FILE as specified by the call into a buffer. 4214 4219 4215 4220 Syntax … … 4221 4226 dvoid *bufp, 4222 4227 ub4 bufl, 4223 dvoid *ctxp, 4228 dvoid *ctxp, 4224 4229 OCICallbackLobRead cbfp, 4225 4230 ub2 csid, … … 4227 4232 4228 4233 Comments 4229 Reads a portion of a LOB/FILE as specified by the call into a buffer. Data 4234 Reads a portion of a LOB/FILE as specified by the call into a buffer. Data 4230 4235 read from a hole is returned as 0s. It is an error to try to read from a NULL 4231 LOB/FILE. The OS FILE must already exist on the server and must have been 4232 opened using the input locator. Oracle must hav epermission to read the OS 4236 LOB/FILE. The OS FILE must already exist on the server and must have been 4237 opened using the input locator. Oracle must hav epermission to read the OS 4233 4238 file and user must have read permission on the directory object. 4234 4239 4235 4240 Parameters 4236 svchp (IN/OUT) - the service context handle. 4237 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4241 svchp (IN/OUT) - the service context handle. 4242 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4238 4243 diagnostic information in the event of an error. 4239 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4240 offset (IN) - On input, it is the absolute offset, for character LOBs in the 4241 number of characters from the beginning of the LOB, for binary LOBs it is the 4244 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4245 offset (IN) - On input, it is the absolute offset, for character LOBs in the 4246 number of characters from the beginning of the LOB, for binary LOBs it is the 4242 4247 number of bytes. Starts from 1. 4243 amtp (IN/OUT) - On input, the number of character or bytes to be read. On 4244 output, the actual number of bytes or characters read. 4245 If the amount of bytes to be read is larger than the buffer length it is 4246 assumed that the LOB is being read in a streamed mode. On input if this value 4247 is 0, then the data shall be read in streamed mode from the LOB until the end 4248 of LOB. If the data is read in pieces, *amtp always contains the length of 4249 the last piece read. If a callback function is defined, then this callback 4250 function will be invoked each time bufl bytes are read off the pipe. Each 4248 amtp (IN/OUT) - On input, the number of character or bytes to be read. On 4249 output, the actual number of bytes or characters read. 4250 If the amount of bytes to be read is larger than the buffer length it is 4251 assumed that the LOB is being read in a streamed mode. On input if this value 4252 is 0, then the data shall be read in streamed mode from the LOB until the end 4253 of LOB. If the data is read in pieces, *amtp always contains the length of 4254 the last piece read. If a callback function is defined, then this callback 4255 function will be invoked each time bufl bytes are read off the pipe. Each 4251 4256 piece will be written into bufp. 4252 If the callback function is not defined, then OCI_NEED_DATA error code will 4253 be returned. The application must invoke the LOB read over and over again to 4254 read more pieces of the LOB until the OCI_NEED_DATA error code is not 4255 returned. The buffer pointer and the length can be different in each call 4256 if the pieces are being read into different sizes and location. 4257 bufp (IN) - the pointer to a buffer into which the piece will be read. The 4258 length of the allocated memory is assumed to be bufl. 4259 bufl (IN) - the length of the buffer in octets. 4257 If the callback function is not defined, then OCI_NEED_DATA error code will 4258 be returned. The application must invoke the LOB read over and over again to 4259 read more pieces of the LOB until the OCI_NEED_DATA error code is not 4260 returned. The buffer pointer and the length can be different in each call 4261 if the pieces are being read into different sizes and location. 4262 bufp (IN) - the pointer to a buffer into which the piece will be read. The 4263 length of the allocated memory is assumed to be bufl. 4264 bufl (IN) - the length of the buffer in octets. 4260 4265 ctxp (IN) - the context for the call back function. Can be NULL. 4261 cbfp (IN) - a callback that may be registered to be called for each piece. If 4262 this is NULL, then OCI_NEED_DATA will be returned for each piece. 4263 The callback function must return OCI_CONTINUE for the read to continue. 4264 If any other error code is returned, the LOB read is aborted. 4266 cbfp (IN) - a callback that may be registered to be called for each piece. If 4267 this is NULL, then OCI_NEED_DATA will be returned for each piece. 4268 The callback function must return OCI_CONTINUE for the read to continue. 4269 If any other error code is returned, the LOB read is aborted. 4265 4270 ctxp (IN) - the context for the call back function. Can be NULL. 4266 4271 bufp (IN) - a buffer pointer for the piece. 4267 4272 len (IN) - the length of length of current piece in bufp. 4268 piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or 4273 piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or 4269 4274 OCI_LAST_PIECE. 4270 4275 csid - the character set ID of the buffer data … … 4293 4298 4294 4299 Comments 4295 Truncates LOB data to a specified shorter length. 4296 4297 Parameters 4298 svchp (IN) - the service context handle. 4299 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4300 diagnostic information in the event of an error. 4301 locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator 4302 must be a locator that was obtained from the server specified by svchp. 4300 Truncates LOB data to a specified shorter length. 4301 4302 Parameters 4303 svchp (IN) - the service context handle. 4304 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4305 diagnostic information in the event of an error. 4306 locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator 4307 must be a locator that was obtained from the server specified by svchp. 4303 4308 newlen (IN) - the new length of the LOB data, which must be less than or equal 4304 to the current length. 4309 to the current length. 4305 4310 4306 4311 Related Functions … … 4325 4330 ub4 offset, 4326 4331 ub4 *amtp, 4327 dvoid *bufp, 4332 dvoid *bufp, 4328 4333 ub4 buflen, 4329 4334 ub1 piece, 4330 dvoid *ctxp, 4335 dvoid *ctxp, 4331 4336 OCICallbackLobWrite (cbfp) 4332 4337 ( … … 4334 4339 dvoid *bufp, 4335 4340 ub4 *lenp, 4336 ub1 *piecep ) 4341 ub1 *piecep ) 4337 4342 ub2 csid 4338 4343 ub1 csfrm ); … … 4340 4345 4341 4346 Comments 4342 Writes a buffer into a LOB as specified. If LOB data already exists 4347 Writes a buffer into a LOB as specified. If LOB data already exists 4343 4348 it is overwritten with the data stored in the buffer. 4344 4349 The buffer can be written to the LOB in a single piece with this call, or 4345 4350 it can be provided piecewise using callbacks or a standard polling method. 4346 If this value of the piece parameter is OCI_FIRST_PIECE, data must be 4351 If this value of the piece parameter is OCI_FIRST_PIECE, data must be 4347 4352 provided through callbacks or polling. 4348 If a callback function is defined in the cbfp parameter, then this callback 4349 function will be invoked to get the next piece after a piece is written to 4353 If a callback function is defined in the cbfp parameter, then this callback 4354 function will be invoked to get the next piece after a piece is written to 4350 4355 the pipe. Each piece will be written from bufp. 4351 If no callback function is defined, then OCILobWrite() returns the 4352 OCI_NEED_DATA error code. The application must all OCILobWrite() again 4353 to write more pieces of the LOB. In this mode, the buffer pointer and the 4354 length can be different in each call if the pieces are of different sizes and 4355 from different locations. A piece value of OCI_LAST_PIECE terminates the 4356 piecewise write. 4357 4358 Parameters 4359 svchp (IN/OUT) - the service context handle. 4360 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4361 diagnostic information in the event of an error. 4362 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4363 offset (IN) - On input, it is the absolute offset, for character LOBs in 4364 the number of characters from the beginning of the LOB, for binary LOBs it 4356 If no callback function is defined, then OCILobWrite() returns the 4357 OCI_NEED_DATA error code. The application must all OCILobWrite() again 4358 to write more pieces of the LOB. In this mode, the buffer pointer and the 4359 length can be different in each call if the pieces are of different sizes and 4360 from different locations. A piece value of OCI_LAST_PIECE terminates the 4361 piecewise write. 4362 4363 Parameters 4364 svchp (IN/OUT) - the service context handle. 4365 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4366 diagnostic information in the event of an error. 4367 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4368 offset (IN) - On input, it is the absolute offset, for character LOBs in 4369 the number of characters from the beginning of the LOB, for binary LOBs it 4365 4370 is the number of bytes. Starts at 1. 4366 bufp (IN) - the pointer to a buffer from which the piece will be written. The 4367 length of the allocated memory is assumed to be the value passed in bufl. 4368 Even if the data is being written in pieces, bufp must contain the first 4371 bufp (IN) - the pointer to a buffer from which the piece will be written. The 4372 length of the allocated memory is assumed to be the value passed in bufl. 4373 Even if the data is being written in pieces, bufp must contain the first 4369 4374 piece of the LOB when this call is invoked. 4370 4375 bufl (IN) - the length of the buffer in bytes. 4371 Note: This parameter assumes an 8-bit byte. If your platform uses a 4376 Note: This parameter assumes an 8-bit byte. If your platform uses a 4372 4377 longer byte, the value of bufl must be adjusted accordingly. 4373 4378 piece (IN) - which piece of the buffer is being written. The default value for 4374 this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 4379 this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 4375 4380 single piece. 4376 The following other values are also possible for piecewise or callback mode: 4381 The following other values are also possible for piecewise or callback mode: 4377 4382 OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE. 4378 amtp (IN/OUT) - On input, takes the number of character or bytes to be 4379 written. On output, returns the actual number of bytes or characters written. 4380 If the data is written in pieces, *amtp will contain the total length of the 4383 amtp (IN/OUT) - On input, takes the number of character or bytes to be 4384 written. On output, returns the actual number of bytes or characters written. 4385 If the data is written in pieces, *amtp will contain the total length of the 4381 4386 pieces written at the end of the call (last piece written) and is undefined in 4382 between. 4387 between. 4383 4388 (Note it is different from the piecewise read case) 4384 4389 ctxp (IN) - the context for the call back function. Can be NULL. 4385 cbfp (IN) - a callback that may be registered to be called for each piece in 4390 cbfp (IN) - a callback that may be registered to be called for each piece in 4386 4391 a piecewise write. If this is NULL, the standard polling method will be used. 4387 The callback function must return OCI_CONTINUE for the write to continue. 4388 If any other error code is returned, the LOB write is aborted. The 4392 The callback function must return OCI_CONTINUE for the write to continue. 4393 If any other error code is returned, the LOB write is aborted. The 4389 4394 callback takes the following parameters: 4390 4395 ctxp (IN) - the context for the call back function. Can be NULL. 4391 4396 bufp (IN/OUT) - a buffer pointer for the piece. 4392 lenp (IN/OUT) - the length of the buffer (in octets) and the length of 4397 lenp (IN/OUT) - the length of the buffer (in octets) and the length of 4393 4398 current piece in bufp (out octets). 4394 4399 piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE. … … 4412 4417 OCILobLocator *locp, 4413 4418 ub4 *amtp, 4414 dvoid *bufp, 4419 dvoid *bufp, 4415 4420 ub4 buflen, 4416 4421 ub1 piece, 4417 dvoid *ctxp, 4422 dvoid *ctxp, 4418 4423 OCICallbackLobWrite (cbfp) 4419 4424 ( … … 4421 4426 dvoid *bufp, 4422 4427 ub4 *lenp, 4423 ub1 *piecep ) 4428 ub1 *piecep ) 4424 4429 ub2 csid 4425 4430 ub1 csfrm ); … … 4427 4432 4428 4433 Comments 4429 Writes a buffer to the end of a LOB as specified. If LOB data already exists 4434 Writes a buffer to the end of a LOB as specified. If LOB data already exists 4430 4435 it is overwritten with the data stored in the buffer. 4431 4436 The buffer can be written to the LOB in a single piece with this call, or 4432 4437 it can be provided piecewise using callbacks or a standard polling method. 4433 If this value of the piece parameter is OCI_FIRST_PIECE, data must be 4438 If this value of the piece parameter is OCI_FIRST_PIECE, data must be 4434 4439 provided through callbacks or polling. 4435 If a callback function is defined in the cbfp parameter, then this callback 4436 function will be invoked to get the next piece after a piece is written to the 4440 If a callback function is defined in the cbfp parameter, then this callback 4441 function will be invoked to get the next piece after a piece is written to the 4437 4442 pipe. Each piece will be written from bufp. 4438 If no callback function is defined, then OCILobWriteAppend() returns the 4439 OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again 4440 to write more pieces of the LOB. In this mode, the buffer pointer and the 4441 length can be different in each call if the pieces are of different sizes and 4442 from different locations. A piece value of OCI_LAST_PIECE terminates the 4443 piecewise write. 4444 4445 Parameters 4446 svchp (IN/OUT) - the service context handle. 4447 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4448 diagnostic information in the event of an error. 4449 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4450 bufp (IN) - the pointer to a buffer from which the piece will be written. The 4451 length of the allocated memory is assumed to be the value passed in bufl. Even 4452 if the data is being written in pieces, bufp must contain the first piece of 4443 If no callback function is defined, then OCILobWriteAppend() returns the 4444 OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again 4445 to write more pieces of the LOB. In this mode, the buffer pointer and the 4446 length can be different in each call if the pieces are of different sizes and 4447 from different locations. A piece value of OCI_LAST_PIECE terminates the 4448 piecewise write. 4449 4450 Parameters 4451 svchp (IN/OUT) - the service context handle. 4452 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4453 diagnostic information in the event of an error. 4454 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4455 bufp (IN) - the pointer to a buffer from which the piece will be written. The 4456 length of the allocated memory is assumed to be the value passed in bufl. Even 4457 if the data is being written in pieces, bufp must contain the first piece of 4453 4458 the LOB when this call is invoked. 4454 4459 bufl (IN) - the length of the buffer in bytes. 4455 Note: This parameter assumes an 8-bit byte. If your platform uses a 4460 Note: This parameter assumes an 8-bit byte. If your platform uses a 4456 4461 longer byte, the value of bufl must be adjusted accordingly. 4457 4462 piece (IN) - which piece of the buffer is being written. The default value for 4458 this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 4463 this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 4459 4464 single piece. 4460 The following other values are also possible for piecewise or callback mode: 4465 The following other values are also possible for piecewise or callback mode: 4461 4466 OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE. 4462 amtp (IN/OUT) - On input, takes the number of character or bytes to be 4463 written. On output, returns the actual number of bytes or characters written. 4464 If the data is written in pieces, *amtp will contain the total length of the 4467 amtp (IN/OUT) - On input, takes the number of character or bytes to be 4468 written. On output, returns the actual number of bytes or characters written. 4469 If the data is written in pieces, *amtp will contain the total length of the 4465 4470 pieces written at the end of the call (last piece written) and is undefined in 4466 between. 4471 between. 4467 4472 (Note it is different from the piecewise read case) 4468 4473 ctxp (IN) - the context for the call back function. Can be NULL. 4469 cbfp (IN) - a callback that may be registered to be called for each piece in a 4474 cbfp (IN) - a callback that may be registered to be called for each piece in a 4470 4475 piecewise write. If this is NULL, the standard polling method will be used. 4471 The callback function must return OCI_CONTINUE for the write to continue. 4472 If any other error code is returned, the LOB write is aborted. The 4476 The callback function must return OCI_CONTINUE for the write to continue. 4477 If any other error code is returned, the LOB write is aborted. The 4473 4478 callback takes the following parameters: 4474 4479 ctxp (IN) - the context for the call back function. Can be NULL. 4475 4480 bufp (IN/OUT) - a buffer pointer for the piece. 4476 lenp (IN/OUT) - the length of the buffer (in octets) and the length of 4481 lenp (IN/OUT) - the length of the buffer (in octets) and the length of 4477 4482 current piece in bufp (out octets). 4478 4483 piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE. … … 4502 4507 With unlimited size LOB support the limit for a LOB is no longer restricted to 4GB. 4503 4508 This interface should be used to get the actual limit for storing data for a specific 4504 LOB locator. Note that if the compatibality is set to 9.2 or older the limit would still 4509 LOB locator. Note that if the compatibality is set to 9.2 or older the limit would still 4505 4510 be 4GB. 4506 4511 4507 4512 Parameters 4508 svchp (IN/OUT) - the service context handle. 4509 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4510 diagnostic information in the event of an error. 4511 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4513 svchp (IN/OUT) - the service context handle. 4514 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4515 diagnostic information in the event of an error. 4516 locp (IN/OUT) - a LOB locator that uniquely references a LOB. 4512 4517 limitp (OUT) - The storage limit for a LOB in bytes. 4513 4518 Related Functions … … 4527 4532 Comments 4528 4533 This call is used to terminate a session which was created with OCILogon() or 4529 OCILogon2(). 4530 This call implicitly deallocates the server, authentication, and service 4534 OCILogon2(). 4535 This call implicitly deallocates the server, authentication, and service 4531 4536 context handles. 4532 Note: For more information on logging on and off in an application, 4533 refer to the section "Application Initialization, Connection, and 4537 Note: For more information on logging on and off in an application, 4538 refer to the section "Application Initialization, Connection, and 4534 4539 Authorization" on page 2-16. 4535 4540 Parameters 4536 svchp (IN) - the service context handle which was used in the call to 4541 svchp (IN) - the service context handle which was used in the call to 4537 4542 OCILogon() or OCILogon2(). 4538 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4543 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4539 4544 diagnostic information in the event of an error. 4540 4545 See Also … … 4562 4567 ub4 dbname_len ); 4563 4568 Comments 4564 This function is used to create a simple logon session for an application. 4565 Note: Users requiring more complex session (e.g., TP monitor 4566 applications) should refer to the section "Application Initialization, 4569 This function is used to create a simple logon session for an application. 4570 Note: Users requiring more complex session (e.g., TP monitor 4571 applications) should refer to the section "Application Initialization, 4567 4572 Connection, and Authorization" on page 2-16. 4568 This call allocates the error and service context handles which are passed to 4569 it. This call also implicitly allocates server and authentication handles 4570 associated with the session. These handles can be retrieved by calling 4573 This call allocates the error and service context handles which are passed to 4574 it. This call also implicitly allocates server and authentication handles 4575 associated with the session. These handles can be retrieved by calling 4571 4576 OCIAttrGet() on the service context handle. 4572 4577 Parameters 4573 4578 envhp (IN) - the OCI environment handle. 4574 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4579 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4575 4580 diagnostic information in the event of an error. 4576 4581 svchp (OUT) - the service context pointer. … … 4607 4612 This function is used to create a simple logon session for an application in 4608 4613 Connection Pooling mode. The valid values for mode are currently OCI_POOL and 4609 OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to 4614 OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to 4610 4615 OCILogon() call. 4611 This call allocates the error and service context handles which are passed to 4612 it. This call also implicitly allocates server and authentication handles 4613 associated with the session. These handles can be retrieved by calling 4614 OCIAttrGet() on the service context handle. This call assumes that 4616 This call allocates the error and service context handles which are passed to 4617 it. This call also implicitly allocates server and authentication handles 4618 associated with the session. These handles can be retrieved by calling 4619 OCIAttrGet() on the service context handle. This call assumes that 4615 4620 OCIConnectionPoolCreate() has already been called for the same dbname. 4616 4621 Parameters 4617 4622 envhp (IN) - the OCI environment handle. 4618 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4623 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4619 4624 diagnostic information in the event of an error. 4620 4625 svchp (OUT) - the service context pointer. … … 4622 4627 uname_len (IN) - the length of username. 4623 4628 password (IN) - the user's password. If this is null, it is assumed that a 4624 proxy session has to be created and the required grants on 4629 proxy session has to be created and the required grants on 4625 4630 the database are already done. 4626 4631 passwd_len (IN) - the length of password. … … 4647 4652 dvoid *memptr); 4648 4653 Comments 4649 Frees up dynamically allocated data pointers associated with the pointer using 4650 either the default memory free function or the registered memory free 4654 Frees up dynamically allocated data pointers associated with the pointer using 4655 either the default memory free function or the registered memory free 4651 4656 function, as the case may be. 4652 A user-defined memory free function can be registered during the initial call 4653 to OCIInitialize(). 4654 This call is always successful. 4657 A user-defined memory free function can be registered during the initial call 4658 to OCIInitialize(). 4659 This call is always successful. 4655 4660 Parameters 4656 4661 stmhp (IN) - statement handle which returned this data buffer. 4657 memptr (IN) - pointer to data allocated by the client library. 4662 memptr (IN) - pointer to data allocated by the client library. 4658 4663 Related Functions 4659 4664 OCIInitialize() … … 4667 4672 OCI Get PARaMeter 4668 4673 Purpose 4669 Returns a descriptor of a parameter specified by position in the describe 4674 Returns a descriptor of a parameter specified by position in the describe 4670 4675 handle or statement handle. 4671 4676 Syntax … … 4676 4681 ub4 pos ); 4677 4682 Comments 4678 This call returns a descriptor of a parameter specified by position in the 4679 describe handle or statement handle. Parameter descriptors are always 4683 This call returns a descriptor of a parameter specified by position in the 4684 describe handle or statement handle. Parameter descriptors are always 4680 4685 allocated internally by the OCI library. They are read-only. 4681 OCI_NO_DATA may be returned if there are no parameter descriptors for this 4682 position. 4683 See Appendix B for more detailed information about parameter descriptor 4686 OCI_NO_DATA may be returned if there are no parameter descriptors for this 4687 position. 4688 See Appendix B for more detailed information about parameter descriptor 4684 4689 attributes. 4685 4690 Parameters 4686 hndlp (IN) - a statement handle or describe handle. The OCIParamGet() 4687 function will return a parameter descriptor for this handle. 4688 htype (IN) - the type of the handle passed in the handle parameter. Valid 4689 types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a 4691 hndlp (IN) - a statement handle or describe handle. The OCIParamGet() 4692 function will return a parameter descriptor for this handle. 4693 htype (IN) - the type of the handle passed in the handle parameter. Valid 4694 types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a 4690 4695 statement handle 4691 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4696 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4692 4697 diagnostic information in the event of an error. 4693 parmdpp (OUT) - a descriptor of the parameter at the position given in the pos 4698 parmdpp (OUT) - a descriptor of the parameter at the position given in the pos 4694 4699 parameter. 4695 pos (IN) - position number in the statement handle or describe handle. A 4700 pos (IN) - position number in the statement handle or describe handle. A 4696 4701 parameter descriptor will be returned for this position. 4697 Note: OCI_NO_DATA may be returned if there are no parameter 4698 descriptors for this position. 4702 Note: OCI_NO_DATA may be returned if there are no parameter 4703 descriptors for this position. 4699 4704 Related Functions 4700 4705 OCIAttrGet(), OCIAttrSet() … … 4708 4713 OCI Parameter Set in handle 4709 4714 Purpose 4710 Used to set a complex object retrieval descriptor into a complex object 4715 Used to set a complex object retrieval descriptor into a complex object 4711 4716 retrieval handle. 4712 4717 Syntax … … 4718 4723 ub4 pos ); 4719 4724 Comments 4720 This call sets a given complex object retrieval descriptor into a complex 4725 This call sets a given complex object retrieval descriptor into a complex 4721 4726 object retrieval handle. 4722 The handle must have been previously allocated using OCIHandleAlloc(), and 4723 the descriptor must have been previously allocated using OCIDescAlloc(). 4727 The handle must have been previously allocated using OCIHandleAlloc(), and 4728 the descriptor must have been previously allocated using OCIDescAlloc(). 4724 4729 Attributes of the descriptor are set using OCIAttrSet(). 4725 4730 Parameters … … 4728 4733 errhp (IN/OUT) - error handle. 4729 4734 dscp (IN) - complex object retrieval descriptor pointer. 4730 dtyp (IN) - 4735 dtyp (IN) - 4731 4736 pos (IN) - position number. 4732 4737 See Also … … 4752 4757 ub4 mode); 4753 4758 Comments 4754 This call allows the password of an account to be changed. This call is 4759 This call allows the password of an account to be changed. This call is 4755 4760 similar to OCISessionBegin() with the following differences: 4756 If the user authentication is already established, it authenticates 4757 the account using the old password and then changes the 4761 If the user authentication is already established, it authenticates 4762 the account using the old password and then changes the 4758 4763 password to the new password 4759 If the user authentication is not established, it establishes a user 4760 authentication and authenticates the account using the old 4764 If the user authentication is not established, it establishes a user 4765 authentication and authenticates the account using the old 4761 4766 password, then changes the password to the new password. 4762 This call is useful when the password of an account is expired and 4763 OCISessionBegin() returns an error or warning which indicates that the 4764 password has expired. 4765 Parameters 4766 svchp (IN/OUT) - a handle to a service context. The service context handle 4767 This call is useful when the password of an account is expired and 4768 OCISessionBegin() returns an error or warning which indicates that the 4769 password has expired. 4770 Parameters 4771 svchp (IN/OUT) - a handle to a service context. The service context handle 4767 4772 must be initialized and have a server context handle associated with it. 4768 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4773 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4769 4774 diagnostic information in the event of an error. 4770 user_name (IN) - specifies the user name. It points to a character string, 4771 whose length is specified in usernm_len. This parameter must be NULL if the 4775 user_name (IN) - specifies the user name. It points to a character string, 4776 whose length is specified in usernm_len. This parameter must be NULL if the 4772 4777 service context has been initialized with an authentication handle. 4773 usernm_len (IN) - the length of the user name string specified in user_name. 4778 usernm_len (IN) - the length of the user name string specified in user_name. 4774 4779 For a valid user name string, usernm_len must be non-zero. 4775 opasswd (IN) - specifies the user's old password. It points to a character 4780 opasswd (IN) - specifies the user's old password. It points to a character 4776 4781 string, whose length is specified in opasswd_len . 4777 opasswd_len (IN) - the length of the old password string specified in opasswd. 4782 opasswd_len (IN) - the length of the old password string specified in opasswd. 4778 4783 For a valid password string, opasswd_len must be non-zero. 4779 npasswd (IN) - specifies the user's new password. It points to a character 4780 string, whose length is specified in npasswd_len which must be non-zero for a 4781 valid password string. If the password complexity verification routine is 4782 specified in the user's profile to verify the new password's complexity, the 4783 new password must meet the complexity requirements of the verification 4784 npasswd (IN) - specifies the user's new password. It points to a character 4785 string, whose length is specified in npasswd_len which must be non-zero for a 4786 valid password string. If the password complexity verification routine is 4787 specified in the user's profile to verify the new password's complexity, the 4788 new password must meet the complexity requirements of the verification 4784 4789 function. 4785 npasswd_len (IN) - then length of the new password string specified in 4790 npasswd_len (IN) - then length of the new password string specified in 4786 4791 npasswd. For a valid password string, npasswd_len must be non-zero. 4787 4792 mode - pass as OCI_DEFAULT. … … 4805 4810 Comments 4806 4811 This call is called in non-blocking mode ONLY. Resets the interrupted 4807 asynchronous operation and protocol. Must be called if a OCIBreak call 4808 had been issued while a non-blocking operation was in progress. 4812 asynchronous operation and protocol. Must be called if a OCIBreak call 4813 had been issued while a non-blocking operation was in progress. 4809 4814 Parameters 4810 4815 hndlp (IN) - the service context handle or the server context handle. 4811 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4816 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4812 4817 diagnostic information in the event of an error. 4813 4818 Related Functions … … 4826 4831 A result set descriptor can be allocated with a call to OCIDescAlloc(). 4827 4832 Parameters 4828 rsetdp (IN/OUT) - a result set descriptor pointer. 4829 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4830 diagnostic information in the event of an error. 4833 rsetdp (IN/OUT) - a result set descriptor pointer. 4834 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4835 diagnostic information in the event of an error. 4831 4836 Related Functions 4832 4837 OCIDescAlloc() … … 4847 4852 ub4 mode); 4848 4853 Comments 4849 This call is used to create an association between an OCI application and a 4850 particular server. 4851 This call initializes a server context handle, which must have been previously 4854 This call is used to create an association between an OCI application and a 4855 particular server. 4856 This call initializes a server context handle, which must have been previously 4852 4857 allocated with a call to OCIHandleAlloc(). 4853 The server context handle initialized by this call can be associated with a 4854 service context through a call to OCIAttrSet(). Once that association has been 4858 The server context handle initialized by this call can be associated with a 4859 service context through a call to OCIAttrSet(). Once that association has been 4855 4860 made, OCI operations can be performed against the server. 4856 If an application is operating against multiple servers, multiple server 4857 context handles can be maintained. OCI operations are performed against 4861 If an application is operating against multiple servers, multiple server 4862 context handles can be maintained. OCI operations are performed against 4858 4863 whichever server context is currently associated with the service context. 4859 4864 Parameters 4860 srvhp (IN/OUT) - an uninitialized server context handle, which gets 4861 initialized by this call. Passing in an initialized server handle causes an 4862 error. 4863 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4865 srvhp (IN/OUT) - an uninitialized server context handle, which gets 4866 initialized by this call. Passing in an initialized server handle causes an 4867 error. 4868 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4864 4869 diagnostic information in the event of an error. 4865 4870 dblink (IN) - specifies the database (server) to use. This parameter points to 4866 a character string which specifies a connect string or a service point. If the 4871 a character string which specifies a connect string or a service point. If the 4867 4872 connect string is NULL, then this call attaches to the default host. The length 4868 4873 of connstr is specified in connstr_len. The connstr pointer may be freed by the 4869 4874 caller on return. 4870 dblink_len (IN) - the length of the string pointed to by connstr. For a valid 4875 dblink_len (IN) - the length of the string pointed to by connstr. For a valid 4871 4876 connect string name or alias, connstr_len must be non-zero. 4872 4877 mode (IN) - specifies the various modes of operation. For release 8.0, pass as 4873 OCI_DEFAULT - in this mode, calls made to the server on this server context 4874 are made in blocking mode. 4878 OCI_DEFAULT - in this mode, calls made to the server on this server context 4879 are made in blocking mode. 4875 4880 Example 4876 See the description of OCIStmtPrepare() on page 13-96 for an example showing 4881 See the description of OCIStmtPrepare() on page 13-96 for an example showing 4877 4882 the use of OCIServerAttach(). 4878 4883 Related Functions … … 4889 4894 sword OCIServerDetach ( OCIServer *svrhp, 4890 4895 OCIError *errhp, 4891 ub4 mode); 4892 Comments 4893 This call deletes an access to data source for OCI operations, which was 4894 established by a call to OCIServerAttach(). 4895 Parameters 4896 srvhp (IN) - a handle to an initialized server context, which gets reset to 4897 uninitialized state. The handle is not de-allocated. 4898 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4899 diagnostic information in the event of an error. 4900 mode (IN) - specifies the various modes of operation. The only valid mode is 4901 OCI_DEFAULT for the default mode. 4896 ub4 mode); 4897 Comments 4898 This call deletes an access to data source for OCI operations, which was 4899 established by a call to OCIServerAttach(). 4900 Parameters 4901 srvhp (IN) - a handle to an initialized server context, which gets reset to 4902 uninitialized state. The handle is not de-allocated. 4903 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 4904 diagnostic information in the event of an error. 4905 mode (IN) - specifies the various modes of operation. The only valid mode is 4906 OCI_DEFAULT for the default mode. 4902 4907 Related Functions 4903 4908 OCIServerAttach() … … 4911 4916 Returns the version string of the Oracle server. 4912 4917 Syntax 4913 sword OCIServerVersion ( dvoid *hndlp, 4914 OCIError *errhp, 4918 sword OCIServerVersion ( dvoid *hndlp, 4919 OCIError *errhp, 4915 4920 OraText *bufp, 4916 4921 ub4 bufsz 4917 4922 ub1 hndltype ); 4918 4923 Comments 4919 This call returns the version string of the Oracle server. 4920 For example, the following might be returned as the version string if your 4924 This call returns the version string of the Oracle server. 4925 For example, the following might be returned as the version string if your 4921 4926 application is running against a 7.3.2 server: 4922 4927 Oracle7 Server Release 7.3.2.0.0 - Production Release … … 4928 4933 Parameters 4929 4934 hndlp (IN) - the service context handle or the server context handle. 4930 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4935 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 4931 4936 diagnostic information in the event of an error. 4932 4937 bufp (IN) - the buffer in which the version information is returned. … … 4952 4957 4953 4958 Comments 4954 For Oracle8, OCISessionBegin() must be called for any given server handle 4955 before requests can be made against it. Also, OCISessionBegin() only supports 4956 authenticating the user for access to the Oracle server specified by the 4957 server handle in the service context. In other words, after OCIServerAttach() 4958 is called to initialize a server handle, OCISessionBegin() must be called to 4959 authenticate the user for that given server. 4960 When OCISessionBegin() is called for the first time for the given server 4961 handle, the initialized authentication handle is called a primary 4962 authentication context. A primary authentication context may not be created 4963 with the OCI_MIGRATE mode. Also, only one primary authentication context can 4959 For Oracle8, OCISessionBegin() must be called for any given server handle 4960 before requests can be made against it. Also, OCISessionBegin() only supports 4961 authenticating the user for access to the Oracle server specified by the 4962 server handle in the service context. In other words, after OCIServerAttach() 4963 is called to initialize a server handle, OCISessionBegin() must be called to 4964 authenticate the user for that given server. 4965 When OCISessionBegin() is called for the first time for the given server 4966 handle, the initialized authentication handle is called a primary 4967 authentication context. A primary authentication context may not be created 4968 with the OCI_MIGRATE mode. Also, only one primary authentication context can 4964 4969 be created for a given server handle and the primary authentication context c 4965 an only ever be used with that server handle. If the primary authentication 4966 context is set in a service handle with a different server handle, then an 4970 an only ever be used with that server handle. If the primary authentication 4971 context is set in a service handle with a different server handle, then an 4967 4972 error will result. 4968 After OCISessionBegin() has been called for the server handle, and the primary 4969 authentication context is set in the service handle, OCISessionBegin() may be 4970 called again to initialize another authentication handle with different (or 4971 the same) credentials. When OCISessionBegin() is called with a service handle 4973 After OCISessionBegin() has been called for the server handle, and the primary 4974 authentication context is set in the service handle, OCISessionBegin() may be 4975 called again to initialize another authentication handle with different (or 4976 the same) credentials. When OCISessionBegin() is called with a service handle 4972 4977 set with a primary authentication context, the returned authentication context 4973 in authp is called a user authentication context. As many user authentication 4978 in authp is called a user authentication context. As many user authentication 4974 4979 contexts may be initialized as desired. 4975 User authentication contexts may be created with the OCI_MIGRATE mode. 4976 If the OCI_MIGRATE mode is not specified, then the user authentication 4977 context can only ever be used with the same server handle set in svchp. If 4978 OCI_MIGRATE mode is specified, then the user authentication may be set 4979 with different server handles. However, the user authentication context is 4980 restricted to use with only server handles which resolve to the same database 4981 instance and that have equivalent primary authentication contexts. Equivalent 4982 authentication contexts are those which were authenticated as the same 4980 User authentication contexts may be created with the OCI_MIGRATE mode. 4981 If the OCI_MIGRATE mode is not specified, then the user authentication 4982 context can only ever be used with the same server handle set in svchp. If 4983 OCI_MIGRATE mode is specified, then the user authentication may be set 4984 with different server handles. However, the user authentication context is 4985 restricted to use with only server handles which resolve to the same database 4986 instance and that have equivalent primary authentication contexts. Equivalent 4987 authentication contexts are those which were authenticated as the same 4983 4988 database user. 4984 OCI_SYSDBA, OCI_SYSOPER, and OCI_PRELIM_AUTH may only be used 4989 OCI_SYSDBA, OCI_SYSOPER, and OCI_PRELIM_AUTH may only be used 4985 4990 with a primary authentication context. 4986 To provide credentials for a call to OCISessionBegin(), one of two methods are 4987 supported. The first is to provide a valid username and password pair for 4988 database authentication in the user authentication handle passed to 4989 OCISessionBegin(). This involves using OCIAttrSet() to set the 4990 OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the 4991 authentication handle. Then OCISessionBegin() is called with 4991 To provide credentials for a call to OCISessionBegin(), one of two methods are 4992 supported. The first is to provide a valid username and password pair for 4993 database authentication in the user authentication handle passed to 4994 OCISessionBegin(). This involves using OCIAttrSet() to set the 4995 OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the 4996 authentication handle. Then OCISessionBegin() is called with 4992 4997 OCI_CRED_RDBMS. 4993 Note: When the authentication handle is terminated using 4994 OCISessionEnd(), the username and password attributes remain 4995 unchanged and thus can be re-used in a future call to OCISessionBegin(). 4996 Otherwise, they must be reset to new values before the next 4998 Note: When the authentication handle is terminated using 4999 OCISessionEnd(), the username and password attributes remain 5000 unchanged and thus can be re-used in a future call to OCISessionBegin(). 5001 Otherwise, they must be reset to new values before the next 4997 5002 OCISessionBegin() call. 4998 The second type of credentials supported are external credentials. No 4999 attributes need to be set on the authentication handle before calling 5000 OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent 5001 to the Oracle7 `connect /' syntax. If values have been set for 5002 OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are 5003 The second type of credentials supported are external credentials. No 5004 attributes need to be set on the authentication handle before calling 5005 OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent 5006 to the Oracle7 `connect /' syntax. If values have been set for 5007 OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are 5003 5008 ignored if OCI_CRED_EXT is used. 5004 5009 Parameters 5005 svchp (IN) - a handle to a service context. There must be a valid server 5010 svchp (IN) - a handle to a service context. There must be a valid server 5006 5011 handle set in svchp. 5007 5012 errhp (IN) - an error handle to the retrieve diagnostic information. 5008 usrhp (IN/OUT) - a handle to an authentication context, which is initialized 5013 usrhp (IN/OUT) - a handle to an authentication context, which is initialized 5009 5014 by this call. 5010 credt (IN) - specifies the type of credentials to use for authentication. 5015 credt (IN) - specifies the type of credentials to use for authentication. 5011 5016 Valid values for credt are: 5012 OCI_CRED_RDBMS - authenticate using a database username and 5013 password pair as credentials. The attributes OCI_ATTR_USERNAME 5014 and OCI_ATTR_PASSWORD should be set on the authentication 5017 OCI_CRED_RDBMS - authenticate using a database username and 5018 password pair as credentials. The attributes OCI_ATTR_USERNAME 5019 and OCI_ATTR_PASSWORD should be set on the authentication 5015 5020 context before this call. 5016 OCI_CRED_EXT - authenticate using external credentials. No username 5021 OCI_CRED_EXT - authenticate using external credentials. No username 5017 5022 or password is provided. 5018 5023 mode (IN) - specifies the various modes of operation. Valid modes are: 5019 OCI_DEFAULT - in this mode, the authentication context returned may 5020 only ever be set with the same server context specified in svchp. This 5024 OCI_DEFAULT - in this mode, the authentication context returned may 5025 only ever be set with the same server context specified in svchp. This 5021 5026 establishes the primary authentication context. 5022 OCI_MIGRATE - in this mode, the new authentication context may be 5023 set in a service handle with a different server handle. This mode 5024 establishes the user authentication context. 5025 OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA 5027 OCI_MIGRATE - in this mode, the new authentication context may be 5028 set in a service handle with a different server handle. This mode 5029 establishes the user authentication context. 5030 OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA 5026 5031 access. 5027 OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER 5032 OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER 5028 5033 access. 5029 OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA 5034 OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA 5030 5035 or OCI_SYSOPER to authenticate for certain administration tasks. 5031 5036 Related Functions … … 5049 5054 5050 5055 Comments 5051 The user security context associated with the service context is invalidated 5052 by this call. Storage for the authentication context is not freed. The 5053 transaction specified by the service context is implicitly committed. The 5056 The user security context associated with the service context is invalidated 5057 by this call. Storage for the authentication context is not freed. The 5058 transaction specified by the service context is implicitly committed. The 5054 5059 transaction handle, if explicitly allocated, may be freed if not being used. 5055 5060 Resources allocated on the server for this user are freed. 5056 5061 The authentication handle may be reused in a new call to OCISessionBegin(). 5057 5062 Parameters 5058 svchp (IN/OUT) - the service context handle. There must be a valid server 5063 svchp (IN/OUT) - the service context handle. There must be a valid server 5059 5064 handle and user authentication handle associated with svchp. 5060 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5061 diagnostic information in the event of an error. 5062 usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL, 5065 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5066 diagnostic information in the event of an error. 5067 usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL, 5063 5068 the user in the service context handle is de-authenticated. 5064 5069 mode (IN) - the only valid mode is OCI_DEFAULT. … … 5087 5092 Comments 5088 5093 This function is used to execute a prepared SQL statement. 5089 Using an execute call, the application associates a request with a server. On 5094 Using an execute call, the application associates a request with a server. On 5090 5095 success, OCI_SUCCESS is returned. 5091 If a SELECT statement is executed, the description of the select list follows 5092 implicitly as a response. This description is buffered on the client side for 5093 describes, fetches and define type conversions. Hence it is optimal to 5094 describe a select list only after an execute. 5095 Also for SELECT statements, some results are available implicitly. Rows will 5096 be received and buffered at the end of the execute. For queries with small row 5097 count, a prefetch causes memory to be released in the server if the end of 5098 fetch is reached, an optimization that may result in memory usage reduction. 5096 If a SELECT statement is executed, the description of the select list follows 5097 implicitly as a response. This description is buffered on the client side for 5098 describes, fetches and define type conversions. Hence it is optimal to 5099 describe a select list only after an execute. 5100 Also for SELECT statements, some results are available implicitly. Rows will 5101 be received and buffered at the end of the execute. For queries with small row 5102 count, a prefetch causes memory to be released in the server if the end of 5103 fetch is reached, an optimization that may result in memory usage reduction. 5099 5104 Set attribute call has been defined to set the number of rows to be prefetched 5100 5105 per result set. 5101 For SELECT statements, at the end of the execute, the statement handle 5102 implicitly maintains a reference to the service context on which it is 5103 executed. It is the user's responsibility to maintain the integrity of the 5104 service context. If the attributes of a service context is changed for 5105 executing some operations on this service context, the service context must 5106 be restored to have the same attributes, that a statement was executed with, 5107 prior to a fetch on the statement handle. The implicit reference is maintained 5108 until the statement handle is freed or the fetch is cancelled or an end of 5106 For SELECT statements, at the end of the execute, the statement handle 5107 implicitly maintains a reference to the service context on which it is 5108 executed. It is the user's responsibility to maintain the integrity of the 5109 service context. If the attributes of a service context is changed for 5110 executing some operations on this service context, the service context must 5111 be restored to have the same attributes, that a statement was executed with, 5112 prior to a fetch on the statement handle. The implicit reference is maintained 5113 until the statement handle is freed or the fetch is cancelled or an end of 5109 5114 fetch condition is reached. 5110 Note: If output variables are defined for a SELECT statement before a 5111 call to OCIStmtExecute(), the number of rows specified by iters will be 5112 fetched directly into the defined output buffers and additional rows 5113 equivalent to the prefetch count will be prefetched. If there are no 5114 additional rows, then the fetch is complete without calling 5115 Note: If output variables are defined for a SELECT statement before a 5116 call to OCIStmtExecute(), the number of rows specified by iters will be 5117 fetched directly into the defined output buffers and additional rows 5118 equivalent to the prefetch count will be prefetched. If there are no 5119 additional rows, then the fetch is complete without calling 5115 5120 OCIStmtFetch(). 5116 The execute call will return errors if the statement has bind data types that 5121 The execute call will return errors if the statement has bind data types that 5117 5122 are not supported in an Oracle7 server. 5118 5123 Parameters 5119 svchp (IN/OUT) - service context handle. 5120 stmtp (IN/OUT) - an statement handle - defines the statement and the 5121 associated data to be executed at the server. It is invalid to pass in a 5122 statement handle that has bind of data types only supported in release 8.0 5123 when srvchp points to an Oracle7 server. 5124 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5125 diagnostic information in the event of an error. If the statement is being 5126 batched and it is successful, then this handle will contain this particular 5127 statement execution specific errors returned from the server when the batch is 5124 svchp (IN/OUT) - service context handle. 5125 stmtp (IN/OUT) - an statement handle - defines the statement and the 5126 associated data to be executed at the server. It is invalid to pass in a 5127 statement handle that has bind of data types only supported in release 8.0 5128 when srvchp points to an Oracle7 server. 5129 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5130 diagnostic information in the event of an error. If the statement is being 5131 batched and it is successful, then this handle will contain this particular 5132 statement execution specific errors returned from the server when the batch is 5128 5133 flushed. 5129 iters (IN) - the number of times this statement is executed for non-Select 5130 statements. For Select statements, if iters is non-zero, then defines must 5131 have been done for the statement handle. The execution fetches iters rows into 5132 these predefined buffers and prefetches more rows depending upon the prefetch 5133 row count. This function returns an error if iters=0 for non-SELECT 5134 iters (IN) - the number of times this statement is executed for non-Select 5135 statements. For Select statements, if iters is non-zero, then defines must 5136 have been done for the statement handle. The execution fetches iters rows into 5137 these predefined buffers and prefetches more rows depending upon the prefetch 5138 row count. This function returns an error if iters=0 for non-SELECT 5134 5139 statements. 5135 rowoff (IN) - the index from which the data in an array bind is relevant for 5136 this multiple row execution. 5137 snap_in (IN) - this parameter is optional. if supplied, must point to a 5138 snapshot descriptor of type OCI_DTYPE_SNAP. The contents of this descriptor 5139 must be obtained from the snap_out parameter of a previous call. The 5140 descriptor is ignored if the SQL is not a SELECT. This facility allows 5141 multiple service contexts to ORACLE to see the same consistent snapshot of the 5142 database's committed data. However, uncommitted data in one context is not 5140 rowoff (IN) - the index from which the data in an array bind is relevant for 5141 this multiple row execution. 5142 snap_in (IN) - this parameter is optional. if supplied, must point to a 5143 snapshot descriptor of type OCI_DTYPE_SNAP. The contents of this descriptor 5144 must be obtained from the snap_out parameter of a previous call. The 5145 descriptor is ignored if the SQL is not a SELECT. This facility allows 5146 multiple service contexts to ORACLE to see the same consistent snapshot of the 5147 database's committed data. However, uncommitted data in one context is not 5143 5148 visible to another context even using the same snapshot. 5144 snap_out (OUT) - this parameter optional. if supplied, must point to a 5145 descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an 5146 opaque representation which is the current ORACLE "system change 5147 number" suitable as a snap_in input to a subsequent call to OCIStmtExecute(). 5148 This descriptor should not be used any longer than necessary in order to avoid 5149 "snapshot too old" errors. 5149 snap_out (OUT) - this parameter optional. if supplied, must point to a 5150 descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an 5151 opaque representation which is the current ORACLE "system change 5152 number" suitable as a snap_in input to a subsequent call to OCIStmtExecute(). 5153 This descriptor should not be used any longer than necessary in order to avoid 5154 "snapshot too old" errors. 5150 5155 mode (IN) - The modes are: 5151 If OCI_DEFAULT_MODE, the default mode, is selected, the request is 5152 immediately executed. Error handle contains diagnostics on error if any. 5153 OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is 5154 only valid if the application has set the prefetch row count prior to this 5155 call. In this mode, the OCI library will get up to the number of rows 5156 specified (i.e., prefetch row count plus iters). If the number of rows 5157 returned by the query is greater than this value, OCI_ERROR will be 5158 returned with ORA-01422 as the implementation specific error in a 5159 diagnostic record. If the number of rows returned by the query is 5160 smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will 5161 be returned with ORA-01403 as the implementation specific error. The 5162 prefetch buffer size is ignored and the OCI library tries to allocate all the 5163 space required to contain the prefetched rows. The exact fetch semantics 5164 apply to only the top level rows. No more rows can be fetched for this 5165 query at the end of the call. 5166 OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this 5167 statement executed in this transaction will be maintained when the 5168 transaction is detached for migration. By default, a query is cancelled 5169 when a transaction is detached for migration. This mode is the default 5170 mode when connected to a V7 server. 5156 If OCI_DEFAULT_MODE, the default mode, is selected, the request is 5157 immediately executed. Error handle contains diagnostics on error if any. 5158 OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is 5159 only valid if the application has set the prefetch row count prior to this 5160 call. In this mode, the OCI library will get up to the number of rows 5161 specified (i.e., prefetch row count plus iters). If the number of rows 5162 returned by the query is greater than this value, OCI_ERROR will be 5163 returned with ORA-01422 as the implementation specific error in a 5164 diagnostic record. If the number of rows returned by the query is 5165 smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will 5166 be returned with ORA-01403 as the implementation specific error. The 5167 prefetch buffer size is ignored and the OCI library tries to allocate all the 5168 space required to contain the prefetched rows. The exact fetch semantics 5169 apply to only the top level rows. No more rows can be fetched for this 5170 query at the end of the call. 5171 OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this 5172 statement executed in this transaction will be maintained when the 5173 transaction is detached for migration. By default, a query is cancelled 5174 when a transaction is detached for migration. This mode is the default 5175 mode when connected to a V7 server. 5171 5176 Related Functions 5172 5177 OCIStmtPrepare() … … 5183 5188 Syntax 5184 5189 sword OCIStmtFetch ( OCIStmt *stmtp, 5185 OCIError *errhp, 5190 OCIError *errhp, 5186 5191 ub4 nrows, 5187 5192 ub2 orientation, 5188 5193 ub4 mode); 5189 5194 Comments 5190 The fetch call is a local call, if prefetched rows suffice. However, this is 5191 transparent to the application. If LOB columns are being read, LOB locators 5192 are fetched for subsequent LOB operations to be performed on these locators. 5193 Prefetching is turned off if LONG columns are involved. 5194 A fetch with nrows set to 0 rows effectively cancels the fetch for this 5195 The fetch call is a local call, if prefetched rows suffice. However, this is 5196 transparent to the application. If LOB columns are being read, LOB locators 5197 are fetched for subsequent LOB operations to be performed on these locators. 5198 Prefetching is turned off if LONG columns are involved. 5199 A fetch with nrows set to 0 rows effectively cancels the fetch for this 5195 5200 statement. 5196 5201 Parameters 5197 5202 stmtp (IN) - a statement (application request) handle. 5198 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5203 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5199 5204 diagnostic information in the event of an error. 5200 5205 nrows (IN) - number of rows to be fetched from the current position. 5201 orientation (IN) - for release 8.0, the only acceptable value is 5202 OCI_FETCH_NEXT, which is also the default value. 5206 orientation (IN) - for release 8.0, the only acceptable value is 5207 OCI_FETCH_NEXT, which is also the default value. 5203 5208 mode (IN) - for release 8.0, beta-1, the following mode is defined. 5204 5209 OCI_DEFAULT - default mode 5205 OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 5206 If nrows is non-zero, setting this mode effectively cancels fetching after 5207 retrieving nrows, otherwise it cancels fetching immediately. 5210 OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 5211 If nrows is non-zero, setting this mode effectively cancels fetching after 5212 retrieving nrows, otherwise it cancels fetching immediately. 5208 5213 Related Functions 5209 5214 OCIAttrGet() … … 5216 5221 Syntax 5217 5222 sword OCIStmtFetch2 ( OCIStmt *stmtp, 5218 OCIError *errhp, 5223 OCIError *errhp, 5219 5224 ub4 nrows, 5220 5225 ub2 orientation, … … 5222 5227 ub4 mode); 5223 5228 Comments 5224 The fetch call works similar to the OCIStmtFetch call with the 5225 addition of the fetchOffset parameter. It can be used on any 5226 statement handle, whether it is scrollable or not. For a 5227 non-scrollable statement handle, the only acceptable value 5228 will be OCI_FETCH_NEXT, and the fetchOffset parameter will be 5229 ignored. Applications are encouraged to use this new call. 5230 5231 A fetchOffset with OCI_FETCH_RELATIVE is equivalent to 5232 OCI_FETCH_CURRENT with a value of 0, is equivalent to 5233 OCI_FETCH_NEXT with a value of 1, and equivalent to 5234 OCI_FETCH_PRIOR with a value of -1. Note that the range of 5235 accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an 5236 error could be raised if sufficient rows do not exist in 5237 5238 The fetch call is a local call, if prefetched rows suffice. However, this is 5239 transparent to the application. If LOB columns are being read, LOB locators 5240 are fetched for subsequent LOB operations to be performed on these locators. 5241 Prefetching is turned off if LONG columns are involved. 5242 A fetch with nrows set to 0 rows effectively cancels the fetch for this 5229 The fetch call works similar to the OCIStmtFetch call with the 5230 addition of the fetchOffset parameter. It can be used on any 5231 statement handle, whether it is scrollable or not. For a 5232 non-scrollable statement handle, the only acceptable value 5233 will be OCI_FETCH_NEXT, and the fetchOffset parameter will be 5234 ignored. Applications are encouraged to use this new call. 5235 5236 A fetchOffset with OCI_FETCH_RELATIVE is equivalent to 5237 OCI_FETCH_CURRENT with a value of 0, is equivalent to 5238 OCI_FETCH_NEXT with a value of 1, and equivalent to 5239 OCI_FETCH_PRIOR with a value of -1. Note that the range of 5240 accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an 5241 error could be raised if sufficient rows do not exist in 5242 5243 The fetch call is a local call, if prefetched rows suffice. However, this is 5244 transparent to the application. If LOB columns are being read, LOB locators 5245 are fetched for subsequent LOB operations to be performed on these locators. 5246 Prefetching is turned off if LONG columns are involved. 5247 A fetch with nrows set to 0 rows effectively cancels the fetch for this 5243 5248 statement. 5244 5249 Parameters 5245 5250 stmtp (IN) - a statement (application request) handle. 5246 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5251 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5247 5252 diagnostic information in the event of an error. 5248 5253 nrows (IN) - number of rows to be fetched from the current position. 5249 5254 It defaults to 1 for orientation OCI_FETCH_LAST. 5250 orientation (IN) - The acceptable values are as follows, with 5255 orientation (IN) - The acceptable values are as follows, with 5251 5256 OCI_FETCH_NEXT being the default value. 5252 OCI_FETCH_CURRENT gets the current row, 5257 OCI_FETCH_CURRENT gets the current row, 5253 5258 OCI_FETCH_NEXT gets the next row from the current position, 5254 5259 OCI_FETCH_FIRST gets the first row in the result set, 5255 OCI_FETCH_LAST gets the last row in the result set, 5256 OCI_FETCH_PRIOR gets the previous row from the current row in the result set, 5257 OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset 5260 OCI_FETCH_LAST gets the last row in the result set, 5261 OCI_FETCH_PRIOR gets the previous row from the current row in the result set, 5262 OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset 5258 5263 parameter) in the result set using absolute positioning, 5259 OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset 5264 OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset 5260 5265 parameter) in the result set using relative positioning. 5261 scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and 5266 scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and 5262 5267 OCI_FETCH_RELATIVE orientation parameters only. It specify 5263 the new current position for scrollable result set. It is 5264 ignored for non-scrollable result sets. 5268 the new current position for scrollable result set. It is 5269 ignored for non-scrollable result sets. 5265 5270 mode (IN) - for release 8.0, beta-1, the following mode is defined. 5266 5271 OCI_DEFAULT - default mode 5267 OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 5268 If nrows is non-zero, setting this mode effectively cancels fetching after 5269 retrieving nrows, otherwise it cancels fetching immediately. 5272 OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 5273 If nrows is non-zero, setting this mode effectively cancels fetching after 5274 retrieving nrows, otherwise it cancels fetching immediately. 5270 5275 Related Functions 5271 5276 OCIAttrGet() … … 5284 5289 ub4 *typep, 5285 5290 ub1 *in_outp, 5286 ub4 *iterp, 5291 ub4 *iterp, 5287 5292 ub4 *idxp, 5288 5293 ub1 *piecep ); 5289 5294 5290 5295 Comments 5291 When an execute/fetch call returns OCI_NEED_DATA to get/return a 5292 dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the 5293 relevant information: bind/define handle, iteration or index number and 5296 When an execute/fetch call returns OCI_NEED_DATA to get/return a 5297 dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the 5298 relevant information: bind/define handle, iteration or index number and 5294 5299 which piece. 5295 See the section "Runtime Data Allocation and Piecewise Operations" on page 5300 See the section "Runtime Data Allocation and Piecewise Operations" on page 5296 5301 5-16 for more information about using OCIStmtGetPieceInfo(). 5297 5302 Parameters 5298 stmtp (IN) - the statement when executed returned OCI_NEED_DATA. 5299 errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 5300 diagnostic information in the event of an error. 5301 hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or 5303 stmtp (IN) - the statement when executed returned OCI_NEED_DATA. 5304 errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 5305 diagnostic information in the event of an error. 5306 hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or 5302 5307 define whose runtime data is required or is being provided. 5303 typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND 5308 typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND 5304 5309 (for a bind handle) or OCI_HTYPE_DEFINE (for a define handle). 5305 in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind 5306 value. Returns OCI_PARAM_OUT if the data is available as an OUT bind 5310 in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind 5311 value. Returns OCI_PARAM_OUT if the data is available as an OUT bind 5307 5312 variable or a define position value. 5308 5313 iterp (OUT) - returns the row number of a multiple row operation. 5309 5314 idxp (OUT) - the index of an array element of a PL/SQL array bind operation. 5310 piecep (OUT) - returns one of the following defined values - 5311 OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and 5312 OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE. 5313 Related Functions 5314 OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 5315 piecep (OUT) - returns one of the following defined values - 5316 OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and 5317 OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE. 5318 Related Functions 5319 OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 5315 5320 OCIStmtSetPieceInfo() 5316 5321 … … 5326 5331 sword OCIStmtPrepare ( OCIStmt *stmtp, 5327 5332 OCIError *errhp, 5328 CONST OraText *stmt, 5333 CONST OraText *stmt, 5329 5334 ub4 stmt_len, 5330 5335 ub4 language, 5331 5336 ub4 mode); 5332 5337 Comments 5333 This call is used to prepare a SQL or PL/SQL statement for execution. The 5334 OCIStmtPrepare() call defines an application request. 5335 This is a purely local call. Data values for this statement initialized in 5336 subsequent bind calls will be stored in a bind handle which will hang off this 5338 This call is used to prepare a SQL or PL/SQL statement for execution. The 5339 OCIStmtPrepare() call defines an application request. 5340 This is a purely local call. Data values for this statement initialized in 5341 subsequent bind calls will be stored in a bind handle which will hang off this 5337 5342 statement handle. 5338 This call does not create an association between this statement handle and any 5343 This call does not create an association between this statement handle and any 5339 5344 particular server. 5340 See the section "Preparing Statements" on page 2-21 for more information 5345 See the section "Preparing Statements" on page 2-21 for more information 5341 5346 about using this call. 5342 5347 Parameters 5343 5348 stmtp (IN) - a statement handle. 5344 5349 errhp (IN) - an error handle to retrieve diagnostic information. 5345 stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-terminated 5346 string. The pointer to the OraText of the statement must be available as long 5350 stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-terminated 5351 string. The pointer to the OraText of the statement must be available as long 5347 5352 as the statement is executed. 5348 5353 stmt_len (IN) - length of the statement. Must not be zero. … … 5350 5355 OCI_V7_SYNTAX - V7 ORACLE parsing syntax 5351 5356 OCI_V8_SYNTAX - V8 ORACLE parsing syntax 5352 OCI_NTV_SYNTAX - syntax depending upon the version of the server. 5353 mode (IN) - the only defined mode is OCI_DEFAULT for default mode. 5357 OCI_NTV_SYNTAX - syntax depending upon the version of the server. 5358 mode (IN) - the only defined mode is OCI_DEFAULT for default mode. 5354 5359 Example 5355 This example demonstrates the use of OCIStmtPrepare(), as well as the OCI 5360 This example demonstrates the use of OCIStmtPrepare(), as well as the OCI 5356 5361 application initialization calls. 5357 5362 Related Functions … … 5392 5397 errhp (IN) - an error handle to retrieve diagnostic information. 5393 5398 stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null- 5394 terminated string. The pointer to the OraText of the statement 5399 terminated string. The pointer to the OraText of the statement 5395 5400 must be available as long as the statement is executed. 5396 5401 stmt_len (IN) - length of the statement. Must not be zero. … … 5451 5456 OCIError *errhp, 5452 5457 CONST dvoid *bufp, 5453 ub4 *alenp, 5458 ub4 *alenp, 5454 5459 ub1 piece, 5455 CONST dvoid *indp, 5456 ub2 *rcodep ); 5457 Comments 5458 When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT 5459 bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the 5460 CONST dvoid *indp, 5461 ub2 *rcodep ); 5462 Comments 5463 When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT 5464 bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the 5460 5465 buffer, the length, the indicator and which piece is currently being processed. 5461 For more information about using OCIStmtSetPieceInfo() see the section 5466 For more information about using OCIStmtSetPieceInfo() see the section 5462 5467 "Runtime Data Allocation and Piecewise Operations" on page 5-16. 5463 5468 Parameters 5464 5469 hndlp (IN/OUT) - the bind/define handle. 5465 type (IN) - type of the handle. 5466 errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 5470 type (IN) - type of the handle. 5471 errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 5467 5472 diagnostic information in the event of an error. 5468 bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or 5469 the piece when it is an IN bind variable, otherwise bufp is a pointer to 5473 bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or 5474 the piece when it is an IN bind variable, otherwise bufp is a pointer to 5470 5475 storage for getting a piece or a value for OUT binds and define variables. For 5471 5476 named data types or REFs, a pointer to the object or REF is returned. 5472 alenp (IN/OUT) - the length of the piece or the value. 5473 piece (IN) - the piece parameter. The following are valid values: 5474 OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or 5475 OCI_LAST_PIECE. 5476 The default value is OCI_ONE_PIECE. This parameter is used for IN bind 5477 alenp (IN/OUT) - the length of the piece or the value. 5478 piece (IN) - the piece parameter. The following are valid values: 5479 OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or 5480 OCI_LAST_PIECE. 5481 The default value is OCI_ONE_PIECE. This parameter is used for IN bind 5477 5482 variables only. 5478 indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator 5479 structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp 5483 indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator 5484 structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp 5480 5485 is either an sb2 or a dvoid * depending upon the data type. 5481 rcodep (IN/OUT) - return code. 5482 Related Functions 5483 OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 5486 rcodep (IN/OUT) - return code. 5487 Related Functions 5488 OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 5484 5489 OCIStmtGetPieceInfo() 5485 5490 … … 5529 5534 5530 5535 5531 OCIFormatTerm 5536 OCIFormatTerm 5532 5537 Name 5533 5538 OCIFormat Package Terminate … … 5842 5847 Comments 5843 5848 Toggles between an Oracle8 service context handle and an Oracle7 Lda_Def. 5844 This function can only be called after a service context has been properly 5849 This function can only be called after a service context has been properly 5845 5850 initialized. 5846 Once the service context has been translated to an Lda_Def, it can be used in 5851 Once the service context has been translated to an Lda_Def, it can be used in 5847 5852 release 7.x OCI calls (e.g., obindps(), ofen()). 5848 Note: If there are multiple service contexts which share the same server 5853 Note: If there are multiple service contexts which share the same server 5849 5854 handle, only one can be in V7 mode at any time. 5850 The action of this call can be reversed by passing the resulting Lda_Def to 5855 The action of this call can be reversed by passing the resulting Lda_Def to 5851 5856 the OCILdaToSvcCtx() function. 5852 5857 Parameters 5853 svchp (IN/OUT) - the service context handle. 5854 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5855 diagnostic information in the event of an error. 5856 ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized 5857 by this call. 5858 svchp (IN/OUT) - the service context handle. 5859 errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 5860 diagnostic information in the event of an error. 5861 ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized 5862 by this call. 5858 5863 Related Functions 5859 5864 OCILdaToSvcCtx() … … 5872 5877 ub4 flags ); 5873 5878 Comments 5874 The transaction currently associated with the service context is committed. If 5875 it is a distributed transaction that the server cannot commit, this call 5876 additionally retrieves the state of the transaction from the database to be 5879 The transaction currently associated with the service context is committed. If 5880 it is a distributed transaction that the server cannot commit, this call 5881 additionally retrieves the state of the transaction from the database to be 5877 5882 returned to the user in the error handle. 5878 If the application has defined multiple transactions, this function operates 5879 on the transaction currently associated with the service context. If the 5880 application is working with only the implicit local transaction created when 5883 If the application has defined multiple transactions, this function operates 5884 on the transaction currently associated with the service context. If the 5885 application is working with only the implicit local transaction created when 5881 5886 database changes are made, that implicit transaction is committed. 5882 If the application is running in the object mode, then the modified or updated 5887 If the application is running in the object mode, then the modified or updated 5883 5888 objects in the object cache for this transaction are also committed. 5884 The flags parameter is used for one-phase commit optimization in distributed 5885 transactions. If the transaction is non-distributed, the flags parameter is 5886 ignored, and OCI_DEFAULT can be passed as its value. OCI applications 5887 managing global transactions should pass a value of 5888 OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The 5889 The flags parameter is used for one-phase commit optimization in distributed 5890 transactions. If the transaction is non-distributed, the flags parameter is 5891 ignored, and OCI_DEFAULT can be passed as its value. OCI applications 5892 managing global transactions should pass a value of 5893 OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The 5889 5894 default is one-phase commit. 5890 Under normal circumstances, OCITransCommit() returns with a status 5891 indicating that the transaction has either been committed or rolled back. With 5892 distributed transactions, it is possible that the transaction is now in-doubt 5893 (i.e., neither committed nor aborted). In this case, OCITransCommit() 5894 attempts to retrieve the status of the transaction from the server. 5895 Under normal circumstances, OCITransCommit() returns with a status 5896 indicating that the transaction has either been committed or rolled back. With 5897 distributed transactions, it is possible that the transaction is now in-doubt 5898 (i.e., neither committed nor aborted). In this case, OCITransCommit() 5899 attempts to retrieve the status of the transaction from the server. 5895 5900 The status is returned. 5896 5901 Parameters 5897 5902 srvcp (IN) - the service context handle. 5898 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5903 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5899 5904 diagnostic information in the event of an error. 5900 5905 flags -see the "Comments" section above. … … 5915 5920 ub4 flags); 5916 5921 Comments 5917 Detaches a global transaction from the service context handle. The transaction 5918 currently attached to the service context handle becomes inactive at the end 5919 of this call. The transaction may be resumed later by calling OCITransStart(), 5922 Detaches a global transaction from the service context handle. The transaction 5923 currently attached to the service context handle becomes inactive at the end 5924 of this call. The transaction may be resumed later by calling OCITransStart(), 5920 5925 specifying a flags value of OCI_TRANS_RESUME. 5921 When a transaction is detached, the value which was specified in the timeout 5922 parameter of OCITransStart() when the transaction was started is used to 5923 determine the amount of time the branch can remain inactive before being 5926 When a transaction is detached, the value which was specified in the timeout 5927 parameter of OCITransStart() when the transaction was started is used to 5928 determine the amount of time the branch can remain inactive before being 5924 5929 deleted by the server's PMON process. 5925 Note: The transaction can be resumed by a different process than the one 5926 that detached it, provided that the transaction has the same 5930 Note: The transaction can be resumed by a different process than the one 5931 that detached it, provided that the transaction has the same 5927 5932 authorization. 5928 5933 Parameters 5929 srvcp (IN) - the service context handle. 5930 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5934 srvcp (IN) - the service context handle. 5935 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5931 5936 diagnostic information in the event of an error. 5932 5937 flags (IN) - you must pass a value of OCI_DEFAULT for this parameter. … … 5942 5947 Causes the server to forget a heuristically completed global transaction. 5943 5948 Syntax 5944 sword OCITransForget ( OCISvcCtx *svchp, 5949 sword OCITransForget ( OCISvcCtx *svchp, 5945 5950 OCIError *errhp, 5946 5951 ub4 flags); … … 5948 5953 Comments 5949 5954 5950 Forgets a heuristically completed global transaction. The server deletes the 5955 Forgets a heuristically completed global transaction. The server deletes the 5951 5956 status of the transaction from the system's pending transaction table. 5952 The XID of the transaction to be forgotten is set as an attribute of the 5957 The XID of the transaction to be forgotten is set as an attribute of the 5953 5958 transaction handle (OCI_ATTR_XID). 5954 5959 Parameters 5955 5960 srvcp (IN) - the service context handle - the transaction is rolled back. 5956 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5961 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 5957 5962 diagnostic information in the event of an error. 5958 5963 flags (IN) - you must pass OCI_DEFAULT for this parameter. … … 5961 5966 5962 5967 5963 OCITransMultiPrepare() 5968 OCITransMultiPrepare() 5964 5969 Name 5965 5970 OCI Trans(action) Multi-Branch Prepare … … 5978 5983 This call is an advanced performance feature intended for use only in 5979 5984 situations where the caller is responsible for preparing all the branches 5980 in a transaction. 5981 Parameters 5982 srvcp (IN) - the service context handle. 5985 in a transaction. 5986 Parameters 5987 srvcp (IN) - the service context handle. 5983 5988 numBranches (IN) - This is the number of branches expected. It is also the 5984 5989 array size for the next two parameters. … … 5998 6003 Prepares a transaction for commit. 5999 6004 Syntax 6000 sword OCITransPrepare ( OCISvcCtx *svchp, 6005 sword OCITransPrepare ( OCISvcCtx *svchp, 6001 6006 OCIError *errhp, 6002 6007 ub4 flags); … … 6006 6011 Prepares the specified global transaction for commit. 6007 6012 This call is valid only for distributed transactions. 6008 The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made 6009 any changes. The error handle will indicate that the transaction is read-only. 6010 The flag parameter is not currently used. 6011 Parameters 6012 srvcp (IN) - the service context handle. 6013 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 6013 The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made 6014 any changes. The error handle will indicate that the transaction is read-only. 6015 The flag parameter is not currently used. 6016 Parameters 6017 srvcp (IN) - the service context handle. 6018 errhp (IN) - an error handle which can be passed to OCIErrorGet() for 6014 6019 diagnostic information in the event of an error. 6015 6020 flags (IN) - you must pass OCI_DEFAULT for this parameter. … … 6026 6031 Rolls back the current transaction. 6027 6032 Syntax 6028 sword OCITransRollback ( dvoid *svchp, 6033 sword OCITransRollback ( dvoid *svchp, 6029 6034 OCIError *errhp, 6030 6035 ub4 flags ); 6031 6036 Comments 6032 The current transaction- defined as the set of statements executed since the 6037 The current transaction- defined as the set of statements executed since the 6033 6038 last OCITransCommit() or since OCISessionBegin()-is rolled back. 6034 If the application is running under object mode then the modified or updated 6039 If the application is running under object mode then the modified or updated 6035 6040 objects in the object cache for this transaction are also rolled back. 6036 An error is returned if an attempt is made to roll back a global transaction 6041 An error is returned if an attempt is made to roll back a global transaction 6037 6042 that is not currently active. 6038 6043 Parameters 6039 svchp (IN) - a service context handle. The transaction currently set in the 6044 svchp (IN) - a service context handle. The transaction currently set in the 6040 6045 service context handle is rolled back. 6041 errhp -(IN) - an error handle which can be passed to OCIErrorGet() for 6046 errhp -(IN) - an error handle which can be passed to OCIErrorGet() for 6042 6047 diagnostic information in the event of an error. 6043 6048 flags - you must pass a value of OCI_DEFAULT for this parameter. … … 6054 6059 Sets the beginning of a transaction. 6055 6060 Syntax 6056 sword OCITransStart ( OCISvcCtx *svchp, 6057 OCIError *errhp, 6061 sword OCITransStart ( OCISvcCtx *svchp, 6062 OCIError *errhp, 6058 6063 uword timeout, 6059 6064 ub4 flags); 6060 6065 6061 6066 Comments 6062 This function sets the beginning of a global or serializable transaction. The 6063 transaction context currently associated with the service context handle is 6064 initialized at the end of the call if the flags parameter specifies that a new 6067 This function sets the beginning of a global or serializable transaction. The 6068 transaction context currently associated with the service context handle is 6069 initialized at the end of the call if the flags parameter specifies that a new 6065 6070 transaction should be started. 6066 The XID of the transaction is set as an attribute of the transaction handle 6071 The XID of the transaction is set as an attribute of the transaction handle 6067 6072 (OCI_ATTR_XID) 6068 6073 Parameters 6069 svchp (IN/OUT) - the service context handle. The transaction context in the 6070 service context handle is initialized at the end of the call if the flag 6074 svchp (IN/OUT) - the service context handle. The transaction context in the 6075 service context handle is initialized at the end of the call if the flag 6071 6076 specified a new transaction to be started. 6072 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 6073 err and this function returns OCI_ERROR. Diagnostic information can be 6077 errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 6078 err and this function returns OCI_ERROR. Diagnostic information can be 6074 6079 obtained by calling OCIErrorGet(). 6075 timeout (IN) - the time, in seconds, to wait for a transaction to become 6076 available for resumption when OCI_TRANS_RESUME is specified. When 6077 OCI_TRANS_NEW is specified, this value is stored and may be used later by 6080 timeout (IN) - the time, in seconds, to wait for a transaction to become 6081 available for resumption when OCI_TRANS_RESUME is specified. When 6082 OCI_TRANS_NEW is specified, this value is stored and may be used later by 6078 6083 OCITransDetach(). 6079 flags (IN) - specifies whether a new transaction is being started or an 6080 existing transaction is being resumed. Also specifies serializiability or 6081 read-only status. More than a single value can be specified. By default, 6084 flags (IN) - specifies whether a new transaction is being started or an 6085 existing transaction is being resumed. Also specifies serializiability or 6086 read-only status. More than a single value can be specified. By default, 6082 6087 a read/write transaction is started. The flag values are: 6083 OCI_TRANS_NEW - starts a new transaction branch. By default starts a 6088 OCI_TRANS_NEW - starts a new transaction branch. By default starts a 6084 6089 tightly coupled and migratable branch. 6085 6090 OCI_TRANS_TIGHT - explicitly specifies a tightly coupled branch 6086 6091 OCI_TRANS_LOOSE - specifies a loosely coupled branch 6087 OCI_TRANS_RESUME - resumes an existing transaction branch. 6092 OCI_TRANS_RESUME - resumes an existing transaction branch. 6088 6093 OCI_TRANS_READONLY - start a readonly transaction 6089 6094 OCI_TRANS_SERIALIZABLE - start a serializable transaction … … 6115 6120 * 6116 6121 */ 6117 alias sword function(OCIEnv* env, ub4 mode, size_t xtramem_sz, dvoid* usrmemp, OCIUcb* ucbDesc) OCIEnvCallbackType; 6122 alias sword function(OCIEnv* env, ub4 mode, size_t xtramem_sz, dvoid* usrmemp, OCIUcb* ucbDesc) OCIEnvCallbackType; 6118 6123 6119 6124 /** … … 6968 6973 * 6969 6974 */ 6970 extern (C) sword OCIAQEnq (OCISvcCtx* svchp, OCIError* errhp, OraText* queue_name, OCIAQEnqOptions* enqopt, OCIAQMsgProperties* msgprop, OCIType* payload_tdo, dvoid** payload, dvoid** payload_ind, OCIRaw** msgid, ub4 flags); 6971 6972 /** 6973 * 6974 */ 6975 extern (C) sword OCIAQDeq (OCISvcCtx* svchp, OCIError* errhp, OraText* queue_name, OCIAQDeqOptions* deqopt, OCIAQMsgProperties* msgprop, OCIType* payload_tdo, dvoid** payload, dvoid** payload_ind, OCIRaw** msgid, ub4 flags); 6975 extern (C) sword OCIAQEnq (OCISvcCtx* svchp, OCIError* errhp, OraText* queue_name, OCIAQEnqOptions* enqopt, OCIAQMsgProperties* msgprop, OCIType* payload_tdo, dvoid** payload, dvoid** payload_ind, OCIRaw** msgid, ub4 flags); 6976 6977 /** 6978 * 6979 */ 6980 extern (C) sword OCIAQDeq (OCISvcCtx* svchp, OCIError* errhp, OraText* queue_name, OCIAQDeqOptions* deqopt, OCIAQMsgProperties* msgprop, OCIType* payload_tdo, dvoid** payload, dvoid** payload_ind, OCIRaw** msgid, ub4 flags); 6976 6981 6977 6982 /** … … 7316 7321 This call allocates an OCIAnyDataSet for the duration of dur and 7317 7322 initializes it with the type information. The OCIAnyDataSet can hold 7318 multiple instances of the given type. For performance reasons, the 7323 multiple instances of the given type. For performance reasons, the 7319 7324 OCIAnyDataSet will end up pointing to the passed in OCIType parameter. 7320 7325 It is the responsibility of the caller to ensure that the OCIType is … … 7626 7631 OCINlsGetInfo - Get NLS info from OCI environment handle 7627 7632 REMARKS 7628 This function generates language information specified by item from OCI 7629 environment handle envhp into an array pointed to by buf within size 7633 This function generates language information specified by item from OCI 7634 environment handle envhp into an array pointed to by buf within size 7630 7635 limitation as buflen. 7631 7636 RETURNS … … 7634 7639 OCI environment handle. 7635 7640 errhp(IN/OUT) 7636 The OCI error handle. If there is an error, it is record in errhp and 7637 this function returns a NULL pointer. Diagnostic information can be 7641 The OCI error handle. If there is an error, it is record in errhp and 7642 this function returns a NULL pointer. Diagnostic information can be 7638 7643 obtained by calling OCIErrorGet(). 7639 7644 buf(OUT) … … 7684 7689 OCI_NLS_ABMONTHNAME12 : Native abbreviated name for December. 7685 7690 OCI_NLS_YES : Native string for affirmative response. 7686 OCI_NLS_NO : Native negative response. 7691 OCI_NLS_NO : Native negative response. 7687 7692 OCI_NLS_AM : Native equivalent string of AM. 7688 7693 OCI_NLS_PM : Native equivalent string of PM. … … 7710 7715 OCINlsNumericInfoGet - Get NLS numeric info from OCI environment handle 7711 7716 REMARKS 7712 This function generates numeric language information specified by item 7717 This function generates numeric language information specified by item 7713 7718 from OCI environment handle envhp into an output number variable. 7714 7719 RETURNS … … 7717 7722 OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE. 7718 7723 errhp(IN/OUT) 7719 The OCI error handle. If there is an error, it is record in errhp and 7720 this function returns a NULL pointer. Diagnostic information can be 7724 The OCI error handle. If there is an error, it is record in errhp and 7725 this function returns a NULL pointer. Diagnostic information can be 7721 7726 obtained by calling OCIErrorGet(). 7722 7727 val(OUT) … … 7729 7734 environment or session handle charset 7730 7735 OCI_NLS_CHARSET_FIXEDWIDTH: Character byte size for fixed-width charset; 7731 0 for variable-width charset 7736 0 for variable-width charset 7732 7737 */ 7733 7738 extern (C) sword OCINlsNumericInfoGet (dvoid* envhp, OCIError* errhp, sb4* val, ub2 item); … … 7745 7750 OCI environment handle. 7746 7751 name(IN) 7747 Pointer to a null-terminated Oracle character set name whose id 7752 Pointer to a null-terminated Oracle character set name whose id 7748 7753 will be returned. 7749 7754 */ … … 7774 7779 /* 7775 7780 NAME 7776 OCINlsNameMap - Map NLS naming from Oracle to other standards and vice 7781 OCINlsNameMap - Map NLS naming from Oracle to other standards and vice 7777 7782 versa 7778 7783 REMARKS … … 7784 7789 OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE. 7785 7790 buf(OUT) 7786 Pointer to the destination buffer. On OCI_SUCCESS return, it will 7791 Pointer to the destination buffer. On OCI_SUCCESS return, it will 7787 7792 contain null-terminated string for requested mapped name. 7788 7793 buflen(IN) … … 7810 7815 /* 7811 7816 NAME 7812 OCIMultiByteToWideChar - Convert a null terminated multibyte string into 7817 OCIMultiByteToWideChar - Convert a null terminated multibyte string into 7813 7818 wchar 7814 7819 REMARKS 7815 This routine converts an entire null-terminated string into the wchar 7820 This routine converts an entire null-terminated string into the wchar 7816 7821 format. The wchar output buffer will be null-terminated. 7817 7822 RETURNS … … 7885 7890 /* 7886 7891 NAME 7887 OCIWideCharInSizeToMultiByte - Convert a wchar string in length into 7892 OCIWideCharInSizeToMultiByte - Convert a wchar string in length into 7888 7893 mulitbyte 7889 7894 REMARKS … … 7892 7897 output buffer size or input buffer size or it reaches a null-terminator 7893 7898 in source string. The output buffer will be null-terminated if space 7894 permits. If dstsz is zero, the function just returns the size of byte not 7899 permits. If dstsz is zero, the function just returns the size of byte not 7895 7900 including ending null-terminator need to store the converted string. 7896 7901 RETURNS … … 8170 8175 OCI_NLS_BINARY : for the binary comparison, this is default value. 8171 8176 OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale. 8172 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8177 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8173 8178 comparison. 8174 8179 */ … … 8237 8242 This function computes the number of characters in the wchar string 8238 8243 pointed to by wstr, not including the null-terminator, and returns 8239 this number. 8244 this number. 8240 8245 RETURNS 8241 8246 number of characters not including ending null-terminator. … … 8254 8259 characters from wsrcstr are appended to wdststr. Note that the 8255 8260 null-terminator in wsrcstr will stop appending. wdststr will be 8256 null-terminated.. 8261 null-terminated.. 8257 8262 RETURNS 8258 8263 Number of characters in the result string not including the ending … … 8338 8343 REMARKS 8339 8344 This function determines the number of column positions required for wc 8340 in display. It returns number of column positions, or 0 if wc is 8345 in display. It returns number of column positions, or 0 if wc is 8341 8346 null-terminator. 8342 8347 RETURNS … … 8385 8390 OCI_NLS_BINARY: for the binary comparison, this is default value. 8386 8391 OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale. 8387 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8392 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8388 8393 comparison. 8389 8394 */ … … 8416 8421 OCI_NLS_BINARY: for the binary comparison, this is default value. 8417 8422 OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale. 8418 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8423 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 8419 8424 comparison. 8420 8425 */ … … 8447 8452 This function copies the multi-byte string pointed to by srcstr, 8448 8453 including the null-terminator, into the array pointed to by dststr. It 8449 returns the number of bytes copied not including the ending 8454 returns the number of bytes copied not including the ending 8450 8455 null-terminator. 8451 8456 RETURNS … … 8466 8471 This function computes the number of bytes in the multi-byte string 8467 8472 pointed to by str, not including the null-terminator, and returns this 8468 number. 8473 number. 8469 8474 RETURNS 8470 8475 number of bytes not including ending null-terminator. … … 8481 8486 bytes from srcstr are appended to dststr. Note that the null-terminator in 8482 8487 srcstr will stop appending and the function will append as many character 8483 as possible within n bytes. dststr will be null-terminated. 8488 as possible within n bytes. dststr will be null-terminated. 8484 8489 RETURNS 8485 8490 Number of bytes in the result string not including the ending … … 8503 8508 bytes are copied from the array pointed to by srcstr to the array pointed 8504 8509 to by dststr. Note that the null-terminator in srcstr will stop coping and 8505 the function will copy as many character as possible within n bytes. The 8510 the function will copy as many character as possible within n bytes. The 8506 8511 result string will be null-terminated. 8507 8512 RETURNS … … 8523 8528 multibyt string 8524 8529 REMARKS 8525 This function returns the number of display positions occupied by the 8530 This function returns the number of display positions occupied by the 8526 8531 complete characters within the range of n bytes. 8527 8532 RETURNS … … 8555 8560 OCI_NLS_UPPERCASE: convert to uppercase. 8556 8561 OCI_NLS_LOWERCASE: convert to lowercase. 8557 This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the 8562 This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the 8558 8563 linguistic setting in the locale will be used for case conversion. 8559 8564 */ … … 8564 8569 OCICharSetToUnicode - convert multibyte string into Unicode as UCS2 8565 8570 REMARKS 8566 This function converts a multi-byte string pointed to by src to Unicode 8571 This function converts a multi-byte string pointed to by src to Unicode 8567 8572 into the array pointed to by dst. The conversion will stop when it reach 8568 to the source limitation or destination limitation. 8573 to the source limitation or destination limitation. 8569 8574 The function will return number of characters converted into Unicode. 8570 8575 If dstlen is zero, it will just return the number of characters for the … … 8596 8601 to the source limitation or destination limitation. The function will 8597 8602 return number of bytes converted into multi-byte. If dstlen is zero, it 8598 will just return the number of bytes for the result without real 8603 will just return the number of bytes for the result without real 8599 8604 conversion. If a Unicode character is not convertible for the character 8600 8605 set specified in OCI environment handle, a replacement character will be … … 8665 8670 /* 8666 8671 NAME 8667 OCICharsetConversionIsReplacementUsed - chech if replacement is used in 8672 OCICharsetConversionIsReplacementUsed - chech if replacement is used in 8668 8673 conversion 8669 8674 REMARKS … … 8675 8680 invoking, else FALSE. 8676 8681 envhp(IN/OUT) 8677 OCI environment handle. This should be the first handle passed to 8682 OCI environment handle. This should be the first handle passed to 8678 8683 OCICharsetUcs2ToMb(). 8679 8684 */ … … 8744 8749 facility(IN) 8745 8750 A pointer to a facility name in the product. It is used to construct a 8746 message file name. A message file name follows the conversion with 8751 message file name. A message file name follows the conversion with 8747 8752 facility as prefix. For example, the message file name for facility 8748 `img' in American language will be `imgus.msb' where `us' is the 8749 abbreviation of American language and `msb' as message binary file 8753 `img' in American language will be `imgus.msb' where `us' is the 8754 abbreviation of American language and `msb' as message binary file 8750 8755 extension. 8751 8756 dur(IN) … … 8817 8822 threading on platforms which do not have native threading capability. 8818 8823 8819 OCIThread does not provide a portable implementation of multithreaded 8820 facilities. It only serves as a set of portable covers for native 8821 multithreaded facilities. Therefore, platforms that do not have native 8822 support for multi-threading will only be able to support a limited 8823 implementation of OCIThread. As a result, products that rely on all of 8824 OCIThread's functionality will not port to all platforms. Products that must 8825 port to all platforms must use only a subset of OCIThread's functionality. 8824 OCIThread does not provide a portable implementation of multithreaded 8825 facilities. It only serves as a set of portable covers for native 8826 multithreaded facilities. Therefore, platforms that do not have native 8827 support for multi-threading will only be able to support a limited 8828 implementation of OCIThread. As a result, products that rely on all of 8829 OCIThread's functionality will not port to all platforms. Products that must 8830 port to all platforms must use only a subset of OCIThread's functionality. 8826 8831 This issue is discussed further in later sections of this document. 8827 8832 … … 8833 8838 These calls deal with the initialization and termination of OCIThread. 8834 8839 Initialization of OCIThread initializes the OCIThread context which is 8835 a member of the OCI environment or session handle. This context is 8840 a member of the OCI environment or session handle. This context is 8836 8841 required for other OCIThread calls. 8837 8842 … … 8849 8854 As a result, OCIThread clients that use only these primitives will not 8850 8855 require the existence of multiple threads in order to work correctly, 8851 i.e., they will be able to work in single-threaded environments without 8856 i.e., they will be able to work in single-threaded environments without 8852 8857 branching code. 8853 8858 … … 8884 8889 ------------------------------------- 8885 8890 8886 Most calls to OCIThread functions take the OCI environment or session 8887 handle as a parameter. The OCIThread context is part of the OCI 8888 environment or session handle and it must be initialized by calling 8891 Most calls to OCIThread functions take the OCI environment or session 8892 handle as a parameter. The OCIThread context is part of the OCI 8893 environment or session handle and it must be initialized by calling 8889 8894 'OCIThreadInit()'. Termination of the OCIThread context occurs by calling 8890 8895 'OCIThreadTerm()'. … … 8945 8950 8946 8951 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 8947 is returned, the error is recorded in err and diagnostic 8952 is returned, the error is recorded in err and diagnostic 8948 8953 information can be obtained by calling OCIErrorGet(). 8949 8954 … … 8984 8989 8985 8990 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 8986 is returned, the error is recorded in err and diagnostic 8991 is returned, the error is recorded in err and diagnostic 8987 8992 information can be obtained by calling OCIErrorGet(). 8988 8993 … … 9024 9029 1.2.1 Types 9025 9030 9026 The passive threading primitives deal with the manipulation of mutex, 9027 thread ID's, and thread-specific data. Since the specifications of these 9028 primitives do not require the existence of multiple threads, they can be 9031 The passive threading primitives deal with the manipulation of mutex, 9032 thread ID's, and thread-specific data. Since the specifications of these 9033 primitives do not require the existence of multiple threads, they can be 9029 9034 used both on multithreaded and single-threaded platforms. 9030 9035 … … 9038 9043 code at a time. 9039 9044 9040 Mutexes pointer can be declared as parts of client structures or as 9041 stand-alone variables. Before they can be used, they must be initialized 9045 Mutexes pointer can be declared as parts of client structures or as 9046 stand-alone variables. Before they can be used, they must be initialized 9042 9047 using 'OCIThreadMutexInit()'. Once they are no longer needed, they must be 9043 destroyed using 'OCIThreadMutexDestroy()'. A mutex pointer must NOT be 9048 destroyed using 'OCIThreadMutexDestroy()'. A mutex pointer must NOT be 9044 9049 used after it is destroyed. 9045 9050 … … 9137 9142 Description 9138 9143 9139 This allocate and initializes a mutex. All mutexes must be 9144 This allocate and initializes a mutex. All mutexes must be 9140 9145 initialized prior to use. 9141 9146 9142 9147 Prototype 9143 9148 9144 sword OCIThreadMutexInit(dvoid* hndl, OCIError* err, 9149 sword OCIThreadMutexInit(dvoid* hndl, OCIError* err, 9145 9150 OCIThreadMutex** mutex); 9146 9151 … … 9148 9153 9149 9154 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9150 is returned, the error is recorded in err and diagnostic 9155 is returned, the error is recorded in err and diagnostic 9151 9156 information can be obtained by calling OCIErrorGet(). 9152 9157 … … 9168 9173 Description 9169 9174 9170 This destroys and deallocate a mutex. Each mutex must be destroyed 9175 This destroys and deallocate a mutex. Each mutex must be destroyed 9171 9176 once it is no longer needed. 9172 9177 … … 9179 9184 9180 9185 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9181 is returned, the error is recorded in err and diagnostic 9186 is returned, the error is recorded in err and diagnostic 9182 9187 information can be obtained by calling OCIErrorGet(). 9183 9188 … … 9212 9217 hndl(IN/OUT): The OCI environment or session handle. 9213 9218 9214 err(IN/OUT): The OCI error handle. If there is an error, it is 9215 recorded in err and this function returns OCI_ERROR. 9216 Diagnostic information can be obtained by calling 9219 err(IN/OUT): The OCI error handle. If there is an error, it is 9220 recorded in err and this function returns OCI_ERROR. 9221 Diagnostic information can be obtained by calling 9217 9222 OCIErrorGet(). 9218 9223 … … 9248 9253 9249 9254 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9250 is returned, the error is recorded in err and diagnostic 9255 is returned, the error is recorded in err and diagnostic 9251 9256 information can be obtained by calling OCIErrorGet(). 9252 9257 … … 9268 9273 Description 9269 9274 9270 This creates a key. Each call to this routine allocate and generates 9275 This creates a key. Each call to this routine allocate and generates 9271 9276 a new key that is distinct from all other keys. 9272 9277 … … 9279 9284 9280 9285 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9281 is returned, the error is recorded in err and diagnostic 9286 is returned, the error is recorded in err and diagnostic 9282 9287 information can be obtained by calling OCIErrorGet(). 9283 9288 … … 9292 9297 Notes 9293 9298 9294 Once this function executes successfully, a pointer to an allocated and 9299 Once this function executes successfully, a pointer to an allocated and 9295 9300 initialized key is return. That key can be used with 'OCIThreadKeyGet()' 9296 9301 and 'OCIThreadKeySet()'. The initial value of the key will be 'NULL' for … … 9318 9323 Prototype 9319 9324 9320 sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 9325 sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 9321 9326 OCIThreadKey** key); 9322 9327 … … 9324 9329 9325 9330 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9326 is returned, the error is recorded in err and diagnostic 9331 is returned, the error is recorded in err and diagnostic 9327 9332 information can be obtained by calling OCIErrorGet(). 9328 9333 9329 9334 key(IN/OUT): The 'OCIThreadKey' in which to destroy the key. 9330 9335 9331 9336 Returns 9332 9337 … … 9336 9341 9337 9342 This is different from the destructor function callback passed to the 9338 key create routine. This new destroy function 'OCIThreadKeyDestroy' is 9339 used to terminate any resources OCI THREAD acquired when it created 9340 'key'. [The 'OCIThreadKeyDestFunc' callback type is a key VALUE 9343 key create routine. This new destroy function 'OCIThreadKeyDestroy' is 9344 used to terminate any resources OCI THREAD acquired when it created 9345 'key'. [The 'OCIThreadKeyDestFunc' callback type is a key VALUE 9341 9346 destructor; it does in no way operate on the key itself.] 9342 9347 … … 9365 9370 9366 9371 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9367 is returned, the error is recorded in err and diagnostic 9372 is returned, the error is recorded in err and diagnostic 9368 9373 information can be obtained by calling OCIErrorGet(). 9369 9374 … … 9401 9406 9402 9407 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9403 is returned, the error is recorded in err and diagnostic 9408 is returned, the error is recorded in err and diagnostic 9404 9409 information can be obtained by calling OCIErrorGet(). 9405 9410 … … 9434 9439 9435 9440 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9436 is returned, the error is recorded in err and diagnostic 9441 is returned, the error is recorded in err and diagnostic 9437 9442 information can be obtained by calling OCIErrorGet(). 9438 9443 … … 9458 9463 9459 9464 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9460 is returned, the error is recorded in err and diagnostic 9465 is returned, the error is recorded in err and diagnostic 9461 9466 information can be obtained by calling OCIErrorGet(). 9462 9467 … … 9481 9486 Prototype 9482 9487 9483 sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 9488 sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 9484 9489 OCIThreadId *tidDest, 9485 9490 OCIThreadId *tidSrc); … … 9488 9493 9489 9494 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9490 is returned, the error is recorded in err and diagnostic 9495 is returned, the error is recorded in err and diagnostic 9491 9496 information can be obtained by calling OCIErrorGet(). 9492 9497 … … 9519 9524 hndl(IN/OUT): The OCI environment or session handle. 9520 9525 9521 err(IN/OUT): The OCI error handle. If there is an error, it is 9522 recorded in err and this function returns OCI_ERROR. 9523 Diagnostic information can be obtained by calling 9526 err(IN/OUT): The OCI error handle. If there is an error, it is 9527 recorded in err and this function returns OCI_ERROR. 9528 Diagnostic information can be obtained by calling 9524 9529 OCIErrorGet(). 9525 9530 … … 9551 9556 9552 9557 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9553 is returned, the error is recorded in err and diagnostic 9558 is returned, the error is recorded in err and diagnostic 9554 9559 information can be obtained by calling OCIErrorGet(). 9555 9560 … … 9589 9594 9590 9595 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9591 is returned, the error is recorded in err and diagnostic 9596 is returned, the error is recorded in err and diagnostic 9592 9597 information can be obtained by calling OCIErrorGet(). 9593 9598 … … 9595 9600 9596 9601 tid2(IN): Pointer to the second 'OCIThreadId'. 9597 9602 9598 9603 result(IN/OUT): Pointer to the result. 9599 9604 … … 9629 9634 9630 9635 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9631 is returned, the error is recorded in err and diagnostic 9636 is returned, the error is recorded in err and diagnostic 9632 9637 information can be obtained by calling OCIErrorGet(). 9633 9638 … … 9642 9647 Notes 9643 9648 9644 If 'tid' is the NULL thread ID, 'result' is set to TRUE. Otherwise, 9649 If 'tid' is the NULL thread ID, 'result' is set to TRUE. Otherwise, 9645 9650 'result' is set to FALSE. 9646 9651 … … 9655 9660 that it be possible to have multiple threads, they work correctly only in 9656 9661 the enabled OCIThread; In the disabled OCIThread, they always return 9657 failure. The exception is OCIThreadHandleGet(); it may be called in a 9662 failure. The exception is OCIThreadHandleGet(); it may be called in a 9658 9663 single-threaded environment, in which case it will have no effect. 9659 9664 9660 9665 Active primitives should only be called by code running in a multi-threaded 9661 environment. You can call OCIThreadIsMulti() to determine whether the 9666 environment. You can call OCIThreadIsMulti() to determine whether the 9662 9667 environment is multi-threaded or single-threaded. 9663 9668 … … 9692 9697 Prototype 9693 9698 9694 sword OCIThreadHndInit(dvoid *hndl, OCIError *err, 9699 sword OCIThreadHndInit(dvoid *hndl, OCIError *err, 9695 9700 OCIThreadHandle** thnd); 9696 9701 … … 9698 9703 9699 9704 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9700 is returned, the error is recorded in err and diagnostic 9705 is returned, the error is recorded in err and diagnostic 9701 9706 information can be obtained by calling OCIErrorGet(). 9702 9707 … … 9717 9722 Prototype 9718 9723 9719 sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, 9724 sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, 9720 9725 OCIThreadHandle** thnd); 9721 9726 … … 9723 9728 9724 9729 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9725 is returned, the error is recorded in err and diagnostic 9730 is returned, the error is recorded in err and diagnostic 9726 9731 information can be obtained by calling OCIErrorGet(). 9727 9732 … … 9753 9758 9754 9759 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9755 is returned, the error is recorded in err and diagnostic 9760 is returned, the error is recorded in err and diagnostic 9756 9761 information can be obtained by calling OCIErrorGet(). 9757 9762 … … 9804 9809 9805 9810 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9806 is returned, the error is recorded in err and diagnostic 9811 is returned, the error is recorded in err and diagnostic 9807 9812 information can be obtained by calling OCIErrorGet(). 9808 9813 … … 9835 9840 9836 9841 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9837 is returned, the error is recorded in err and diagnostic 9842 is returned, the error is recorded in err and diagnostic 9838 9843 information can be obtained by calling OCIErrorGet(). 9839 9844 … … 9868 9873 9869 9874 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR 9870 is returned, the error is recorded in err and diagnostic 9875 is returned, the error is recorded in err and diagnostic 9871 9876 information can be obtained by calling OCIErrorGet(). 9872 9877 … … 9880 9885 Notes 9881 9886 9882 'thnd' should be initialized by OCIThreadHndInit(). 9883 9884 The thread handle 'tHnd' retrieved by this function must be closed 9887 'thnd' should be initialized by OCIThreadHndInit(). 9888 9889 The thread handle 'tHnd' retrieved by this function must be closed 9885 9890 with OCIThreadClose() and destroyed by OCIThreadHndDestroy() after it 9886 9891 is used. … … 9918 9923 OCIThread client code written using active primitives will only work 9919 9924 correctly on multi-threaded platforms. In order to write a version of the 9920 same application to run on single-threaded platform, it is necessary to 9921 branch the your code, whether by branching versions of the source file or 9925 same application to run on single-threaded platform, it is necessary to 9926 branch the your code, whether by branching versions of the source file or 9922 9927 by branching at runtime with the OCIThreadIsMulti() call. 9923 9928 … … 9947 9952 * 9948 9953 */ 9949 extern (C) sword OCIThreadMutexInit (dvoid* hndl, OCIError* err, OCIThreadMutex** mutex); 9954 extern (C) sword OCIThreadMutexInit (dvoid* hndl, OCIError* err, OCIThreadMutex** mutex); 9950 9955 9951 9956 /** … … 10338 10343 */ 10339 10344 deprecated extern (C) sword ocidefn (OCIStmt* stmtp, OCIDefine* defnp, OCIError* errhp, ub4 position, dvoid* valuep, sb4 value_sz, ub2 dty, dvoid* indp, ub2* rlenp, ub2* rcodep, ub4 mode); 10345 10346 } trunk/bbconv/dbi/oracle/imp/ociapr.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ociapr; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ocidfn; 18 19 /** 20 * 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oratypes; 19 20 /** 21 * 21 22 * 22 23 * Params: … … 43 44 * 44 45 * Returns: 45 * 46 * 46 47 */ 47 48 extern (C) sword obindps (cda_def* cursor, ub1 opcode, OraText* sqlvar, sb4 sqlvl, ub1* pvctx, sb4 progvl, sword ftype, sword scale, sb2* indp, ub2* alen, ub2* arcode, sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip, ub4 maxsiz, ub4* cursiz, OraText* fmt, sb4 fmtl, sword fmtt); 48 49 49 50 /** 50 * 51 * 52 * Params: 53 * lda = 54 * 55 * Returns: 56 * 51 * 52 * 53 * Params: 54 * lda = 55 * 56 * Returns: 57 * 57 58 */ 58 59 extern (C) sword obreak (cda_def* lda); 59 60 60 61 /** 61 * 62 * 63 * Params: 64 * cursor = 65 * 66 * Returns: 67 * 62 * 63 * 64 * Params: 65 * cursor = 66 * 67 * Returns: 68 * 68 69 */ 69 70 extern (C) sword ocan (cda_def* cursor); 70 71 71 72 /** 72 * 73 * 74 * Params: 75 * cursor = 76 * 77 * Returns: 78 * 73 * 74 * 75 * Params: 76 * cursor = 77 * 78 * Returns: 79 * 79 80 */ 80 81 extern (C) sword oclose (cda_def* cursor); 81 82 82 83 /** 83 * 84 * 85 * Params: 86 * lda = 87 * 88 * Returns: 89 * 84 * 85 * 86 * Params: 87 * lda = 88 * 89 * Returns: 90 * 90 91 */ 91 92 extern (C) sword ocof (cda_def* lda); 92 93 93 94 /** 94 * 95 * 96 * Params: 97 * lda = 98 * 99 * Returns: 100 * 95 * 96 * 97 * Params: 98 * lda = 99 * 100 * Returns: 101 * 101 102 */ 102 103 extern (C) sword ocom (cda_def* lda); 103 104 104 105 /** 105 * 106 * 107 * Params: 108 * lda = 109 * 110 * Returns: 111 * 106 * 107 * 108 * Params: 109 * lda = 110 * 111 * Returns: 112 * 112 113 */ 113 114 extern (C) sword ocon (cda_def* lda); 114 115 115 116 /** 116 * 117 * 117 118 * 118 119 * Params: … … 136 137 * 137 138 * Returns: 138 * 139 * 139 140 */ 140 141 extern (C) sword odefinps (cda_def* cursor, ub1 opcode, sword pos, ub1* bufctx, sb4 bufl, sword ftype, sword scale, sb2* indp, OraText* fmt, sb4 fmtl, sword fmtt, ub2* rlen, ub2* rcode, sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip); 141 142 142 143 /** 143 * 144 * 144 145 * 145 146 * Params: … … 167 168 * 168 169 * Returns: 169 * 170 * 170 171 */ 171 172 extern (C) sword odessp (cda_def* cursor, OraText* objnam, size_t onlen, ub1* rsv1, size_t rsv1ln, ub1* rsv2, size_t rsv2ln, ub2* ovrld, ub2* pos, ub2* level, OraText** argnam, ub2* arnlen, ub2* dtype, ub1* defsup, ub1* mode, ub4* dtsiz, sb2* prec, sb2* scale, ub1* radix, ub4* spare, ub4* arrsiz); 172 173 173 174 /** 174 * 175 * 175 176 * 176 177 * Params: … … 187 188 * 188 189 * Returns: 189 * 190 * 190 191 */ 191 192 extern (C) sword odescr (cda_def* cursor, sword pos, sb4* dbsize, sb2* dbtype, sb1* cbuf, sb4* cbufl, sb4* dsize, sb2* prec, sb2* scale, sb2* nullok); 192 193 193 194 /** 194 * 195 * 195 196 * 196 197 * Params: … … 201 202 * 202 203 * Returns: 203 * 204 * 204 205 */ 205 206 extern (C) sword oerhms (cda_def* lda, sb2 rcode, OraText* buf, sword bufsiz); 206 207 207 208 /** 208 * 209 * 209 210 * 210 211 * Params: … … 213 214 * 214 215 * Returns: 215 * 216 * 216 217 */ 217 218 extern (C) sword oermsg (sb2 rcode, OraText* buf); 218 219 219 220 /** 220 * 221 * 222 * Params: 223 * cursor = 224 * 225 * Returns: 226 * 221 * 222 * 223 * Params: 224 * cursor = 225 * 226 * Returns: 227 * 227 228 */ 228 229 extern (C) sword oexec (cda_def* cursor); 229 230 230 231 /** 231 * 232 * 232 233 * 233 234 * Params: … … 238 239 * 239 240 * Returns: 240 * 241 * 241 242 */ 242 243 extern (C) sword oexfet (cda_def* cursor, ub4 nrows, sword cancel, sword exact); 243 244 244 245 /** 245 * 246 * 246 247 * 247 248 * Params: … … 251 252 * 252 253 * Returns: 253 * 254 * 254 255 */ 255 256 extern (C) sword oexn (cda_def* cursor, sword iters, sword rowoff); 256 257 257 258 /** 258 * 259 * 259 260 * 260 261 * Params: … … 263 264 * 264 265 * Returns: 265 * 266 * 266 267 */ 267 268 extern (C) sword ofen (cda_def* cursor, sword nrows); 268 269 269 270 /** 270 * 271 * 272 * Params: 273 * cursor = 274 * 275 * Returns: 276 * 271 * 272 * 273 * Params: 274 * cursor = 275 * 276 * Returns: 277 * 277 278 */ 278 279 extern (C) sword ofetch (cda_def* cursor); 279 280 280 281 /** 281 * 282 * 282 283 * 283 284 * Params: … … 291 292 * 292 293 * Returns: 293 * 294 * 294 295 */ 295 296 extern (C) sword oflng (cda_def* cursor, sword pos, ub1* buf, sb4 bufl, sword dtype, ub4* retl, sb4 offset); 296 297 297 298 /** 298 * 299 * 299 300 * 300 301 * Params: … … 306 307 * 307 308 * Returns: 308 * 309 * 309 310 */ 310 311 extern (C) sword ogetpi (cda_def* cursor, ub1* piecep, dvoid** ctxpp, ub4* iterp, ub4* indexp); 311 312 312 313 /** 313 * 314 * 314 315 * 315 316 * Params: … … 319 320 * 320 321 * Returns: 321 * 322 * 322 323 */ 323 324 extern (C) sword oopt (cda_def* cursor, sword rbopt, sword waitopt); 324 325 325 326 /** 326 * 327 * 327 328 * 328 329 * Params: … … 330 331 * 331 332 * Returns: 332 * 333 * 333 334 */ 334 335 extern (C) sword opinit (ub4 mode); 335 336 336 337 /** 337 * 338 * 338 339 * 339 340 * Params: … … 349 350 * 350 351 * Returns: 351 * 352 * 352 353 */ 353 354 extern (C) sword olog (cda_def* lda, ub1* hda, OraText* uid, sword uidl, OraText* pswd, sword pswdl, OraText* conn, sword connl, ub4 mode); 354 355 355 356 /** 356 * 357 * 358 * Params: 359 * lda = 360 * 361 * Returns: 362 * 357 * 358 * 359 * Params: 360 * lda = 361 * 362 * Returns: 363 * 363 364 */ 364 365 extern (C) sword ologof (cda_def* lda); 365 366 366 367 /** 367 * 368 * 368 369 * 369 370 * Params: … … 377 378 * 378 379 * Returns: 379 * 380 * 380 381 */ 381 382 extern (C) sword oopen (cda_def* cursor, cda_def* lda, OraText* dbn, sword dbnl, sword arsize, OraText* uid, sword uidl); 382 383 383 384 /** 384 * 385 * 385 386 * 386 387 * Params: … … 392 393 * 393 394 * Returns: 394 * 395 * 395 396 */ 396 397 extern (C) sword oparse (cda_def* cursor, OraText* sqlstm, sb4 sqllen, sword defflg, ub4 lngflg); 397 398 398 399 /** 399 * 400 * 401 * Params: 402 * lda = 403 * 404 * Returns: 405 * 400 * 401 * 402 * Params: 403 * lda = 404 * 405 * Returns: 406 * 406 407 */ 407 408 extern (C) sword orol (cda_def* lda); 408 409 409 410 /** 410 * 411 * 411 412 * 412 413 * Params: … … 417 418 * 418 419 * Returns: 419 * 420 * 420 421 */ 421 422 extern (C) sword osetpi (cda_def* cursor, ub1 piece, dvoid* bufp, ub4* lenp); 422 423 423 424 /** 424 * 425 * 425 426 * 426 427 * Params: … … 430 431 * 431 432 * Returns: 432 * 433 * 433 434 */ 434 435 extern (C) void sqlld2 (cda_def* lda, OraText* cname, sb4* cnlen); 435 436 436 437 /** 437 * 438 * 439 * Params: 440 * lda = 441 * 442 * Returns: 443 * 438 * 439 * 440 * Params: 441 * lda = 442 * 443 * Returns: 444 * 444 445 */ 445 446 extern (C) void sqllda (cda_def* lda); 446 447 447 448 /** 448 * 449 * 450 * Params: 451 * lda = 452 * 453 * Returns: 454 * 449 * 450 * 451 * Params: 452 * lda = 453 * 454 * Returns: 455 * 455 456 */ 456 457 extern (C) sword onbset (cda_def* lda); 457 458 458 459 /** 459 * 460 * 461 * Params: 462 * lda = 463 * 464 * Returns: 465 * 460 * 461 * 462 * Params: 463 * lda = 464 * 465 * Returns: 466 * 466 467 */ 467 468 extern (C) sword onbtst (cda_def* lda); 468 469 469 470 /** 470 * 471 * 472 * Params: 473 * lda = 474 * 475 * Returns: 476 * 471 * 472 * 473 * Params: 474 * lda = 475 * 476 * Returns: 477 * 477 478 */ 478 479 extern (C) sword onbclr (cda_def* lda); 479 480 480 481 /** 481 * 482 * 482 483 * 483 484 * Params: … … 486 487 * 487 488 * Returns: 488 * 489 * 489 490 */ 490 491 extern (C) sword ognfd (cda_def* lda, dvoid* fdp); 491 492 492 493 /** 493 * 494 * 494 495 * 495 496 * Params: … … 511 512 * 512 513 * Returns: 513 * 514 * 514 515 */ 515 516 deprecated extern (C) sword obndra (cda_def* cursor, OraText* sqlvar, sword sqlvl, ub1* progv, sword progvl, sword ftype, sword scale, sb2* indp, ub2* alen, ub2* arcode, ub4 maxsiz, ub4* cursiz, OraText* fmt, sword fmtl, sword fmtt); 516 517 517 518 /** 518 * 519 * 519 520 * 520 521 * Params: … … 531 532 * 532 533 * Returns: 533 * 534 * 534 535 */ 535 536 deprecated extern (C) sword obndrn (cda_def* cursor, sword sqlvn, ub1* progv, sword progvl, sword ftype, sword scale, sb2* indp, OraText* fmt, sword fmtl, sword fmtt); 536 537 537 538 /** 538 * 539 * 539 540 * 540 541 * Params: … … 552 553 * 553 554 * Returns: 554 * 555 * 555 556 */ 556 557 deprecated extern (C) sword obndrv (cda_def* cursor, OraText* sqlvar, sword sqlvl, ub1* progv, sword progvl, sword ftype, sword scale, sb2* indp, OraText* fmt, sword fmtl, sword fmtt); 557 558 558 559 /** 559 * 560 * 560 561 * 561 562 * Params: … … 574 575 * 575 576 * Returns: 576 * 577 * 577 578 */ 578 579 deprecated extern (C) sword odefin (cda_def* cursor, sword pos, ub1* buf, sword bufl, sword ftype, sword scale, sb2* indp, OraText* fmt, sword fmtl, sword fmtt, ub2* rlen, ub2* rcode); 579 580 580 581 /** 581 * 582 * 582 583 * 583 584 * Params: … … 590 591 * 591 592 * Returns: 592 * 593 * 593 594 */ 594 595 deprecated extern (C) sword oname (cda_def* cursor, sword pos, sb1* tbuf, sb2* tbufl, sb1* buf, sb2* bufl); 595 596 596 597 /** 597 * 598 * 598 599 * 599 600 * Params: … … 607 608 * 608 609 * Returns: 609 * 610 * 610 611 */ 611 612 deprecated extern (C) sword orlon (cda_def* lda, ub1* hda, OraText* uid, sword uidl, OraText* pswd, sword pswdl, sword audit); 612 613 613 614 /** 614 * 615 * 615 616 * 616 617 * Params: … … 623 624 * 624 625 * Returns: 625 * 626 * 626 627 */ 627 628 deprecated extern (C) sword olon (cda_def* lda, OraText* uid, sword uidl, OraText* pswd, sword pswdl, sword audit); 628 629 629 630 /** 630 * 631 * 631 632 * 632 633 * Params: … … 636 637 * 637 638 * Returns: 638 * 639 * 639 640 */ 640 641 deprecated extern (C) sword osql3 (cda_def* cda, OraText* sqlstm, sword sqllen); 641 642 642 643 /** 643 * 644 * 644 645 * 645 646 * Params: … … 655 656 * 656 657 * Returns: 657 * 658 * 658 659 */ 659 660 deprecated extern (C) sword odsc (cda_def* cursor, sword pos, sb2* dbsize, sb2* fsize, sb2* rcode, sb2* dtype, sb1* buf, sb2* bufl, sb2* dsize); 661 662 } trunk/bbconv/dbi/oracle/imp/ocidef.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ … … 17 16 deprecated: 18 17 19 /* 18 /* 20 19 #include <upidef.h> 21 20 #include <riddef.h> No longer necessary??? 22 21 */ 22 23 version (dbi_oracle) { 24 23 25 private import dbi.oracle.imp.ociapr, dbi.oracle.imp.oratypes; 24 26 … … 161 163 162 164 const uint OTYDEV = 10; /// Old DEFINE VIEW = create view. 163 165 164 166 const uint OCLFPA = 2; /// Parse - OSQL. 165 167 const uint OCLFEX = 4; /// Execute - OEXEC. … … 277 279 extern (C) sword ocierr (ldadef* lda, b2 rcode, oratext* buffer, sword bufl); 278 280 extern (C) sword ocidhe (b2 rcode, oratext* buffer); 279 /* 281 /* 280 282 ** Move the text explanation for an ORACLE error to a user defined buffer 281 ** ocierr - will return the message associated with the hstdef stored 283 ** ocierr - will return the message associated with the hstdef stored 282 284 ** in the lda. 283 285 ** ocidhe - will return the message associated with the default host. … … 290 292 291 293 extern (C) sword ociclo (csrdef* cursor); 292 /* 294 /* 293 295 ** open or close a cursor. 294 296 ** cursor - pointer to csrdef … … 311 313 ** OERRCD in the hst. This is because ocibrk may be called 312 314 ** asynchronously. Callers must test the return code. 313 ** lda - pointer to a ldadef 315 ** lda - pointer to a ldadef 314 316 */ 315 317 … … 317 319 /* 318 320 ** cancel the operation on the cursor, no additional OFETCH calls 319 ** will be issued for the existing cursor without an intervening 321 ** will be issued for the existing cursor without an intervening 320 322 ** OEXEC call. 321 323 ** cursor - pointer to csrdef … … 323 325 324 326 extern (C) sword ocisfe (csrdef* cursor, sword erropt, sword waitopt); 325 /* 327 /* 326 328 ** ocisfe - user interface set error options 327 329 ** set the error and cursor options. … … 340 342 ** ocirol - roll back the current transaction 341 343 */ 342 344 343 345 extern (C) sword ocicon (ldadef* lda); 344 346 extern (C) sword ocicof (ldadef* lda); … … 446 448 ** 447 449 ** This routine is used to obtain information about the calling 448 ** arguments of a stored procedure. The client provides the 450 ** arguments of a stored procedure. The client provides the 449 451 ** name of the procedure using "object_name" and "database_name" 450 ** (database name is optional). The client also supplies the 451 ** arrays for OCIDPR to return the values and indicates the 452 ** (database name is optional). The client also supplies the 453 ** arrays for OCIDPR to return the values and indicates the 452 454 ** length of array via the "total_elements" parameter. Upon return 453 ** the number of elements used in the arrays is returned in the 454 ** "total_elements" parameter. If the array is too small then 455 ** an error will be returned and the contents of the return arrays 455 ** the number of elements used in the arrays is returned in the 456 ** "total_elements" parameter. If the array is too small then 457 ** an error will be returned and the contents of the return arrays 456 458 ** are invalid. 457 459 ** … … 463 465 ** object_name - SCOTT.ACCOUNT_UPDATE@BOSTON 464 466 ** total_elements - 100 465 ** 467 ** 466 468 ** 467 469 ** ACCOUNT_UPDATE is an overloaded function with specification : … … 472 474 ** table person (person_id number(4), person_nm varchar2(10)) 473 475 ** 474 ** function ACCOUNT_UPDATE (account number, 476 ** function ACCOUNT_UPDATE (account number, 475 477 ** person person%rowtype, amounts number_table, 476 478 ** trans_date date) return accounts.balance%type; 477 479 ** 478 ** function ACCOUNT_UPDATE (account number, 480 ** function ACCOUNT_UPDATE (account number, 479 481 ** person person%rowtype, amounts number_table, 480 482 ** trans_no number) return accounts.balance%type; … … 507 509 ** 508 510 ** ldadef - pointer to ldadef 509 ** object_name - object name, synonyms are also accepted and will 511 ** object_name - object name, synonyms are also accepted and will 510 512 ** be translate, currently only procedure and function 511 513 ** names are accepted, also NLS names are accepted. 512 ** Currently, the accepted format of a name is 514 ** Currently, the accepted format of a name is 513 515 ** [[part1.]part2.]part3[@dblink] (required) 514 516 ** object_length - object name length (required) … … 518 520 ** reserved2_length - reserved for future use 519 521 ** overload - array indicating overloaded procedure # (returned) 520 ** position - array of argument positions, position 0 is a 522 ** position - array of argument positions, position 0 is a 521 523 ** function return argument (returned) 522 524 ** level - array of argument type levels, used to describe 523 525 ** sub-datatypes of data structures like records 524 526 ** and arrays (returned) 525 ** argument_name - array of argument names, only returns first 527 ** argument_name - array of argument names, only returns first 526 528 ** 30 characters of argument names, note storage 527 529 ** for 30 characters is allocated by client (returned) … … 575 577 extern (C) sword ociexn (csrdef* cursor, sword iters, sword roff); 576 578 extern (C) sword ociefn (csrdef* cursor, ub4 nrows, sword can, sword exact); 577 /* 579 /* 578 580 ** ociexe - execute a cursor 579 581 ** ociexn - execute a cursosr N times 580 582 ** cursor - pointer to a csrdef 581 583 ** iters - number of times to execute cursor 582 ** roff - offset within the bind variable array at which to begin 584 ** roff - offset within the bind variable array at which to begin 583 585 ** operations. 584 586 */ … … 587 589 extern (C) sword ocifen (csrdef* cursor, sword nrows); 588 590 /* ocifet - fetch the next row 589 ** ocifen - fetch n rows 591 ** ocifen - fetch n rows 590 592 ** cursor - pointer to csrdef 591 593 ** nrows - number of rows to be fetched … … 602 604 ** csrdef->csrrpc is set to the rows processed count 603 605 ** csrdef->csrpeo is set to error postion 604 ** 606 ** 605 607 ** cursor - pointer to csrdef 606 608 */ … … 608 610 609 611 extern (C) sword ocir32 (csrdef* cursor, sword retcode); 610 /* 611 ** Convert selected version 3 return codes to the equivalent version 2 612 /* 613 ** Convert selected version 3 return codes to the equivalent version 2 612 614 ** code. 613 615 ** … … 620 622 /* 621 623 ** Convert call-by-ref to call-by-value: 622 ** takes an arg list and a mask address, determines which args need 624 ** takes an arg list and a mask address, determines which args need 623 625 ** conversion to a value, and creates a new list begging at the address 624 626 ** of newlst. … … 631 633 extern (C) eword ocistf (eword typ, eword bufl, eword rdig, oratext* fmt, csrdef* cursor, sword* err); 632 634 /* Convert a packed decimal buffer length (bytes) and scale to a format 633 ** string of the form mm.+/-nn, where mm is the number of packed 634 ** decimal digits, and nn is the scaling factor. A positive scale name 635 ** nn digits to the rights of the decimal; a negative scale means nn zeros 635 ** string of the form mm.+/-nn, where mm is the number of packed 636 ** decimal digits, and nn is the scaling factor. A positive scale name 637 ** nn digits to the rights of the decimal; a negative scale means nn zeros 636 638 ** should be supplied to the left of the decimal. 637 639 ** bufl - length of the packed decimal buffer 638 640 ** rdig - number of fractional digits 639 641 ** fmt - pointer to a string holding the conversion format 640 ** cursor - pointer to csrdef 642 ** cursor - pointer to csrdef 641 643 ** err - pointer to word storing error code 642 */ 644 */ 643 645 644 646 extern (C) sword ocinbs (ldadef* lda); /* set a connection to non-blocking */ … … 650 652 ** hst - pointer to a 256 byte area, must be cleared to zero before call 651 653 ** conn - the database link (if specified @LINK in uid will be ignored) 652 ** connl - length of conn; if -1 strlen(conn) is used 654 ** connl - length of conn; if -1 strlen(conn) is used 653 655 ** uid - user id [USER[/PASSWORD][@LINK]] 654 656 ** uidl - length of uid, if -1 strlen(uid) is used … … 659 661 660 662 /* Note: The following routines are used in Pro*C and have the 661 same interface as their couterpart in OCI. 662 Althought the interface follows for more details please refer 663 same interface as their couterpart in OCI. 664 Althought the interface follows for more details please refer 663 665 to the above routines */ 664 666 extern (C) sword ocipin (ub4 mode); … … 667 669 extern (C) sword ologon (ldadef* lda, b2 areacount); 668 670 669 /* 671 /* 670 672 ** ocisqd - oci delayed parse (Should be used only with deferred upi/oci) 671 673 ** FUNCTION: Call upidpr to delay the parse of the sql statement till the … … 673 675 ** describe time ) 674 676 ** RETURNS: Oracle return code. 675 */ 677 */ 676 678 extern (C) sword ocisq7 (csrdef* cursor, oratext* sqlstm, sb4 sqllen, sword defflg, ub4 sqlt); 677 679 … … 689 691 690 692 extern (C) ub2 ocigft_getFcnType (ub2 oertyp); /* get sql function code */ 693 694 } trunk/bbconv/dbi/oracle/imp/ocidem.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ocidem; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ocidfn; 16 17 version (dbi_oracle) { 18 19 private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oratypes; 18 20 19 21 const uint VARCHAR2_TYPE = 1; /// … … 108 110 cast(text*)"OSETPI" /// 109 111 ]; 112 113 } trunk/bbconv/dbi/oracle/imp/ocidfn.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ocidfn; 15 16 version (dbi_oracle) { 16 17 17 18 private import dbi.oracle.imp.oratypes; … … 165 166 const uint SQLCS_FLEXIBLE = 4; /// For PL/SQL "flexible" parameters. 166 167 const uint SQLCS_LIT_NULL = 5; /// F4/29/2006or typecheck of null and empty_clob() lits. 168 169 } trunk/bbconv/dbi/oracle/imp/ociextp.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ociextp; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.oci; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes; 18 19 19 20 const uint OCIEXTPROC_SUCCESS = 0; /// The external procedure failed. … … 36 37 * 37 38 * Memory thus allocated will be freed by PL/SQL upon return from the 38 * External Procedure. You must not use any kind of 'free' function on 39 * External Procedure. You must not use any kind of 'free' function on 39 40 * memory allocated by OCIExtProcAllocCallMemory. 40 * 41 * 41 42 * Params: 42 43 * with_context = The OCI context. … … 71 72 * following error message string within the standard Oracle error 72 73 * message string. See note for OCIExtProcRaiseExcp 73 * 74 * 74 75 * Params: 75 76 * with_context = The OCI context. … … 87 88 /** 88 89 * Get the OCI environment. 89 * 90 * 90 91 * Params: 91 92 * with_context = The OCI context. … … 102 103 /** 103 104 * Initialize a statement handle. 104 * 105 * 105 106 * Params: 106 107 * with_context = The OCI context. … … 118 119 extern (C) sword ociepish (OCIExtProcContext* with_context, int cursorno, OCISvcCtx** svch, OCIStmt** stmthp, OCIError** errh); 119 120 alias ociepish OCIInitializeStatementHandle; 121 122 } trunk/bbconv/dbi/oracle/imp/ocikpr.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ocikpr; 16 15 16 version (dbi_oracle) { 17 17 18 // This page has been left blank intentionally. Keep it that way! 19 20 } trunk/bbconv/dbi/oracle/imp/ocixmldb.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ocixmldb; 16 15 17 private import dbi.oracle.imp.oratypes; 18 private import dbi.oracle.imp.oci; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes; 19 19 20 20 /** … … 56 56 * 57 57 * Returns: 58 * A pointer to an xmlctx structure, with xdb context, error handler and callbacks 58 * A pointer to an xmlctx structure, with xdb context, error handler and callbacks 59 59 * populated with appropriate values. This is later used for all API calls. null 60 60 * if no database connection is available. … … 69 69 */ 70 70 extern (C) void OCIXmlDbFreeXmlCtx (xmlctx* xctx); 71 72 } trunk/bbconv/dbi/oracle/imp/odci.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.odci; 15 16 version (dbi_oracle) { 16 17 17 18 private import dbi.oracle.imp.oci, dbi.oracle.imp.orl, dbi.oracle.imp.oro, dbi.oracle.imp.ort; … … 587 588 OCIInd num_rows; /// 588 589 } 590 591 } trunk/bbconv/dbi/oracle/imp/oratypes.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.oratypes; 15 16 version (dbi_oracle) { 16 17 17 18 alias ubyte ub1; /// … … 135 136 136 137 alias void function() lgenfp_t; /// 138 139 } trunk/bbconv/dbi/oracle/imp/ori.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project … … 15 15 module dbi.oracle.imp.ori; 16 16 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.oci, dbi.oracle.imp.ort; 17 version (dbi_oracle) { 18 19 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.ort; 18 20 19 21 /** … … 36 38 extern (C) sword OCIObjectNew (OCIEnv* env, OCIError* err, OCISvcCtx* svc, OCITypeCode typecode, OCIType* tdo, dvoid* table, OCIDuration duration, boolean value, dvoid** instance); 37 39 /* 38 typecode (IN) - the typecode of the type of the instance. 39 tdo (IN, optional) - pointer to the type descriptor object. The 40 TDO describes the type of the instance that is to be 41 created. Refer to OCITypeByName() for obtaining a TDO. 40 typecode (IN) - the typecode of the type of the instance. 41 tdo (IN, optional) - pointer to the type descriptor object. The 42 TDO describes the type of the instance that is to be 43 created. Refer to OCITypeByName() for obtaining a TDO. 42 44 The TDO is required for creating a named type (e.g. an 43 45 object or a collection). 44 table (IN, optional) - pointer to a table object which specifies a 46 table (IN, optional) - pointer to a table object which specifies a 45 47 table in the server. This parameter can be set to NULL 46 48 if no table is given. See the description below to find 47 49 out how the table object and the TDO are used together 48 to determine the kind of instances (persistent, 49 transient, value) to be created. Also see 50 to determine the kind of instances (persistent, 51 transient, value) to be created. Also see 50 52 OCIObjectPinTable() for retrieving a table object. 51 53 duration (IN) - this is an overloaded parameter. The use of this 52 parameter is based on the kind of the instance that is 54 parameter is based on the kind of the instance that is 53 55 to be created. 54 56 a) persistent object. This parameter specifies the 55 57 pin duration. 56 b) transient object. This parameter specififes the 57 allocation duration and pin duration. 58 b) transient object. This parameter specififes the 59 allocation duration and pin duration. 58 60 c) value. This parameter specifies the allocation 59 61 duration. 60 62 61 63 DESCRIPTION: 62 This function creates a new instance of the type specified by the 63 typecode or the TDO. Based on the parameters 'typecode' (or 'tdo'), 64 This function creates a new instance of the type specified by the 65 typecode or the TDO. Based on the parameters 'typecode' (or 'tdo'), 64 66 'value' and 'table', different kinds of instances can be created: 65 67 66 68 The parameter 'table' is not NULL? 67 69 … … 78 80 79 81 This function allocates the top level memory chunk of an OTS instance. 80 The attributes in the top level memory are initialized (e.g. an 81 attribute of varchar2 is initialized to a vstring of 0 length). 82 83 If the instance is an object, the object is marked existed but is 84 atomically null. 82 The attributes in the top level memory are initialized (e.g. an 83 attribute of varchar2 is initialized to a vstring of 0 length). 84 85 If the instance is an object, the object is marked existed but is 86 atomically null. 85 87 86 88 FOR PERSISTENT OBJECTS: 87 The object is marked dirty and existed. The allocation duration for 88 the object is session. The object is pinned and the pin duration is 89 The object is marked dirty and existed. The allocation duration for 90 the object is session. The object is pinned and the pin duration is 89 91 specified by the given parameter 'duration'. 90 92 91 93 FOR TRANSIENT OBJECTS: 92 The object is pinned. The allocation duration and the pin duration are 94 The object is pinned. The allocation duration and the pin duration are 93 95 specified by the given parameter 'duration'. 94 96 … … 103 105 env (IN/OUT) - OCI environment handle initialized in object mode 104 106 err (IN/OUT) - error handle. If there is an error, it is 105 recorded in 'err' and this function returns 106 OCI_ERROR. The error recorded in 'err' can be 107 recorded in 'err' and this function returns 108 OCI_ERROR. The error recorded in 'err' can be 107 109 retrieved by calling OCIErrorGet(). 108 object_ref (IN) - the reference to the object. 109 corhdl (IN) - handle for complex object retrieval. 110 object_ref (IN) - the reference to the object. 111 corhdl (IN) - handle for complex object retrieval. 110 112 pin_option (IN) - See description below. 111 113 pin_duration (IN) - The duration of which the object is being accesed 112 114 by a client. The object is implicitly unpinned at 113 the end of the pin duration. 114 If OCI_DURATION_NULL is passed, there is no pin 115 promotion if the object is already loaded into 116 the cache. If the object is not yet loaded, then 117 the pin duration is set to OCI_DURATION_DEFAULT. 115 the end of the pin duration. 116 If OCI_DURATION_NULL is passed, there is no pin 117 promotion if the object is already loaded into 118 the cache. If the object is not yet loaded, then 119 the pin duration is set to OCI_DURATION_DEFAULT. 118 120 lock_option (IN) - lock option (e.g., exclusive). If a lock option 119 121 is specified, the object is locked in the server. 120 See 'oro.h' for description about lock option. 122 See 'oro.h' for description about lock option. 121 123 object (OUT) - the pointer to the pinned object. 122 124 … … 129 131 130 132 1) locate an object given its reference. This is done by the object 131 cache which keeps track of the objects in the object heap. 132 133 2) notify the object cache that an object is being in use. An object 134 can be pinned many times. A pinned object will remain in memory 135 until it is completely unpinned (see OCIObjectUnpin()). 136 137 3) notify the object cache that a persistent object is being in use 138 such that the persistent object cannot be aged out. Since a 139 persistent object can be loaded from the server whenever is needed, 140 the memory utilization can be increased if a completely unpinned 141 persistent object can be freed (aged out), even before the 142 allocation duration is expired. 133 cache which keeps track of the objects in the object heap. 134 135 2) notify the object cache that an object is being in use. An object 136 can be pinned many times. A pinned object will remain in memory 137 until it is completely unpinned (see OCIObjectUnpin()). 138 139 3) notify the object cache that a persistent object is being in use 140 such that the persistent object cannot be aged out. Since a 141 persistent object can be loaded from the server whenever is needed, 142 the memory utilization can be increased if a completely unpinned 143 persistent object can be freed (aged out), even before the 144 allocation duration is expired. 143 145 144 146 Also see OCIObjectUnpin() for more information about unpinning. … … 149 151 will be fetched from the persistent store. The allocation duration of 150 152 the object is session. If the object is already in the cache, it is 151 returned to the client. The object will be locked in the server if a 152 lock option is specified. 153 154 This function will return an error for a non-existent object. 155 156 A pin option is used to specify the copy of the object that is to be 157 retrieved: 158 159 1) If option is OCI_PIN_ANY (pin any), if the object is already 160 in the environment heap, return this object. Otherwise, the object 161 is retrieved from the database. This option is useful when the 162 client knows that he has the exclusive access to the data in a 153 returned to the client. The object will be locked in the server if a 154 lock option is specified. 155 156 This function will return an error for a non-existent object. 157 158 A pin option is used to specify the copy of the object that is to be 159 retrieved: 160 161 1) If option is OCI_PIN_ANY (pin any), if the object is already 162 in the environment heap, return this object. Otherwise, the object 163 is retrieved from the database. This option is useful when the 164 client knows that he has the exclusive access to the data in a 163 165 session. 164 166 165 2) If option is OCI_PIN_LATEST (pin latest), if the object is 166 not cached, it is retrieved from the database. If the object is 167 cached, it is refreshed with the latest version. See 167 2) If option is OCI_PIN_LATEST (pin latest), if the object is 168 not cached, it is retrieved from the database. If the object is 169 cached, it is refreshed with the latest version. See 168 170 OCIObjectRefresh() for more information about refreshing. 169 171 … … 175 177 FOR TRANSIENT OBJECTS: 176 178 177 This function will return an error if the transient object has already 178 been freed. This function does not return an error if an exclusive 179 lock is specified in the lock option. 180 181 RETURNS: 182 if environment handle or error handle is null, return 183 OCI_INVALID_HANDLE. 184 if operation suceeds, return OCI_SUCCESS. 185 if operation fails, return OCI_ERROR. 179 This function will return an error if the transient object has already 180 been freed. This function does not return an error if an exclusive 181 lock is specified in the lock option. 182 183 RETURNS: 184 if environment handle or error handle is null, return 185 OCI_INVALID_HANDLE. 186 if operation suceeds, return OCI_SUCCESS. 187 if operation fails, return OCI_ERROR. 186 188 */ 187 189 … … 189 191 /* 190 192 NAME: OCIObjectUnpin - OCI unpin a referenceable object 191 PARAMETERS:192 env (IN/OUT) - OCI environment handle initialized in object mode193 err (IN/OUT) - error handle. If there is an error, it is194 recorded in 'err' and this function returns OCI_ERROR.195 The error recorded in 'err' can be retrieved by196 calling OCIErrorGet().197 object (IN) - pointer to an object198 REQUIRES:199 - a valid OCI environment handle must be given.200 - The specified object must be pinned.201 DESCRIPTION:202 This function unpins an object. An object is completely unpinned when203 1) the object was unpinned N times after it has been pinned N times204 (by calling OCIObjectPin()).205 2) it is the end of the pin duration206 3) the function OCIObjectPinCountReset() is called207 208 There is a pin count associated with each object which is incremented209 whenever an object is pinned. When the pin count of the object is zero,210 the object is said to be completely unpinned. An unpinned object can211 be freed without error.212 213 FOR PERSISTENT OBJECTS:214 When a persistent object is completely unpinned, it becomes a candidate215 for aging. The memory of an object is freed when it is aged out. Aging216 is used to maximize the utilization of memory. An dirty object cannot217 be aged out unless it is flushed.218 219 FOR TRANSIENT OBJECTS:220 The pin count of the object is decremented. A transient can be freed221 only at the end of its allocation duration or when it is explicitly222 deleted by calling OCIObjectFree().223 224 FOR VALUE:225 This function will return an error for value.226 227 RETURNS:228 if environment handle or error handle is null, return229 OCI_INVALID_HANDLE.230 if operation suceeds, return OCI_SUCCESS.231 if operation fails, return OCI_ERROR.232 */233 234 extern (C) sword OCIObjectPinCountReset (OCIEnv* env, OCIError* err, dvoid* object);235 /*236 NAME: OCIObjectPinCountReset - OCI resets the pin count of a referenceable237 object238 193 PARAMETERS: 239 194 env (IN/OUT) - OCI environment handle initialized in object mode … … 247 202 - The specified object must be pinned. 248 203 DESCRIPTION: 249 This function completely unpins an object. When an object is 250 completely unpinned, it can be freed without error. 204 This function unpins an object. An object is completely unpinned when 205 1) the object was unpinned N times after it has been pinned N times 206 (by calling OCIObjectPin()). 207 2) it is the end of the pin duration 208 3) the function OCIObjectPinCountReset() is called 209 210 There is a pin count associated with each object which is incremented 211 whenever an object is pinned. When the pin count of the object is zero, 212 the object is said to be completely unpinned. An unpinned object can 213 be freed without error. 251 214 252 215 FOR PERSISTENT OBJECTS: 253 216 When a persistent object is completely unpinned, it becomes a candidate 254 217 for aging. The memory of an object is freed when it is aged out. Aging 255 is used to maximize the utilization of memory. An dirty object cannot 218 is used to maximize the utilization of memory. An dirty object cannot 256 219 be aged out unless it is flushed. 257 220 … … 259 222 The pin count of the object is decremented. A transient can be freed 260 223 only at the end of its allocation duration or when it is explicitly 261 freed by calling OCIObjectFree().224 deleted by calling OCIObjectFree(). 262 225 263 226 FOR VALUE: … … 265 228 266 229 RETURNS: 267 if environment handle or error handle is null, return 268 OCI_INVALID_HANDLE. 269 if operation suceeds, return OCI_SUCCESS. 270 if operation fails, return OCI_ERROR. 271 */ 272 273 extern (C) sword OCIObjectLock (OCIEnv* env, OCIError* err, dvoid* object); 274 /* 275 NAME: OCIObjectLock - OCI lock a persistent object 230 if environment handle or error handle is null, return 231 OCI_INVALID_HANDLE. 232 if operation suceeds, return OCI_SUCCESS. 233 if operation fails, return OCI_ERROR. 234 */ 235 236 extern (C) sword OCIObjectPinCountReset (OCIEnv* env, OCIError* err, dvoid* object); 237 /* 238 NAME: OCIObjectPinCountReset - OCI resets the pin count of a referenceable 239 object 276 240 PARAMETERS: 277 241 env (IN/OUT) - OCI environment handle initialized in object mode … … 280 244 The error recorded in 'err' can be retrieved by 281 245 calling OCIErrorGet(). 282 object (IN) - pointer to the persistent object 246 object (IN) - pointer to an object 247 REQUIRES: 248 - a valid OCI environment handle must be given. 249 - The specified object must be pinned. 250 DESCRIPTION: 251 This function completely unpins an object. When an object is 252 completely unpinned, it can be freed without error. 253 254 FOR PERSISTENT OBJECTS: 255 When a persistent object is completely unpinned, it becomes a candidate 256 for aging. The memory of an object is freed when it is aged out. Aging 257 is used to maximize the utilization of memory. An dirty object cannot 258 be aged out unless it is flushed. 259 260 FOR TRANSIENT OBJECTS: 261 The pin count of the object is decremented. A transient can be freed 262 only at the end of its allocation duration or when it is explicitly 263 freed by calling OCIObjectFree(). 264 265 FOR VALUE: 266 This function will return an error for value. 267 268 RETURNS: 269 if environment handle or error handle is null, return 270 OCI_INVALID_HANDLE. 271 if operation suceeds, return OCI_SUCCESS. 272 if operation fails, return OCI_ERROR. 273 */ 274 275 extern (C) sword OCIObjectLock (OCIEnv* env, OCIError* err, dvoid* object); 276 /* 277 NAME: OCIObjectLock - OCI lock a persistent object 278 PARAMETERS: 279 env (IN/OUT) - OCI environment handle initialized in object mode 280 err (IN/OUT) - error handle. If there is an error, it is 281 recorded in 'err' and this function returns OCI_ERROR. 282 The error recorded in 'err' can be retrieved by 283 calling OCIErrorGet(). 284 object (IN) - pointer to the persistent object 283 285 REQUIRES: 284 286 - a valid OCI environment handle must be given. … … 295 297 296 298 RETURNS: 297 if environment handle or error handle is null, return 298 OCI_INVALID_HANDLE. 299 if operation suceeds, return OCI_SUCCESS. 300 if operation fails, return OCI_ERROR. 299 if environment handle or error handle is null, return 300 OCI_INVALID_HANDLE. 301 if operation suceeds, return OCI_SUCCESS. 302 if operation fails, return OCI_ERROR. 301 303 */ 302 304 … … 311 313 The error recorded in 'err' can be retrieved by 312 314 calling OCIErrorGet(). 313 object (IN) - pointer to the persistent object 315 object (IN) - pointer to the persistent object 314 316 REQUIRES: 315 317 - a valid OCI environment handle must be given. … … 327 329 328 330 RETURNS: 329 if environment handle or error handle is null, return 330 OCI_INVALID_HANDLE. 331 if operation suceeds, return OCI_SUCCESS. 332 if operation fails, return OCI_ERROR. 331 if environment handle or error handle is null, return 332 OCI_INVALID_HANDLE. 333 if operation suceeds, return OCI_SUCCESS. 334 if operation fails, return OCI_ERROR. 333 335 */ 334 336 … … 336 338 /* 337 339 NAME: OCIObjectMarkUpdate - OCI marks an object as updated 338 PARAMETERS:339 env (IN/OUT) - OCI environment handle initialized in object mode340 err (IN/OUT) - error handle. If there is an error, it is341 recorded in 'err' and this function returns OCI_ERROR.342 The error recorded in 'err' can be retrieved by343 calling OCIErrorGet().344 object (IN) - pointer to the persistent object345 REQUIRES:346 - a valid OCI environment handle must be given.347 - The specified object must be pinned.348 DESCRIPTION:349 FOR PERSISTENT OBJECTS:350 This function marks the specified persistent object as updated. The351 persistent objects will be written to the server when the object cache352 is flushed. The object is not locked or flushed by this function. It353 is an error to update a deleted object.354 355 After an object is marked updated and flushed, this function must be356 called again to mark the object as updated if it has been dirtied357 after it is being flushed.358 359 FOR TRANSIENT OBJECTS:360 This function marks the specified transient object as updated. The361 transient objects will NOT be written to the server. It is an error362 to update a deleted object.363 364 FOR VALUES:365 It is an no-op for values.366 367 RETURNS:368 if environment handle or error handle is null, return369 OCI_INVALID_HANDLE.370 if operation suceeds, return OCI_SUCCESS.371 if operation fails, return OCI_ERROR.372 */373 374 extern (C) sword OCIObjectUnmark (OCIEnv* env, OCIError* err, dvoid* object);375 /*376 NAME: OCIObjectUnmark - OCI unmarks an object377 340 PARAMETERS: 378 341 env (IN/OUT) - OCI environment handle initialized in object mode … … 386 349 - The specified object must be pinned. 387 350 DESCRIPTION: 351 FOR PERSISTENT OBJECTS: 352 This function marks the specified persistent object as updated. The 353 persistent objects will be written to the server when the object cache 354 is flushed. The object is not locked or flushed by this function. It 355 is an error to update a deleted object. 356 357 After an object is marked updated and flushed, this function must be 358 called again to mark the object as updated if it has been dirtied 359 after it is being flushed. 360 361 FOR TRANSIENT OBJECTS: 362 This function marks the specified transient object as updated. The 363 transient objects will NOT be written to the server. It is an error 364 to update a deleted object. 365 366 FOR VALUES: 367 It is an no-op for values. 368 369 RETURNS: 370 if environment handle or error handle is null, return 371 OCI_INVALID_HANDLE. 372 if operation suceeds, return OCI_SUCCESS. 373 if operation fails, return OCI_ERROR. 374 */ 375 376 extern (C) sword OCIObjectUnmark (OCIEnv* env, OCIError* err, dvoid* object); 377 /* 378 NAME: OCIObjectUnmark - OCI unmarks an object 379 PARAMETERS: 380 env (IN/OUT) - OCI environment handle initialized in object mode 381 err (IN/OUT) - error handle. If there is an error, it is 382 recorded in 'err' and this function returns OCI_ERROR. 383 The error recorded in 'err' can be retrieved by 384 calling OCIErrorGet(). 385 object (IN) - pointer to the persistent object 386 REQUIRES: 387 - a valid OCI environment handle must be given. 388 - The specified object must be pinned. 389 DESCRIPTION: 388 390 FOR PERSISTENT OBJECTS AND TRANSIENT OBJECTS: 389 391 This function unmarks the specified persistent object as dirty. Changes 390 392 that are made to the object will not be written to the server. If the 391 393 object is marked locked, it remains marked locked. The changes that 392 have already made to the object will not be undone implicitly. 393 394 have already made to the object will not be undone implicitly. 395 394 396 FOR VALUES: 395 397 It is an no-op for values. 396 397 RETURNS: 398 if environment handle or error handle is null, return 399 OCI_INVALID_HANDLE. 400 if operation suceeds, return OCI_SUCCESS. 401 if operation fails, return OCI_ERROR. 402 */ 403 404 extern (C) sword OCIObjectUnmarkByRef (OCIEnv* env, OCIError* err, OCIRef* ref );398 399 RETURNS: 400 if environment handle or error handle is null, return 401 OCI_INVALID_HANDLE. 402 if operation suceeds, return OCI_SUCCESS. 403 if operation fails, return OCI_ERROR. 404 */ 405 406 extern (C) sword OCIObjectUnmarkByRef (OCIEnv* env, OCIError* err, OCIRef* reference); 405 407 /* 406 408 NAME: OCIObjectUnmarkByRef - OCI unmarks an object by Ref … … 421 423 object is marked locked, it remains marked locked. The changes that 422 424 have already made to the object will not be undone implicitly. 423 425 424 426 FOR VALUES: 425 427 It is an no-op for values. 426 428 427 429 RETURNS: 428 430 if environment handle or error handle is null, return … … 434 436 extern (C) sword OCIObjectFree (OCIEnv* env, OCIError* err, dvoid* instance, ub2 flags); 435 437 /* 436 NAME: OCIObjectFree - OCI free (and unpin) an standalone instance 438 NAME: OCIObjectFree - OCI free (and unpin) an standalone instance 437 439 PARAMETERS: 438 440 env (IN/OUT) - OCI environment handle initialized in object mode 439 441 err (IN/OUT) - error handle. If there is an error, it is 440 recorded in 'err' and this function returns 441 OCI_ERROR. The error recorded in 'err' can be 442 recorded in 'err' and this function returns 443 OCI_ERROR. The error recorded in 'err' can be 442 444 retrieved by calling OCIErrorGet(). 443 445 instance (IN) - pointer to a standalone instance. … … 445 447 even if it is pinned or dirty. 446 448 If OCI_OBJECT_FREE_NONULL is set, the null 447 structure will not be freed. 449 structure will not be freed. 448 450 REQUIRES: 449 451 - a valid OCI environment handle must be given. … … 455 457 456 458 FOR PERSISTENT OBJECTS: 457 This function will return an error if the client is attempting to free 458 a dirty persistent object that has not been flushed. The client should 459 either flush the persistent object or set the parameter 'flag' to 459 This function will return an error if the client is attempting to free 460 a dirty persistent object that has not been flushed. The client should 461 either flush the persistent object or set the parameter 'flag' to 460 462 OCI_OBJECT_FREE_FORCE. 461 463 462 This function will call OCIObjectUnpin() once to check if the object 463 can be completely unpin. If it succeeds, the rest of the function will 464 proceed to free the object. If it fails, then an error is returned 464 This function will call OCIObjectUnpin() once to check if the object 465 can be completely unpin. If it succeeds, the rest of the function will 466 proceed to free the object. If it fails, then an error is returned 465 467 unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE. 466 467 Freeing a persistent object in memory will not change the persistent 468 state of that object at the server. For example, the object will 468 469 Freeing a persistent object in memory will not change the persistent 470 state of that object at the server. For example, the object will 469 471 remain locked after the object is freed. 470 472 471 473 FOR TRANSIENT OBJECTS: 472 474 473 This function will call OCIObjectUnpin() once to check if the object 474 can be completely unpin. If it succeeds, the rest of the function will 475 proceed to free the object. If it fails, then an error is returned 476 unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE. 475 This function will call OCIObjectUnpin() once to check if the object 476 can be completely unpin. If it succeeds, the rest of the function will 477 proceed to free the object. If it fails, then an error is returned 478 unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE. 477 479 478 480 FOR VALUES: 479 The memory of the object is freed immediately. 480 481 RETURNS: 482 if environment handle or error handle is null, return 483 OCI_INVALID_HANDLE. 484 if operation suceeds, return OCI_SUCCESS. 485 if operation fails, return OCI_ERROR. 481 The memory of the object is freed immediately. 482 483 RETURNS: 484 if environment handle or error handle is null, return 485 OCI_INVALID_HANDLE. 486 if operation suceeds, return OCI_SUCCESS. 487 if operation fails, return OCI_ERROR. 486 488 */ 487 489 … … 493 495 env (IN/OUT) - OCI environment handle initialized in object mode 494 496 err (IN/OUT) - error handle. If there is an error, it is 495 recorded in 'err' and this function returns 496 OCI_ERROR. The error recorded in 'err' can be 497 recorded in 'err' and this function returns 498 OCI_ERROR. The error recorded in 'err' can be 497 499 retrieved by calling OCIErrorGet(). 498 500 object_ref (IN) - ref of the object to be deleted … … 504 506 505 507 FOR PERSISTENT OBJECTS: 506 If the object is not loaded, then a temporary object is created and is 507 marked deleted. Otherwise, the object is marked deleted. 508 If the object is not loaded, then a temporary object is created and is 509 marked deleted. Otherwise, the object is marked deleted. 508 510 509 511 The object is deleted in the server when the object is flushed. … … 514 516 515 517 RETURNS: 516 if environment handle or error handle is null, return 517 OCI_INVALID_HANDLE. 518 if operation suceeds, return OCI_SUCCESS. 519 if operation fails, return OCI_ERROR. 518 if environment handle or error handle is null, return 519 OCI_INVALID_HANDLE. 520 if operation suceeds, return OCI_SUCCESS. 521 if operation fails, return OCI_ERROR. 520 522 */ 521 523 522 524 extern (C) sword OCIObjectMarkDelete (OCIEnv* env, OCIError* err, dvoid* instance); 523 525 /* 524 NAME: OCIObjectMarkDelete - OCI "delete" an instance given a Pointer 526 NAME: OCIObjectMarkDelete - OCI "delete" an instance given a Pointer 525 527 PARAMETERS: 526 528 env (IN/OUT) - OCI environment handle initialized in object mode 527 529 err (IN/OUT) - error handle. If there is an error, it is 528 recorded in 'err' and this function returns 529 OCI_ERROR. The error recorded in 'err' can be 530 recorded in 'err' and this function returns 531 OCI_ERROR. The error recorded in 'err' can be 530 532 retrieved by calling OCIErrorGet(). 531 instance (IN) - pointer to the instance 533 instance (IN) - pointer to the instance 532 534 REQUIRES: 533 535 - a valid OCI environment handle must be given. … … 543 545 The object is marked deleted. The memory of the object is not freed. 544 546 545 FOR VALUES: 546 This function frees a value immediately. 547 548 RETURNS: 549 if environment handle or error handle is null, return 550 OCI_INVALID_HANDLE. 551 if operation suceeds, return OCI_SUCCESS. 552 if operation fails, return OCI_ERROR. 547 FOR VALUES: 548 This function frees a value immediately. 549 550 RETURNS: 551 if environment handle or error handle is null, return 552 OCI_INVALID_HANDLE. 553 if operation suceeds, return OCI_SUCCESS. 554 if operation fails, return OCI_ERROR. 553 555 */ 554 556 … … 559 561 env (IN/OUT) - OCI environment handle initialized in object mode 560 562 err (IN/OUT) - error handle. If there is an error, it is 561 recorded in 'err' and this function returns 562 OCI_ERROR. The error recorded in 'err' can be 563 recorded in 'err' and this function returns 564 OCI_ERROR. The error recorded in 'err' can be 563 565 retrieved by calling OCIErrorGet(). 564 object (IN) - pointer to the persistent object 566 object (IN) - pointer to the persistent object 565 567 REQUIRES: 566 568 - a valid OCI environment handle must be given. … … 571 573 572 574 When the object is written to the server, triggers may be fired. 573 Objects can be modified by the triggers at the server. To keep the 575 Objects can be modified by the triggers at the server. To keep the 574 576 objects in the object cache being coherent with the database, the 575 clients can free or refresh the objects in the cache. 577 clients can free or refresh the objects in the cache. 576 578 577 579 This function will return an error for transient objects and values. 578 579 RETURNS: 580 if environment handle or error handle is null, return 581 OCI_INVALID_HANDLE. 582 if operation suceeds, return OCI_SUCCESS. 583 if operation fails, return OCI_ERROR. 580 581 RETURNS: 582 if environment handle or error handle is null, return 583 OCI_INVALID_HANDLE. 584 if operation suceeds, return OCI_SUCCESS. 585 if operation fails, return OCI_ERROR. 584 586 */ 585 587 … … 590 592 env (IN/OUT) - OCI environment handle initialized in object mode 591 593 err (IN/OUT) - error handle. If there is an error, it is 592 recorded in 'err' and this function returns 593 OCI_ERROR. The error recorded in 'err' can be 594 recorded in 'err' and this function returns 595 OCI_ERROR. The error recorded in 'err' can be 594 596 retrieved by calling OCIErrorGet(). 595 object (IN) - pointer to the persistent object 597 object (IN) - pointer to the persistent object 596 598 REQUIRES: 597 599 - a valid OCI environment handle must be given. … … 599 601 DESCRIPTION: 600 602 This function refreshes an unmarked object with data retrieved from the 601 latest snapshot in the server. An object should be refreshed when the 602 objects in the cache are inconsistent with the objects at 603 latest snapshot in the server. An object should be refreshed when the 604 objects in the cache are inconsistent with the objects at 603 605 the server: 604 606 1) When an object is flushed to the server, triggers can be fired to 605 modify more objects in the server. The same objects (modified by 607 modify more objects in the server. The same objects (modified by 606 608 the triggers) in the object cache become obsolete. 607 609 2) When the user issues a SQL or executes a PL/SQL procedure to modify … … 610 612 611 613 The object that is refreshed will be 'replaced-in-place'. When an 612 object is 'replaced-in-place', the top level memory of the object will 613 be reused so that new data can be loaded into the same memory address. 614 object is 'replaced-in-place', the top level memory of the object will 615 be reused so that new data can be loaded into the same memory address. 614 616 The top level memory of the null structre is also reused. Unlike the 615 617 top level memory chunk, the secondary memory chunks may be resized and 616 reallocated. The client should be careful when holding onto a pointer 617 to the secondary memory chunk (e.g. assigning the address of a 618 secondary memory to a local variable), since this pointer can become 618 reallocated. The client should be careful when holding onto a pointer 619 to the secondary memory chunk (e.g. assigning the address of a 620 secondary memory to a local variable), since this pointer can become 619 621 invalid after the object is refreshed. 620 622 621 The object state will be modified as followed after being refreshed: 623 The object state will be modified as followed after being refreshed: 622 624 - existent : set to appropriate value 623 - pinned : unchanged 624 - allocation duration : unchanged 625 - pin duration : unchanged 626 625 - pinned : unchanged 626 - allocation duration : unchanged 627 - pin duration : unchanged 628 627 629 This function is an no-op for transient objects or values. 628 630 629 631 RETURNS: 630 if environment handle or error handle is null, return 631 OCI_INVALID_HANDLE. 632 if operation suceeds, return OCI_SUCCESS. 633 if operation fails, return OCI_ERROR. 632 if environment handle or error handle is null, return 633 OCI_INVALID_HANDLE. 634 if operation suceeds, return OCI_SUCCESS. 635 if operation fails, return OCI_ERROR. 634 636 */ 635 637 … … 640 642 env (IN/OUT) - OCI environment handle initialized in object mode 641 643 err (IN/OUT) - error handle. If there is an error, it is 642 recorded in 'err' and this function returns 643 OCI_ERROR. The error recorded in 'err' can be 644 recorded in 'err' and this function returns 645 OCI_ERROR. The error recorded in 'err' can be 644 646 retrieved by calling OCIErrorGet(). 645 647 svc (IN) - OCI service context handle 646 source (IN) - pointer to the source instance 648 source (IN) - pointer to the source instance 647 649 null_source (IN) - pointer to the null structure of the source 648 650 target (IN) - pointer to the target instance 649 null_target (IN) - pointer to the null structure of the target 651 null_target (IN) - pointer to the null structure of the target 650 652 tdo (IN) - the TDO for both source and target 651 653 duration (IN) - allocation duration of the target memory … … 653 655 OROOCOSFN - Set Reference to Null. All references 654 656 in the source will not be copied to the target. The 655 references in the target are set to null. 657 references in the target are set to null. 656 658 REQUIRES: 657 659 - a valid OCI environment handle must be given. … … 664 666 DESCRIPTION: 665 667 This function copies the contents of the 'source' instance to the 666 'target' instance. This function performs a deep-copy such that the 668 'target' instance. This function performs a deep-copy such that the 667 669 data that is copied/duplicated include: 668 670 a) all the top level attributes (see the exceptions below) … … 671 673 c) the null structure of the instance 672 674 673 Memory is allocated with the specified allocation duration. 674 675 Certain data items are not copied: 675 Memory is allocated with the specified allocation duration. 676 677 Certain data items are not copied: 676 678 a) If the option OCI_OBJECTCOPY_NOREF is specified, then all references 677 679 in the source are not copied. Instead, the references in the target … … 680 682 681 683 RETURNS: 682 if environment handle or error handle is null, return 683 OCI_INVALID_HANDLE. 684 if operation suceeds, return OCI_SUCCESS. 685 if operation fails, return OCI_ERROR. 684 if environment handle or error handle is null, return 685 OCI_INVALID_HANDLE. 686 if operation suceeds, return OCI_SUCCESS. 687 if operation fails, return OCI_ERROR. 686 688 */ 687 689 … … 692 694 env (IN/OUT) - OCI environment handle initialized in object mode 693 695 err (IN/OUT) - error handle. If there is an error, it is 694 recorded in 'err' and this function returns 695 OCI_ERROR. The error recorded in 'err' can be 696 recorded in 'err' and this function returns 697 OCI_ERROR. The error recorded in 'err' can be 696 698 retrieved by calling OCIErrorGet(). 697 instance (IN) - pointer to an standalone instance 698 type_ref (OUT) - reference to the type of the object. The reference 699 instance (IN) - pointer to an standalone instance 700 type_ref (OUT) - reference to the type of the object. The reference 699 701 must already be allocated. 700 702 REQUIRES: … … 704 706 - The reference must already be allocated. 705 707 DESCRIPTION: 706 This function returns a reference to the TDO of a standalone instance. 707 RETURNS: 708 if environment handle or error handle is null, return 709 OCI_INVALID_HANDLE. 710 if operation suceeds, return OCI_SUCCESS. 711 if operation fails, return OCI_ERROR. 708 This function returns a reference to the TDO of a standalone instance. 709 RETURNS: 710 if environment handle or error handle is null, return 711 OCI_INVALID_HANDLE. 712 if operation suceeds, return OCI_SUCCESS. 713 if operation fails, return OCI_ERROR. 712 714 */ 713 715 714 716 extern (C) sword OCIObjectGetObjectRef (OCIEnv* env, OCIError* err, dvoid* object, OCIRef* object_ref); 715 717 /* 716 NAME: OCIObjectGetObjectRef - OCI get the object reference of an 718 NAME: OCIObjectGetObjectRef - OCI get the object reference of an 717 719 referenceable object 718 720 PARAMETERS: 719 721 env (IN/OUT) - OCI environment handle initialized in object mode 720 722 err (IN/OUT) - error handle. If there is an error, it is 721 recorded in 'err' and this function returns 722 OCI_ERROR. The error recorded in 'err' can be 723 recorded in 'err' and this function returns 724 OCI_ERROR. The error recorded in 'err' can be 723 725 retrieved by calling OCIErrorGet(). 724 726 object (IN) - pointer to a persistent object 725 object_ref (OUT) - reference of the given object. The reference must 727 object_ref (OUT) - reference of the given object. The reference must 726 728 already be allocated. 727 729 REQUIRES: … … 730 732 - The reference must already be allocated. 731 733 DESCRIPTION: 732 This function returns a reference to the given object. It returns an 733 error for values. 734 RETURNS: 735 if environment handle or error handle is null, return 736 OCI_INVALID_HANDLE. 737 if operation suceeds, return OCI_SUCCESS. 738 if operation fails, return OCI_ERROR. 734 This function returns a reference to the given object. It returns an 735 error for values. 736 RETURNS: 737 if environment handle or error handle is null, return 738 OCI_INVALID_HANDLE. 739 if operation suceeds, return OCI_SUCCESS. 740 if operation fails, return OCI_ERROR. 739 741 */ 740 742 741 743 extern (C) sword OCIObjectMakeObjectRef (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* table, dvoid** values, ub4 array_len, OCIRef* object_ref); 742 744 /* 743 NAME: OCIObjectMakeObjectRef - OCI Create an object reference to a 745 NAME: OCIObjectMakeObjectRef - OCI Create an object reference to a 744 746 referenceable object. 745 747 PARAMETERS: 746 748 env (IN/OUT) - OCI environment handle initialized in object mode 747 749 err (IN/OUT) - error handle. If there is an error, it is 748 recorded in 'err' and this function returns 749 OCI_ERROR. The error recorded in 'err' can be 750 recorded in 'err' and this function returns 751 OCI_ERROR. The error recorded in 'err' can be 750 752 retrieved by calling OCIErrorGet(). 751 753 svc (IN) - the service context … … 753 755 attrlist (IN) - A list of values (OCI type values) from which 754 756 the ref is to be created. 755 attrcnt (IN) - The length of the attrlist array. 756 object_ref (OUT) - reference of the given object. The reference must 757 already be allocated. 757 attrcnt (IN) - The length of the attrlist array. 758 object_ref (OUT) - reference of the given object. The reference must 759 already be allocated. 758 760 REQUIRES: 759 761 - a valid OCI environment handle must be given. … … 761 763 - The reference must already be allocated. 762 764 DESCRIPTION: 763 This function creates a reference given the values that make up the 764 reference and also a pointer to the table object. 765 This function creates a reference given the values that make up the 766 reference and also a pointer to the table object. 765 767 Based on the table's OID property, whether it is a pk based OID or 766 768 a system generated OID, the function creates a sys-generated REF or … … 770 772 In case of PK refs pass in the OCI equivalent for numbers, chars etc.. 771 773 RETURNS: 772 if environment handle or error handle is null, return 773 OCI_INVALID_HANDLE. 774 if operation suceeds, return OCI_SUCCESS. 775 if operation fails, return OCI_ERROR. 774 if environment handle or error handle is null, return 775 OCI_INVALID_HANDLE. 776 if operation suceeds, return OCI_SUCCESS. 777 if operation fails, return OCI_ERROR. 776 778 */ 777 779 778 780 extern (C) sword OCIObjectGetPrimaryKeyTypeRef (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* table, OCIRef* type_ref ); 779 781 /* 780 NAME: OCIObjectGetPrimaryKeyTypeRef - OCI get the REF to the pk OID type 782 NAME: OCIObjectGetPrimaryKeyTypeRef - OCI get the REF to the pk OID type 781 783 PARAMETERS: 782 784 env (IN/OUT) - OCI environment handle initialized in object mode 783 785 err (IN/OUT) - error handle. If there is an error, it is 784 recorded in 'err' and this function returns 785 OCI_ERROR. The error recorded in 'err' can be 786 recorded in 'err' and this function returns 787 OCI_ERROR. The error recorded in 'err' can be 786 788 retrieved by calling OCIErrorGet(). 787 svc (IN) - the service context 789 svc (IN) - the service context 788 790 table (IN) - pointer to the table object 789 type_ref (OUT) - reference of the pk type. The reference must 791 type_ref (OUT) - reference of the pk type. The reference must 790 792 already be allocated. 791 793 REQUIRES: … … 794 796 - The reference must already be allocated. 795 797 DESCRIPTION: 796 This function returns a reference to the pk type. It returns an 798 This function returns a reference to the pk type. It returns an 797 799 error for values. If the table is not a Pk oid table/view, then 798 800 it returns error. 799 801 RETURNS: 800 if environment handle or error handle is null, return 801 OCI_INVALID_HANDLE. 802 if operation suceeds, return OCI_SUCCESS. 803 if operation fails, return OCI_ERROR. 802 if environment handle or error handle is null, return 803 OCI_INVALID_HANDLE. 804 if operation suceeds, return OCI_SUCCESS. 805 if operation fails, return OCI_ERROR. 804 806 */ 805 807 806 808 extern (C) sword OCIObjectGetInd (OCIEnv* env, OCIError* err, dvoid* instance, dvoid** null_struct); 807 809 /* 808 NAME: OCIObjectGetInd - OCI get the null structure of a standalone object 810 NAME: OCIObjectGetInd - OCI get the null structure of a standalone object 809 811 PARAMETERS: 810 812 env (IN/OUT) - OCI environment handle initialized in object mode 811 813 err (IN/OUT) - error handle. If there is an error, it is 812 recorded in 'err' and this function returns 813 OCI_ERROR. The error recorded in 'err' can be 814 recorded in 'err' and this function returns 815 OCI_ERROR. The error recorded in 'err' can be 814 816 retrieved by calling OCIErrorGet(). 815 instance (IN) - pointer to the instance 816 null_struct (OUT) - null structure 817 instance (IN) - pointer to the instance 818 null_struct (OUT) - null structure 817 819 REQUIRES: 818 820 - a valid OCI environment handle must be given. … … 822 824 This function returns the null structure of an instance. This function 823 825 will allocate the top level memory of the null structure if it is not 824 already allocated. If an null structure cannot be allocated for the 825 instance, then an error is returned. This function only works for 826 ADT or row type instance. 827 RETURNS: 828 if environment handle or error handle is null, return 829 OCI_INVALID_HANDLE. 830 if operation suceeds, return OCI_SUCCESS. 831 if operation fails, return OCI_ERROR. 832 */ 833 834 extern (C) sword OCIObjectExists (OCIEnv* env, OCIError* err, dvoid* ins, boolean* exist); 835 /* 836 NAME: OCIObjectExist - OCI checks if the object exists 826 already allocated. If an null structure cannot be allocated for the 827 instance, then an error is returned. This function only works for 828 ADT or row type instance. 829 RETURNS: 830 if environment handle or error handle is null, return 831 OCI_INVALID_HANDLE. 832 if operation suceeds, return OCI_SUCCESS. 833 if operation fails, return OCI_ERROR. 834 */ 835 836 extern (C) sword OCIObjectExists (OCIEnv* env, OCIError* err, dvoid* ins, boolean* exist); 837 /* 838 NAME: OCIObjectExist - OCI checks if the object exists 837 839 PARAMETERS: 838 840 env (IN/OUT) - OCI environment handle initialized in object mode 839 841 err (IN/OUT) - error handle. If there is an error, it is 840 recorded in 'err' and this function returns 841 OCI_ERROR. The error recorded in 'err' can be 842 recorded in 'err' and this function returns 843 OCI_ERROR. The error recorded in 'err' can be 842 844 retrieved by calling OCIErrorGet(). 843 ins (IN) - pointer to an instance 845 ins (IN) - pointer to an instance 844 846 exist (OUT) - return TRUE if the object exists 845 847 REQUIRES: … … 851 853 is a value, this function always returns TRUE. 852 854 RETURNS: 853 if environment handle or error handle is null, return 854 OCI_INVALID_HANDLE. 855 if operation suceeds, return OCI_SUCCESS. 856 if operation fails, return OCI_ERROR. 855 if environment handle or error handle is null, return 856 OCI_INVALID_HANDLE. 857 if operation suceeds, return OCI_SUCCESS. 858 if operation fails, return OCI_ERROR. 857 859 */ 858 860 … … 871 873 copied 872 874 size (IN/OUT) - on input specifies the size of the property buffer 873 passed by caller, on output will contain the 875 passed by caller, on output will contain the 874 876 size in bytes of the property returned. 875 This parameter is required for string type 877 This parameter is required for string type 876 878 properties only (e.g OCI_OBJECTPROP_SCHEMA, 877 879 OCI_OBJECTPROP_TABLE). For non-string … … 882 884 The desired property is identified by 'propertyId'. The property 883 885 value is copied into 'property' and for string typed properties 884 the string size is returned via 'size'. 885 886 the string size is returned via 'size'. 887 886 888 Objects are classified as persistent, transient and value 887 889 depending upon the lifetime and referenceability of the object. 888 890 Some of the properties are applicable only to persistent 889 objects and some others only apply to persistent and 890 transient objects. An error is returned if the user tries to 891 get a property which in not applicable to the given object. 891 objects and some others only apply to persistent and 892 transient objects. An error is returned if the user tries to 893 get a property which in not applicable to the given object. 892 894 To avoid such an error, the user should first check whether 893 the object is persistent or transient or value 895 the object is persistent or transient or value 894 896 (OCI_OBJECTPROP_LIFETIME property) and then appropriately 895 897 query for other properties. 896 898 897 The different property ids and the corresponding type of 899 The different property ids and the corresponding type of 898 900 'property' argument is given below. 899 901 900 OCI_OBJECTPROP_LIFETIME 902 OCI_OBJECTPROP_LIFETIME 901 903 This identifies whether the given object is a persistent 902 object (OCI_OBJECT_PERSISTENT) or a 904 object (OCI_OBJECT_PERSISTENT) or a 903 905 transient object (OCI_OBJECT_TRANSIENT) or a 904 906 value instance (OCI_OBJECT_VALUE). 905 'property' argument must be a pointer to a variable of 907 'property' argument must be a pointer to a variable of 906 908 type OCIObjectLifetime. 907 909 908 910 OCI_OBJECTPROP_SCHEMA 909 This returns the schema name of the table in which the 910 object exists. An error is returned if the given object 911 points to a transient instance or a value. If the input 912 buffer is not big enough to hold the schema name an error 913 is returned, the error message will communicate the 914 required size. Upon success, the size of the returned 911 This returns the schema name of the table in which the 912 object exists. An error is returned if the given object 913 points to a transient instance or a value. If the input 914 buffer is not big enough to hold the schema name an error 915 is returned, the error message will communicate the 916 required size. Upon success, the size of the returned 915 917 schema name in bytes is returned via 'size'. 916 918 'property' argument must be an array of type text and 'size' … … 918 920 919 921 OCI_OBJECTPROP_TABLE 920 This returns the table name in which the object exists. An 921 error is returned if the given object points to a 922 transient instance or a value. If the input buffer is not 923 big enough to hold the table name an error is returned, 924 the error message will communicate the required size. Upon 925 success, the size of the returned table name in bytes is 926 returned via 'size'. 'property' argument must be an array 927 of type text and 'size' should be set to size of array in 922 This returns the table name in which the object exists. An 923 error is returned if the given object points to a 924 transient instance or a value. If the input buffer is not 925 big enough to hold the table name an error is returned, 926 the error message will communicate the required size. Upon 927 success, the size of the returned table name in bytes is 928 returned via 'size'. 'property' argument must be an array 929 of type text and 'size' should be set to size of array in 928 930 bytes by the caller. 929 931 930 932 OCI_OBJECTPROP_PIN_DURATION 931 933 This returns the pin duration of the object. 932 An error is returned if the given object points to a value 934 An error is returned if the given object points to a value 933 935 instance. Valid pin durations are: OCI_DURATION_SESSION and 934 936 OCI_DURATION_TRANS. 935 'property' argument must be a pointer to a variable of type 937 'property' argument must be a pointer to a variable of type 936 938 OCIDuration. 937 939 938 940 OCI_OBJECTPROP_ALLOC_DURATION 939 941 This returns the allocation duration of the object. 940 942 Valid allocation durations are: OCI_DURATION_SESSION and 941 943 OCI_DURATION_TRANS. 942 'property' argument must be a pointer to a variable of type 944 'property' argument must be a pointer to a variable of type 943 945 OCIDuration. 944 946 945 947 OCI_OBJECTPROP_LOCK 946 This returns the lock status of the 948 This returns the lock status of the 947 949 object. The possible lock status is enumerated by OCILockOpt. 948 950 An error is returned if the given object points to a transient 949 951 or value instance. 950 'property' argument must be a pointer to a variable of 952 'property' argument must be a pointer to a variable of 951 953 type OCILockOpt. 952 954 Note, the lock status of an object can also be retrieved by … … 964 966 OCI_OBJECT_IS_DIRTY(flag) 965 967 966 An object is dirty if it is a new object or marked deleted or 968 An object is dirty if it is a new object or marked deleted or 967 969 marked updated. 968 970 An error is returned if the given object points to a transient 969 or value instance. 'property' argument must be of type 971 or value instance. 'property' argument must be of type 970 972 OCIObjectMarkStatus. 971 973 972 974 OCI_OBJECTPROP_VIEW 973 975 This identifies whether the specified object is a view object … … 1035 1037 extern (C) sword OCIObjectPinTable (OCIEnv* env, OCIError* err, OCISvcCtx* svc, oratext* schema_name, ub4 s_n_length, oratext* object_name, ub4 o_n_length, OCIRef* scope_obj_ref, OCIDuration pin_duration, dvoid** object); 1036 1038 /* 1037 NAME: OCIObjectPinTable - OCI get table object 1039 NAME: OCIObjectPinTable - OCI get table object 1038 1040 PARAMETERS: 1039 1041 env (IN/OUT) - OCI environment handle initialized in object mode 1040 1042 err (IN/OUT) - error handle. If there is an error, it is 1041 recorded in 'err' and this function returns 1042 OCI_ERROR. The error recorded in 'err' can be 1043 recorded in 'err' and this function returns 1044 OCI_ERROR. The error recorded in 'err' can be 1043 1045 retrieved by calling OCIErrorGet(). 1044 1046 svc (IN) - OCI service context handle 1045 schema_name (IN, optional) - schema name of the table 1047 schema_name (IN, optional) - schema name of the table 1046 1048 s_n_length (IN, optional) - length of the schema name 1047 object_name (IN) - name of the table 1049 object_name (IN) - name of the table 1048 1050 o_n_length (IN) - length of the table name 1049 1051 scope_obj_ref (IN, optional) - reference of the scoping object 1050 pin_duration (IN) - pin duration. See description in OCIObjectPin(). 1052 pin_duration (IN) - pin duration. See description in OCIObjectPin(). 1051 1053 object (OUT) - the pinned table object 1052 1054 REQUIRES: 1053 1055 - a valid OCI environment handle must be given. 1054 1056 DESCRIPTION: 1055 This function pin a table object with the specified pin duration. 1056 The client can unpin the object by calling OCIObjectUnpin(). See 1057 This function pin a table object with the specified pin duration. 1058 The client can unpin the object by calling OCIObjectUnpin(). See 1057 1059 OCIObjectPin() and OCIObjectUnpin() for more information about pinning 1058 and unpinning. 1059 RETURNS: 1060 if environment handle or error handle is null, return 1061 OCI_INVALID_HANDLE. 1062 if operation suceeds, return OCI_SUCCESS. 1063 if operation fails, return OCI_ERROR. 1060 and unpinning. 1061 RETURNS: 1062 if environment handle or error handle is null, return 1063 OCI_INVALID_HANDLE. 1064 if operation suceeds, return OCI_SUCCESS. 1065 if operation fails, return OCI_ERROR. 1064 1066 */ 1065 1067 1066 1068 extern (C) sword OCIObjectArrayPin (OCIEnv* env, OCIError* err, OCIRef** ref_array, ub4 array_size, OCIComplexObject** cor_array, ub4 cor_array_size, OCIPinOpt pin_option, OCIDuration pin_duration, OCILockOpt lock, dvoid** obj_array, ub4* pos); 1067 1069 /* 1068 NAME: OCIObjectArrayPin - ORIO array pin 1070 NAME: OCIObjectArrayPin - ORIO array pin 1069 1071 PARAMETERS: 1070 1072 env (IN/OUT) - OCI environment handle initialized in object mode 1071 1073 err (IN/OUT) - error handle. If there is an error, it is 1072 recorded in 'err' and this function returns 1073 OCI_ERROR. The error recorded in 'err' can be 1074 recorded in 'err' and this function returns 1075 OCI_ERROR. The error recorded in 'err' can be 1074 1076 retrieved by calling OCIErrorGet(). 1075 ref_array (IN) - array of references to be pinned 1076 array_size (IN) - number of elements in the array of references 1077 ref_array (IN) - array of references to be pinned 1078 array_size (IN) - number of elements in the array of references 1077 1079 pin_option (IN) - pin option. See OCIObjectPin(). 1078 pin_duration (IN) - pin duration. See OCIObjectPin(). 1080 pin_duration (IN) - pin duration. See OCIObjectPin(). 1079 1081 lock_option (IN) - lock option. See OCIObjectPin(). 1080 obj_array (OUT) - If this argument is not NULL, the pinned objects 1081 will be returned in the array. The user must 1082 allocate this array with element type being 1082 obj_array (OUT) - If this argument is not NULL, the pinned objects 1083 will be returned in the array. The user must 1084 allocate this array with element type being 1083 1085 'dvoid *'. The size of this array is identical to 1084 'array'. 1086 'array'. 1085 1087 pos (OUT) - If there is an error, this argument will contain 1086 1088 the element that is causing the error. Note that 1087 1089 this argument is set to 1 for the first element in 1088 the ref_array. 1090 the ref_array. 1089 1091 REQUIRE: 1090 1092 - a valid OCI environment handle must be given. 1091 1093 - If 'obj_array' is not NULL, then it must already be allocated and 1092 the size of 'obj_array' is 'array_size'. 1093 DESCRIPTION: 1094 This function pin an array of references. All the pinned objects are 1095 retrieved from the database in one network roundtrip. If the user 1096 specifies an output array ('obj_array'), then the address of the 1094 the size of 'obj_array' is 'array_size'. 1095 DESCRIPTION: 1096 This function pin an array of references. All the pinned objects are 1097 retrieved from the database in one network roundtrip. If the user 1098 specifies an output array ('obj_array'), then the address of the 1097 1099 pinned objects will be assigned to the elements in the array. See 1098 1100 OCIObjectPin() for more information about pinning. 1099 1101 RETURNS: 1100 if environment handle or error handle is null, return 1101 OCI_INVALID_HANDLE. 1102 if operation suceeds, return OCI_SUCCESS. 1103 if operation fails, return OCI_ERROR. 1104 */ 1105 1106 extern (C) sword OCICacheFlush (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* context, OCIRef* function(dvoid* context, ub1* last) get, OCIRef** ref );1107 /* 1108 NAME: OCICacheFlush - OCI flush persistent objects 1102 if environment handle or error handle is null, return 1103 OCI_INVALID_HANDLE. 1104 if operation suceeds, return OCI_SUCCESS. 1105 if operation fails, return OCI_ERROR. 1106 */ 1107 1108 extern (C) sword OCICacheFlush (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* context, OCIRef* function(dvoid* context, ub1* last) get, OCIRef** reference); 1109 /* 1110 NAME: OCICacheFlush - OCI flush persistent objects 1109 1111 PARAMETERS: 1110 1112 env (IN/OUT) - OCI environment handle initialized in object mode 1111 1113 err (IN/OUT) - error handle. If there is an error, it is 1112 recorded in 'err' and this function returns 1113 OCI_ERROR. The error recorded in 'err' can be 1114 recorded in 'err' and this function returns 1115 OCI_ERROR. The error recorded in 'err' can be 1114 1116 retrieved by calling OCIErrorGet(). 1115 1117 svc (IN) [optional] - OCI service context. If null pointer is 1116 1118 specified, then the dirty objects in all connections 1117 1119 will be flushed. 1118 context (IN) [optional] - specifies an user context that is an 1119 argument to the client callback function 'get'. This 1120 context (IN) [optional] - specifies an user context that is an 1121 argument to the client callback function 'get'. This 1120 1122 parameter is set to NULL if there is no user context. 1121 get (IN) [optional] - an client-defined function which acts an 1122 iterator to retrieve a batch of dirty objects that need 1123 get (IN) [optional] - an client-defined function which acts an 1124 iterator to retrieve a batch of dirty objects that need 1123 1125 to be flushed. If the function is not NULL, this function 1124 will be called to get a reference of a dirty object. 1125 This is repeated until a null reference is returned by 1126 the client function or the parameter 'last' is set to 1127 TRUE. The parameter 'context' is passed to get() 1128 for each invocation of the client function. This 1126 will be called to get a reference of a dirty object. 1127 This is repeated until a null reference is returned by 1128 the client function or the parameter 'last' is set to 1129 TRUE. The parameter 'context' is passed to get() 1130 for each invocation of the client function. This 1129 1131 parameter should be NULL if user callback is not given. 1130 1132 If the object that is returned by the client function is 1131 1133 not a dirtied persistent object, the object is ignored. 1132 1134 All the objects that are returned from the client 1133 function must be from newed or pinned the same service 1134 context, otherwise, an error is signalled. Note that the 1135 function must be from newed or pinned the same service 1136 context, otherwise, an error is signalled. Note that the 1135 1137 returned objects are flushed in the order in which they 1136 1138 are marked dirty. 1137 ref (OUT) [optional] - if there is an error in flushing the 1139 ref (OUT) [optional] - if there is an error in flushing the 1138 1140 objects, (*ref) will point to the object that 1139 is causing the error. If 'ref' is NULL, then the object 1140 will not be returned. If '*ref' is NULL, then a 1141 reference will be allocated and set to point to the 1141 is causing the error. If 'ref' is NULL, then the object 1142 will not be returned. If '*ref' is NULL, then a 1143 reference will be allocated and set to point to the 1142 1144 object. If '*ref' is not NULL, then the reference of 1143 1145 the object is copied into the given space. If the … … 1148 1150 - a valid OCI environment handle must be given. 1149 1151 DESCRIPTION: 1150 This function flushes the modified persistent objects from the 1151 environment heap to the server. The objects are flushed in the order 1152 that they are marked updated or deleted. 1152 This function flushes the modified persistent objects from the 1153 environment heap to the server. The objects are flushed in the order 1154 that they are marked updated or deleted. 1153 1155 1154 1156 See OCIObjectFlush() for more information about flushing. 1155 1157 1156 1158 RETURNS: 1157 if environment handle or error handle is null, return 1158 OCI_INVALID_HANDLE. 1159 if operation suceeds, return OCI_SUCCESS. 1160 if operation fails, return OCI_ERROR. 1161 */ 1162 1163 extern (C) sword OCICacheRefresh (OCIEnv* env, OCIError* err, OCISvcCtx* svc, OCIRefreshOpt option, dvoid* context, OCIRef* function(dvoid* context) get, OCIRef** ref );1164 /* 1165 NAME: OCICacheRefresh - OCI ReFreSh persistent objects 1159 if environment handle or error handle is null, return 1160 OCI_INVALID_HANDLE. 1161 if operation suceeds, return OCI_SUCCESS. 1162 if operation fails, return OCI_ERROR. 1163 */ 1164 1165 extern (C) sword OCICacheRefresh (OCIEnv* env, OCIError* err, OCISvcCtx* svc, OCIRefreshOpt option, dvoid* context, OCIRef* function(dvoid* context) get, OCIRef** reference); 1166 /* 1167 NAME: OCICacheRefresh - OCI ReFreSh persistent objects 1166 1168 PARAMETERS: 1167 1169 env (IN/OUT) - OCI environment handle initialized in object mode 1168 1170 err (IN/OUT) - error handle. If there is an error, it is 1169 recorded in 'err' and this function returns 1170 OCI_ERROR. The error recorded in 'err' can be 1171 recorded in 'err' and this function returns 1172 OCI_ERROR. The error recorded in 'err' can be 1171 1173 retrieved by calling OCIErrorGet(). 1172 1174 svc (IN) [optional] - OCI service context. If null pointer is 1173 1175 specified, then the persistent objects in all connections 1174 will be refreshed. 1176 will be refreshed. 1175 1177 option (IN) [optional] - if OCI_REFRESH_LOAD is specified, all 1176 1178 objects that is loaded within the transaction are 1177 1179 refreshed. If the option is OCI_REFERSH_LOAD and the 1178 1180 parameter 'get' is not NULL, this function will ignore 1179 the parameter. 1180 context (IN) [optional] - specifies an user context that is an 1181 argument to the client callback function 'get'. This 1181 the parameter. 1182 context (IN) [optional] - specifies an user context that is an 1183 argument to the client callback function 'get'. This 1182 1184 parameter is set to NULL if there is no user context. 1183 get (IN) [optional] - an client-defined function which acts an 1185 get (IN) [optional] - an client-defined function which acts an 1184 1186 iterator to retrieve a batch of objects that need to be 1185 1187 refreshed. If the function is not NULL, this function 1186 will be called to get a reference of an object. If 1187 the reference is not NULL, then the object will be 1188 refreshed. These steps are repeated until a null 1188 will be called to get a reference of an object. If 1189 the reference is not NULL, then the object will be 1190 refreshed. These steps are repeated until a null 1189 1191 reference is returned by this function. The parameter 1190 1192 'context' is passed to get() for each invocation of the 1191 client function. This parameter should be NULL if user 1193 client function. This parameter should be NULL if user 1192 1194 callback is not given. 1193 1195 ref (OUT) [optional] - if there is an error in refreshing the … … 1204 1206 - a valid OCI environment handle must be given. 1205 1207 DESCRIPTION: 1206 This function refreshes all pinned persistent objects. All unpinned 1207 persistent objects are freed. See OCIObjectRefresh() for more 1208 This function refreshes all pinned persistent objects. All unpinned 1209 persistent objects are freed. See OCIObjectRefresh() for more 1208 1210 information about refreshing. 1209 1211 RETURNS: 1210 if environment handle or error handle is null, return 1211 OCI_INVALID_HANDLE. 1212 if operation suceeds, return OCI_SUCCESS. 1213 if operation fails, return OCI_ERROR. 1212 if environment handle or error handle is null, return 1213 OCI_INVALID_HANDLE. 1214 if operation suceeds, return OCI_SUCCESS. 1215 if operation fails, return OCI_ERROR. 1214 1216 */ 1215 1217 1216 1218 extern (C) sword OCICacheUnpin (OCIEnv* env, OCIError* err, OCISvcCtx* svc); 1217 1219 /* 1218 NAME: OCICacheUnpin - OCI UNPin objects 1219 PARAMETERS: 1220 env (IN/OUT) - OCI environment handle initialized in object mode 1221 err (IN/OUT) - error handle. If there is an error, it is 1222 recorded in 'err' and this function returns 1223 OCI_ERROR. The error recorded in 'err' can be 1224 retrieved by calling OCIErrorGet(). 1225 svc (IN) [optional] - OCI service context. If null pointer is 1226 specified, then the objects in all connections 1227 will be unpinned. 1228 REQUIRES: 1229 - a valid OCI environment handle must be given. 1230 DESCRIPTION: 1231 If a connection is specified, this function completely unpins the 1232 persistent objects in that connection. Otherwise, all persistent 1233 objects in the heap are completely unpinned. All transient objects in 1234 the heap are also completely unpinned. See OCIObjectUnpin() for more 1235 information about unpinning. 1236 RETURNS: 1237 if environment handle or error handle is null, return 1238 OCI_INVALID_HANDLE. 1239 if operation suceeds, return OCI_SUCCESS. 1240 if operation fails, return OCI_ERROR. 1241 */ 1242 1243 extern (C) sword OCICacheFree (OCIEnv* env, OCIError* err, OCISvcCtx* svc); 1244 /* 1245 NAME: OCICacheFree - OCI FREe instances 1246 PARAMETERS: 1247 env (IN/OUT) - OCI environment handle initialized in object mode 1248 err (IN/OUT) - error handle. If there is an error, it is 1249 recorded in 'err' and this function returns 1250 OCI_ERROR. The error recorded in 'err' can be 1251 retrieved by calling OCIErrorGet(). 1252 svc (IN) [optional] - OCI service context. If null pointer is 1253 specified, then the objects in all connections 1254 will be freed. 1255 REQUIRES: 1256 - a valid OCI environment handle must be given. 1257 DESCRIPTION: 1258 If a connection is specified, this function frees the persistent 1259 objects, transient objects and values allocated for that connection. 1260 Otherwise, all persistent objects, transient objects and values in the 1261 heap are freed. Objects are freed regardless of their pin count. See 1262 OCIObjectFree() for more information about freeing an instance. 1263 RETURNS: 1264 if environment handle or error handle is null, return 1265 OCI_INVALID_HANDLE. 1266 if operation suceeds, return OCI_SUCCESS. 1267 if operation fails, return OCI_ERROR. 1268 */ 1269 1270 extern (C) sword OCICacheUnmark (OCIEnv* env, OCIError* err, OCISvcCtx* svc); 1271 /* 1272 NAME: OCICacheUnmark - OCI Unmark all dirty objects 1220 NAME: OCICacheUnpin - OCI UNPin objects 1273 1221 PARAMETERS: 1274 1222 env (IN/OUT) - OCI environment handle initialized in object mode … … 1279 1227 svc (IN) [optional] - OCI service context. If null pointer is 1280 1228 specified, then the objects in all connections 1281 will be unmarked. 1282 REQUIRES: 1283 - a valid OCI environment handle must be given. 1284 DESCRIPTION: 1285 If a connection is specified, this function unmarks all dirty objects 1229 will be unpinned. 1230 REQUIRES: 1231 - a valid OCI environment handle must be given. 1232 DESCRIPTION: 1233 If a connection is specified, this function completely unpins the 1234 persistent objects in that connection. Otherwise, all persistent 1235 objects in the heap are completely unpinned. All transient objects in 1236 the heap are also completely unpinned. See OCIObjectUnpin() for more 1237 information about unpinning. 1238 RETURNS: 1239 if environment handle or error handle is null, return 1240 OCI_INVALID_HANDLE. 1241 if operation suceeds, return OCI_SUCCESS. 1242 if operation fails, return OCI_ERROR. 1243 */ 1244 1245 extern (C) sword OCICacheFree (OCIEnv* env, OCIError* err, OCISvcCtx* svc); 1246 /* 1247 NAME: OCICacheFree - OCI FREe instances 1248 PARAMETERS: 1249 env (IN/OUT) - OCI environment handle initialized in object mode 1250 err (IN/OUT) - error handle. If there is an error, it is 1251 recorded in 'err' and this function returns 1252 OCI_ERROR. The error recorded in 'err' can be 1253 retrieved by calling OCIErrorGet(). 1254 svc (IN) [optional] - OCI service context. If null pointer is 1255 specified, then the objects in all connections 1256 will be freed. 1257 REQUIRES: 1258 - a valid OCI environment handle must be given. 1259 DESCRIPTION: 1260 If a connection is specified, this function frees the persistent 1261 objects, transient objects and values allocated for that connection. 1262 Otherwise, all persistent objects, transient objects and values in the 1263 heap are freed. Objects are freed regardless of their pin count. See 1264 OCIObjectFree() for more information about freeing an instance. 1265 RETURNS: 1266 if environment handle or error handle is null, return 1267 OCI_INVALID_HANDLE. 1268 if operation suceeds, return OCI_SUCCESS. 1269 if operation fails, return OCI_ERROR. 1270 */ 1271 1272 extern (C) sword OCICacheUnmark (OCIEnv* env, OCIError* err, OCISvcCtx* svc); 1273 /* 1274 NAME: OCICacheUnmark - OCI Unmark all dirty objects 1275 PARAMETERS: 1276 env (IN/OUT) - OCI environment handle initialized in object mode 1277 err (IN/OUT) - error handle. If there is an error, it is 1278 recorded in 'err' and this function returns 1279 OCI_ERROR. The error recorded in 'err' can be 1280 retrieved by calling OCIErrorGet(). 1281 svc (IN) [optional] - OCI service context. If null pointer is 1282 specified, then the objects in all connections 1283 will be unmarked. 1284 REQUIRES: 1285 - a valid OCI environment handle must be given. 1286 DESCRIPTION: 1287 If a connection is specified, this function unmarks all dirty objects 1286 1288 in that connection. Otherwise, all dirty objects in the cache are 1287 1289 unmarked. See OCIObjectUnmark() for more information about unmarking … … 1305 1307 The error recorded in 'err' can be retrieved by calling 1306 1308 OCIErrorGet(). 1307 svc (IN/OUT) - OCI service handle. 1309 svc (IN/OUT) - OCI service handle. 1308 1310 parent (IN) - parent for the duration to be started. 1309 dur (OUT) - newly created user duration 1311 dur (OUT) - newly created user duration 1310 1312 REQUIRES: 1311 1313 - a valid OCI environment handle must be given for non-cartridge … … 1317 1319 active user durations simultaneously. The user durations do not have 1318 1320 to be nested. 1319 1321 1320 1322 The object subsystem predefines 3 durations : 1321 1323 1) session - memory allocated with session duration comes from 1322 the UGA heap (OCI_DURATION_SESSION). A session 1324 the UGA heap (OCI_DURATION_SESSION). A session 1323 1325 duration terminates at the end of the user session. 1324 1326 2) transaction - memory allocated with transaction duration comes … … 1329 1331 heap (OCI_DURATION_CALL). A call duration terminates 1330 1332 at the end of the user call. 1331 1333 1332 1334 Each user duration has a parent duration. A parent duration can be a 1333 1335 predefined duration or another user duration. The relationship between 1334 1336 a user duration and its parent duration (child duration) are: 1335 1337 1336 1338 1) An user duration is nested within the parent duration. When its 1337 1339 parent duration terminates, the user duration will also terminate. … … 1341 1343 duration will also come from the PGA heap. 1342 1344 1343 This function can be used as both part of cartridge services as well 1345 This function can be used as both part of cartridge services as well 1344 1346 as without cartridge services. 1345 The difference in the function in the case of cartridge and 1347 The difference in the function in the case of cartridge and 1346 1348 non-cartridge services is: 1347 1349 In case of cartridge services, as descibed above a new user … … 1349 1351 But when used for non-cartridge purposes, when a pre-defined 1350 1352 duration is passed in as parent, it is mapped to the cache duration 1351 for that connection (which is created if not already present) and 1353 for that connection (which is created if not already present) and 1352 1354 the new user duration will be child of the cache duration. 1353 1355 1354 1356 RETURNS: 1355 if environment handle and service handle is null or if error 1357 if environment handle and service handle is null or if error 1356 1358 handle is null return OCI_INVALID_HANDLE. 1357 1359 if operation suceeds, return OCI_SUCCESS. … … 1370 1372 The error recorded in 'err' can be retrieved by calling 1371 1373 OCIErrorGet(). 1372 svc (IN/OUT) - OCI service handle. 1373 dur (OUT) - a previously created user duration using 1374 svc (IN/OUT) - OCI service handle. 1375 dur (OUT) - a previously created user duration using 1374 1376 OCIDurationBegin() 1375 1377 REQUIRES: … … 1382 1384 this duration is freed. 1383 1385 1384 This function can be used as both part of cartridge services as well 1386 This function can be used as both part of cartridge services as well 1385 1387 as without cartridge services. In both cased, the heap duration 1386 1388 is freed and all the allocated memory for that duration is freed. 1387 The difference in the function in the case of cartridge and 1389 The difference in the function in the case of cartridge and 1388 1390 non-cartridge services is: 1389 1391 In case of non-cartridge services, if the duration is pre- … … 1395 1397 1396 1398 In case of cartridge services, only the heap duration is 1397 freed. All the context entries allocated for that duration are 1399 freed. All the context entries allocated for that duration are 1398 1400 freed from the context hash table.. 1399 1401 1400 1402 RETURNS: 1401 if environment handle and service handle is null or if error 1403 if environment handle and service handle is null or if error 1402 1404 handle is null return OCI_INVALID_HANDLE. 1403 1405 if operation suceeds, return OCI_SUCCESS. … … 1448 1450 * 1449 1451 */ 1450 deprecated extern (C) sword OCICacheFlushRefresh (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* context, OCIRef* function(dvoid* context, ub1* last) get, OCIRef** ref );1452 deprecated extern (C) sword OCICacheFlushRefresh (OCIEnv* env, OCIError* err, OCISvcCtx* svc, dvoid* context, OCIRef* function(dvoid* context, ub1* last) get, OCIRef** reference); 1451 1453 1452 1454 /** … … 1459 1461 */ 1460 1462 deprecated extern (C) sword OCIObjectGetNewOID(OCIEnv* env, OCIError* err, OCISvcCtx* svc, ub1* oid); 1463 1464 } trunk/bbconv/dbi/oracle/imp/orid.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.orid; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.oci, dbi.oracle.imp.ort; 16 17 version (dbi_oracle) { 18 19 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.ort; 20 18 21 /** 19 22 * Set an attribute of an object. … … 62 65 */ 63 66 extern (C) sword OCIObjectGetAttr (OCIEnv* env, OCIError* err, dvoid* instance, dvoid* null_struct, OCIType* tdo, oratext** names, ub4* lengths, ub4 name_count, ub4* indexes, ub4 index_count, OCIInd* attr_null_status, dvoid** attr_null_struct, dvoid** attr_value, OCIType** attr_tdo); 67 68 } trunk/bbconv/dbi/oracle/imp/orl.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.orl; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.ort, dbi.oracle.imp.oci; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.ort; 18 19 19 20 const uint OCI_NUMBER_SIZE = 22; /// The number of bytes in an OCINumber. … … 947 948 * structure. The OCIString structure is opaque to the user. Functions are 948 949 * provided to allow the user to manipulate a variable-length string. 949 * 950 * 950 951 * A variable-length string can be declared as: 951 952 * … … 1046 1047 * structure. The OCIRaw structure is opaque to the user. Functions are 1047 1048 * provided to allow the user to manipulate a variable-length raw. 1048 * 1049 * 1049 1050 * A variable-length raw can be declared as: 1050 1051 * … … 1145 1146 * ref = A pointer to the OCI object reference to clear. 1146 1147 */ 1147 extern (C) void OCIRefClear (OCIEnv* env, OCIRef* ref );1148 extern (C) void OCIRefClear (OCIEnv* env, OCIRef* reference); 1148 1149 1149 1150 /** … … 1186 1187 * TRUE if it is null or false otherwise. 1187 1188 */ 1188 extern (C) boolean OCIRefIsNull (OCIEnv* env, OCIRef* ref );1189 extern (C) boolean OCIRefIsNull (OCIEnv* env, OCIRef* reference); 1189 1190 1190 1191 /** … … 1198 1199 * The size of ref. 1199 1200 */ 1200 extern (C) ub4 OCIRefHexSize (OCIEnv* env, OCIRef* ref );1201 extern (C) ub4 OCIRefHexSize (OCIEnv* env, OCIRef* reference); 1201 1202 1202 1203 /** … … 1214 1215 * OCI_SUCCESS on success, OCI_INVALID_HANDLE on invalid parameters, or OCI_ERROR on error. 1215 1216 */ 1216 extern (C) sword OCIRefFromHex (OCIEnv* env, OCIError* err, OCISvcCtx* svc, oratext* hex, ub4 length, OCIRef** ref );1217 extern (C) sword OCIRefFromHex (OCIEnv* env, OCIError* err, OCISvcCtx* svc, oratext* hex, ub4 length, OCIRef** reference); 1217 1218 1218 1219 /** … … 1229 1230 * OCI_SUCCESS on success, OCI_INVALID_HANDLE on invalid parameters, or OCI_ERROR on error. 1230 1231 */ 1231 extern (C) sword OCIRefToHex (OCIEnv* env, OCIError* err, OCIRef* ref , oratext* hex, ub4* hex_length);1232 extern (C) sword OCIRefToHex (OCIEnv* env, OCIError* err, OCIRef* reference, oratext* hex, ub4* hex_length); 1232 1233 1233 1234 /** … … 1405 1406 The error recorded in 'err' can be retrieved by calling 1406 1407 OCIErrorGet(). 1407 coll (IN) - collection which will be scanned; the different 1408 coll (IN) - collection which will be scanned; the different 1408 1409 collection types are varray and nested table 1409 1410 itr (OUT) - address to the allocated collection iterator is … … 1413 1414 iterator is created in the object cache. The iterator is initialized 1414 1415 to point to the beginning of the collection. 1415 1416 If the next function (OCIIterNext) is called immediately 1417 after creating the iterator then the first element of the collection 1418 is returned. 1419 If the previous function (OCIIterPrev) is called immediately after 1420 creating the iterator then "at beginning of collection" error is 1416 1417 If the next function (OCIIterNext) is called immediately 1418 after creating the iterator then the first element of the collection 1419 is returned. 1420 If the previous function (OCIIterPrev) is called immediately after 1421 creating the iterator then "at beginning of collection" error is 1421 1422 returned. 1422 1423 RETURNS: … … 1440 1441 the 'itr' is set to NULL prior to returning 1441 1442 DESCRIPTION: 1442 Delete the iterator which was previously created by a call to 1443 Delete the iterator which was previously created by a call to 1443 1444 OCIIterCreate. 1444 1445 RETURNS: … … 1452 1453 extern (C) sword OCIIterInit (OCIEnv* env, OCIError* err, OCIColl* coll, OCIIter* itr); 1453 1454 /* 1454 NAME: OCIIterInit - OCIColl Initialize ITerator to scan the given 1455 NAME: OCIIterInit - OCIColl Initialize ITerator to scan the given 1455 1456 collection 1456 1457 PARAMETERS: … … 1460 1461 The error recorded in 'err' can be retrieved by calling 1461 1462 OCIErrorGet(). 1462 coll (IN) - collection which will be scanned; the different 1463 coll (IN) - collection which will be scanned; the different 1463 1464 collection types are varray and nested table 1464 1465 itr (IN/OUT) - pointer to an allocated collection iterator 1465 1466 DESCRIPTION: 1466 Initializes the given iterator to point to the beginning of the 1467 Initializes the given iterator to point to the beginning of the 1467 1468 given collection. This function can be used to: 1468 1469 a. reset an iterator to point back to the beginning of the collection 1469 1470 a. reset an iterator to point back to the beginning of the collection 1470 1471 b. reuse an allocated iterator to scan a different collection 1471 1472 RETURNS: … … 1488 1489 itr (IN) - iterator which points to the current element 1489 1490 elem (OUT) - address of the element pointed by the iterator is returned 1490 elemind (OUT) [optional] - address of the element's null indicator 1491 information is returned; if (elemind == NULL) then the null 1491 elemind (OUT) [optional] - address of the element's null indicator 1492 information is returned; if (elemind == NULL) then the null 1492 1493 indicator information will NOT be returned 1493 1494 DESCRIPTION: … … 1513 1514 elem (OUT) - after updating the iterator to point to the next element, 1514 1515 address of the element is returned 1515 elemind (OUT) [optional] - address of the element's null indicator 1516 information is returned; if (elemind == NULL) then the null 1516 elemind (OUT) [optional] - address of the element's null indicator 1517 information is returned; if (elemind == NULL) then the null 1517 1518 indicator information will NOT be returned 1518 1519 eoc (OUT) - TRUE if iterator is at End Of Collection (i.e. next … … 1521 1522 Returns pointer to the next element and its corresponding null 1522 1523 information. The iterator is updated to point to the next element. 1523 1524 1524 1525 If the iterator is pointing to the last element of the collection 1525 prior to executing this function, then calling this function will 1526 prior to executing this function, then calling this function will 1526 1527 set eoc flag to TRUE. The iterator will be left unchanged in this 1527 1528 situation. … … 1542 1543 The error recorded in 'err' can be retrieved by calling 1543 1544 OCIErrorGet(). 1544 itr (IN/OUT) - iterator is updated to point to the previous 1545 itr (IN/OUT) - iterator is updated to point to the previous 1545 1546 element 1546 elem (OUT) - after updating the iterator to point to the previous 1547 elem (OUT) - after updating the iterator to point to the previous 1547 1548 element, address of the element is returned 1548 elemind (OUT) [optional] - address of the element's null indicator 1549 information is returned; if (elemind == NULL) then the null 1549 elemind (OUT) [optional] - address of the element's null indicator 1550 information is returned; if (elemind == NULL) then the null 1550 1551 indicator information will NOT be returned 1551 1552 boc (OUT) - TRUE if iterator is at Beginning Of Collection (i.e. … … 1554 1555 Returns pointer to the previous element and its corresponding null 1555 1556 information. The iterator is updated to point to the previous element. 1556 1557 1557 1558 If the iterator is pointing to the first element of the collection 1558 prior to executing this function, then calling this function will 1559 set 'boc' to TRUE. The iterator will be left unchanged in this 1559 prior to executing this function, then calling this function will 1560 set 'boc' to TRUE. The iterator will be left unchanged in this 1560 1561 situation. 1561 1562 RETURNS: … … 1568 1569 extern (C) sword OCITableSize (OCIEnv* env, OCIError* err, OCITable* tbl, sb4* size); 1569 1570 /* 1570 NAME: OCITableSize - OCITable return current SIZe of the given 1571 NAME: OCITableSize - OCITable return current SIZe of the given 1571 1572 nested table (not including deleted elements) 1572 1573 PARAMETERS: … … 1580 1581 does not include deleted elements. 1581 1582 DESCRIPTION: 1582 Returns the count of elements in the given nested table. 1583 1584 The count returned by OCITableSize() will be decremented upon 1585 deleting elements from the nested table. So, this count DOES NOT 1586 includes any "holes" created by deleting elements. 1583 Returns the count of elements in the given nested table. 1584 1585 The count returned by OCITableSize() will be decremented upon 1586 deleting elements from the nested table. So, this count DOES NOT 1587 includes any "holes" created by deleting elements. 1587 1588 For example: 1588 1589 1589 OCITableSize(...); 1590 OCITableSize(...); 1590 1591 // assume 'size' returned is equal to 5 1591 1592 OCITableDelete(...); // delete one element … … 1593 1594 // 'size' returned will be equal to 4 1594 1595 1595 To get the count plus the count of deleted elements use 1596 To get the count plus the count of deleted elements use 1596 1597 OCICollSize(). Continuing the above example, 1597 1598 … … 1665 1666 OCIErrorGet(). 1666 1667 tbl (IN) - table which is scanned 1667 index (OUT) - first index of the element which exists in the given 1668 index (OUT) - first index of the element which exists in the given 1668 1669 table is returned 1669 1670 DESCRIPTION: 1670 Return the first index of the element which exists in the given 1671 table. 1671 Return the first index of the element which exists in the given 1672 table. 1672 1673 RETURNS: 1673 1674 OCI_SUCCESS if the function completes successfully. … … 1687 1688 OCIErrorGet(). 1688 1689 tbl (IN) - table which is scanned 1689 index (OUT) - last index of the element which exists in the given 1690 index (OUT) - last index of the element which exists in the given 1690 1691 table is returned 1691 1692 DESCRIPTION: 1692 Return the last index of the element which exists in the given 1693 table. 1693 Return the last index of the element which exists in the given 1694 table. 1694 1695 RETURNS: 1695 1696 OCI_SUCCESS if the function completes successfully. … … 1711 1712 which exists is returned 1712 1713 tbl (IN) - table which is scanned 1713 next_index (OUT) - index of the next element which exists 1714 next_index (OUT) - index of the next element which exists 1714 1715 is returned 1715 1716 exists (OUT) - FALSE if no next index available else TRUE 1716 1717 DESCRIPTION: 1717 Return the smallest position j, greater than 'index', such that 1718 Return the smallest position j, greater than 'index', such that 1718 1719 exists(j) is TRUE. 1719 1720 RETURNS: … … 1736 1737 which exists is returned 1737 1738 tbl (IN) - table which is scanned 1738 prev_index (OUT) - index of the previous element which exists 1739 prev_index (OUT) - index of the previous element which exists 1739 1740 is returned 1740 1741 exists (OUT) - FALSE if no next index available else TRUE 1741 1742 DESCRIPTION: 1742 Return the largest position j, less than 'index', such that 1743 Return the largest position j, less than 'index', such that 1743 1744 exists(j) is TRUE. 1744 1745 RETURNS: … … 1752 1753 return cast(lnxnum_t*)num; 1753 1754 } 1754 /* 1755 /* 1755 1756 NAME: OCINumberToLnx 1756 1757 PARAMETERS: 1757 1758 num (IN) - OCINumber to convert ; 1758 DESCRIPTION: 1759 Converts OCINumber to its internal lnx format 1759 DESCRIPTION: 1760 Converts OCINumber to its internal lnx format 1760 1761 This is not to be used in Public interfaces , but 1761 has been provided due to special requirements from 1762 SQLPLUS development group as they require to call 1763 Core funtions directly . 1762 has been provided due to special requirements from 1763 SQLPLUS development group as they require to call 1764 Core funtions directly . 1764 1765 */ 1765 1766 +/ … … 1775 1776 struct OCIDOMDocument { 1776 1777 } 1778 1779 } trunk/bbconv/dbi/oracle/imp/oro.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.oro; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.ocidfn; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oratypes; 18 19 19 20 /** … … 60 61 * If the object copy is not loaded, load it from the persistent store. 61 62 * Otherwise, the loaded object copy is returned to the program. 62 * 63 * 63 64 * OCI_PIN_RECENT pins the latest copy of an object. The object is 64 65 * pinned using the following criteria: … … 162 163 * This option is used to specify the set of objects to be refreshed. 163 164 * 164 * OCI_REFRESH_LOAD refreshes the objects that are loaded in the current 165 * OCI_REFRESH_LOAD refreshes the objects that are loaded in the current 165 166 * transaction. 166 167 */ … … 799 800 800 801 deprecated alias OCIRefreshOpt OCICoherency; /// Deprecated: Only used for beta2. 801 deprecated OCIRefreshOpt OCI_COHERENCY = 2; /// Deprecated: Only used for beta2. 802 deprecated OCIRefreshOpt OCI_COHERENCY_NULL = 4; /// Deprecated: Only used for beta2. 803 deprecated OCIRefreshOpt OCI_COHERENCY_ALWAYS = 5; /// Deprecated: Only used for beta2. 802 deprecated OCIRefreshOpt OCI_COHERENCY = cast(OCIRefreshOpt)2; /// Deprecated: Only used for beta2. 803 deprecated OCIRefreshOpt OCI_COHERENCY_NULL = cast(OCIRefreshOpt)4; /// Deprecated: Only used for beta2. 804 deprecated OCIRefreshOpt OCI_COHERENCY_ALWAYS = cast(OCIRefreshOpt)5; /// Deprecated: Only used for beta2. 805 806 } trunk/bbconv/dbi/oracle/imp/ort.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.oracle.imp.ort; 16 15 17 private import dbi.oracle.imp.oratypes, dbi.oracle.imp.oro, dbi.oracle.imp.oci; 16 version (dbi_oracle) { 17 18 private import dbi.oracle.imp.oci, dbi.oracle.imp.oratypes, dbi.oracle.imp.oro; 18 19 19 20 /** … … 263 264 the name of the type 264 265 NOTES: 265 The type descriptor, 'tdo', must be unpinned when the accessed 266 The type descriptor, 'tdo', must be unpinned when the accessed 266 267 information is no longer needed. 267 268 */ … … 283 284 REQUIRES: 284 285 1) All type accessors require that the type be pinned before calling 285 any accessor. 286 any accessor. 286 287 2) All input parameters must not be NULL and must be valid. 287 288 3) 'n_length' must point to an allocated ub4. … … 291 292 the schema name of the type 292 293 NOTES: 293 The type descriptor, 'tdo', must be unpinned when the accessed 294 The type descriptor, 'tdo', must be unpinned when the accessed 294 295 information is no longer needed. 295 296 */ … … 299 300 /* 300 301 NAME: OCITypeTypeCode - OCI Get a Type's Type Code. 301 PARAMETERS: 302 PARAMETERS: 302 303 env (IN/OUT) - OCI environment handle initialized in object mode 303 304 err (IN/OUT) - error handle. If there is an error, it is … … 307 308 tdo (IN) - pointer to to the type descriptor in the object cache 308 309 REQUIRES: 309 1) All type accessors require that the type be pinned before calling 310 any accessor. 310 1) All type accessors require that the type be pinned before calling 311 any accessor. 311 312 2) All input parameters must not be NULL and must be valid. 312 313 DESCRIPTION: … … 315 316 The type code of the type. 316 317 NOTES: 317 The type descriptor, 'tdo', must be unpinned when the accessed 318 The type descriptor, 'tdo', must be unpinned when the accessed 318 319 information is no longer needed. 319 320 */ … … 323 324 /* 324 325 NAME: OCITypeCollTypeCode - OCI Get a Domain Type's Type Code. 325 PARAMETERS: 326 PARAMETERS: 326 327 env (IN/OUT) - OCI environment handle initialized in object mode 327 328 err (IN/OUT) - error handle. If there is an error, it is … … 331 332 tdo (IN) - pointer to to the type descriptor in the object cache 332 333 REQUIRES: 333 1) All type accessors require that the type be pinned before calling 334 any accessor. 334 1) All type accessors require that the type be pinned before calling 335 any accessor. 335 336 2) All input parameters must not be NULL and must be valid. 336 337 3) 'tdo' MUST point to a named collection type. … … 342 343 OCI_TYPECODE_TABLE for nested tables. 343 344 NOTES: 344 The type descriptor, 'tdo', should be unpinned when the accessed 345 The type descriptor, 'tdo', should be unpinned when the accessed 345 346 information is no longer needed. 346 347 */ … … 349 350 deprecated extern (C) oratext* OCITypeVersion (OCIEnv* env, OCIError* err, OCIType* tdo, ub4* v_length); 350 351 /* 351 NAME: OCITypeVersion - OCI Get a Type's user-readable VersioN. 352 PARAMETERS: 352 NAME: OCITypeVersion - OCI Get a Type's user-readable VersioN. 353 PARAMETERS: 353 354 env (IN/OUT) - OCI environment handle initialized in object mode 354 355 err (IN/OUT) - error handle. If there is an error, it is … … 357 358 OCIErrorGet(). 358 359 tdo (IN) - pointer to to the type descriptor in the object cache 359 v_length (OUT) - length (in bytes) of the returned user-readable 360 version. The caller must allocate space for the ub4 before 360 v_length (OUT) - length (in bytes) of the returned user-readable 361 version. The caller must allocate space for the ub4 before 361 362 calling this routine. 362 363 REQUIRES: 363 1) All type accessors require that the type be pinned before calling 364 any accessor. 364 1) All type accessors require that the type be pinned before calling 365 any accessor. 365 366 2) All input parameters must not be NULL and must be valid. 366 367 3) 'v_length' must point to an allocated ub4. … … 370 371 The user-readable version of the type 371 372 NOTES: 372 The type descriptor, 'tdo', must be unpinned when the accessed 373 The type descriptor, 'tdo', must be unpinned when the accessed 373 374 information is no longer needed. 374 375 */ … … 377 378 deprecated extern (C) ub4 OCITypeAttrs (OCIEnv* env, OCIError* err, OCIType* tdo); 378 379 /* 379 NAME: OCITypeAttrs - OCI Get a Type's Number of Attributes. 380 PARAMETERS: 380 NAME: OCITypeAttrs - OCI Get a Type's Number of Attributes. 381 PARAMETERS: 381 382 env (IN/OUT) - OCI environment handle initialized in object mode 382 383 err (IN/OUT) - error handle. If there is an error, it is … … 386 387 tdo (IN) - pointer to to the type descriptor in the object cache 387 388 REQUIRES: 388 1) All type accessors require that the type be pinned before calling 389 any accessor. 389 1) All type accessors require that the type be pinned before calling 390 any accessor. 390 391 2) All input parameters must not be NULL and must be valid. 391 392 DESCRIPTION: … … 394 395 The number of attributes in the type. 0 for ALL non-ADTs. 395 396 NOTES: 396 The type descriptor, 'tdo', must be unpinned when the accessed 397 The type descriptor, 'tdo', must be unpinned when the accessed 397 398 information is no longer needed. 398 399 */ … … 401 402 deprecated extern (C) ub4 OCITypeMethods (OCIEnv* env, OCIError* err, OCIType* tdo); 402 403 /* 403 NAME: OCITypeMethods - OCI Get a Type's Number of Methods. 404 PARAMETERS: 404 NAME: OCITypeMethods - OCI Get a Type's Number of Methods. 405 PARAMETERS: 405 406 env (IN/OUT) - OCI environment handle initialized in object mode 406 407 err (IN/OUT) - error handle. If there is an error, it is … … 410 411 tdo (IN) - pointer to to the type descriptor in the object cache 411 412 REQUIRES: 412 1) All type accessors require that the type be pinned before calling 413 any accessor. 413 1) All type accessors require that the type be pinned before calling 414 any accessor. 414 415 2) All input parameters must not be NULL and must be valid. 415 416 DESCRIPTION: … … 418 419 The number of methods in the type 419 420 NOTES: 420 The type descriptor, 'tdo', must be unpinned when the accessed 421 The type descriptor, 'tdo', must be unpinned when the accessed 421 422 information is no longer needed. 422 423 */ … … 425 426 deprecated extern (C) oratext* OCITypeElemName (OCIEnv* env, OCIError* err, OCITypeElem* elem, ub4 n_length); 426 427 /* 427 NAME: OCITypeElemName - OCI Get an Attribute's NaMe. 428 PARAMETERS: 428 NAME: OCITypeElemName - OCI Get an Attribute's NaMe. 429 PARAMETERS: 429 430 env (IN/OUT) - OCI environment handle initialized in object mode 430 431 err (IN/OUT) - error handle. If there is an error, it is … … 433 434 OCIErrorGet(). 434 435 elem (IN) - pointer to the type element descriptor in the object cache 435 n_length (OUT) - length (in bytes) of the returned attribute name. 436 The caller must allocate space for the ub4 before calling this 436 n_length (OUT) - length (in bytes) of the returned attribute name. 437 The caller must allocate space for the ub4 before calling this 437 438 routine. 438 439 REQUIRES: 439 1) All type accessors require that the type be pinned before calling 440 any accessor. 440 1) All type accessors require that the type be pinned before calling 441 any accessor. 441 442 2) All input parameters must not be NULL and must be valid. 442 443 3) 'n_length' must point to an allocated ub4. … … 446 447 the name of the attribute and the length in n_length 447 448 NOTES: 448 The type must be unpinned when the accessed information is no 449 The type must be unpinned when the accessed information is no 449 450 longer needed. 450 451 */ … … 453 454 deprecated extern (C) OCITypeCode OCITypeElemTypeCode (OCIEnv* env, OCIError* err, OCITypeElem* elem); 454 455 /* 455 NAME: OCITypeElemTypeCode - OCI Get an Attribute's TypeCode. 456 PARAMETERS: 456 NAME: OCITypeElemTypeCode - OCI Get an Attribute's TypeCode. 457 PARAMETERS: 457 458 env (IN/OUT) - OCI environment handle initialized in object mode 458 459 err (IN/OUT) - error handle. If there is an error, it is … … 462 463 elem (IN) - pointer to the type element descriptor in the object cache 463 464 REQUIRES: 464 1) All type accessors require that the type be pinned before calling 465 any accessor. 465 1) All type accessors require that the type be pinned before calling 466 any accessor. 466 467 2) All input parameters must not be NULL and must be valid. 467 468 DESCRIPTION: 468 469 Get the typecode of an attribute's type. 469 470 RETURNS: 470 the typecode of the attribute's type. If this is a scalar type, the 471 typecode sufficiently describes the scalar type and no further calls 471 the typecode of the attribute's type. If this is a scalar type, the 472 typecode sufficiently describes the scalar type and no further calls 472 473 need to be made. Valid scalar types include: OCI_TYPECODE_SIGNED8, 473 474 OCI_TYPECODE_UNSIGNED8, OCI_TYPECODE_SIGNED16, OCI_TYPECODE_UNSIGNED16, … … 478 479 typecode. 479 480 NOTES: 480 The type must be unpinned when the accessed information is no 481 The type must be unpinned when the accessed information is no 481 482 longer needed. 482 483 */ … … 506 507 RETURNS 507 508 OCI_SUCCESS if the function completes successfully. 508 OCI_INVALID_HANDLE if 'env' or 'err' is null. 509 OCI_INVALID_HANDLE if 'env' or 'err' is null. 509 510 OCI_ERROR if 510 511 1) any of the parameters is null. … … 520 521 NAME: OCITypeElemFlags - OCI Get a Elem's FLags 521 522 (inline, constant, virtual, constructor, 522 destructor). 523 PARAMETERS: 523 destructor). 524 PARAMETERS: 524 525 env (IN/OUT) - OCI environment handle initialized in object mode 525 526 err (IN/OUT) - error handle. If there is an error, it is … … 529 530 elem (IN) - pointer to the type element descriptor in the object cache 530 531 REQUIRES: 531 1) All type accessors require that the type be pinned before calling 532 any accessor. 532 1) All type accessors require that the type be pinned before calling 533 any accessor. 533 534 2) All input parameters must not be NULL and must be valid. 534 535 DESCRIPTION: … … 548 549 NAME: OCITypeElemNumPrec - Get a Number's Precision. This includes float, 549 550 decimal, real, double, and oracle number. 550 PARAMETERS: 551 PARAMETERS: 551 552 env (IN/OUT) - OCI environment handle initialized in object mode 552 553 err (IN/OUT) - error handle. If there is an error, it is … … 558 559 All input parameters must not be NULL and must be valid. 559 560 DESCRIPTION: 560 Get the precision of a float, decimal, long, unsigned long, real, 561 double, or Oracle number type. 561 Get the precision of a float, decimal, long, unsigned long, real, 562 double, or Oracle number type. 562 563 RETURNS: 563 564 the precision of the float, decimal, long, unsigned long, real, double, 564 or Oracle number 565 or Oracle number 565 566 */ 566 567 … … 568 569 deprecated extern (C) sb1 OCITypeElemNumScale (OCIEnv* env, OCIError* err, OCITypeElem* elem); 569 570 /* 570 NAME: OCITypeElemNumScale - Get a decimal or oracle Number's Scale 571 PARAMETERS: 571 NAME: OCITypeElemNumScale - Get a decimal or oracle Number's Scale 572 PARAMETERS: 572 573 env (IN/OUT) - OCI environment handle initialized in object mode 573 574 err (IN/OUT) - error handle. If there is an error, it is … … 579 580 All input parameters must not be NULL and must be valid. 580 581 DESCRIPTION: 581 Get the scale of a decimal, or Oracle number type. 582 RETURNS: 583 the scale of the decimal, or Oracle number 582 Get the scale of a decimal, or Oracle number type. 583 RETURNS: 584 the scale of the decimal, or Oracle number 584 585 */ 585 586 … … 589 590 NAME: OCITypeElemLength - Get a raw, fixed or variable length String's 590 591 length in bytes. 591 PARAMETERS: 592 PARAMETERS: 592 593 env (IN/OUT) - OCI environment handle initialized in object mode 593 594 err (IN/OUT) - error handle. If there is an error, it is … … 599 600 All input parameters must not be NULL and must be valid. 600 601 DESCRIPTION: 601 Get the length of a raw, fixed or variable length string type. 602 Get the length of a raw, fixed or variable length string type. 602 603 RETURNS: 603 604 length of the raw, fixed or variable length string … … 609 610 NAME: OCITypeElemCharSetID - Get a fixed or variable length String's 610 611 character set ID 611 PARAMETERS: 612 PARAMETERS: 612 613 env (IN/OUT) - OCI environment handle initialized in object mode 613 614 err (IN/OUT) - error handle. If there is an error, it is … … 619 620 All input parameters must not be NULL and must be valid. 620 621 DESCRIPTION: 621 Get the character set ID of a fixed or variable length string type. 622 Get the character set ID of a fixed or variable length string type. 622 623 RETURNS: 623 624 character set ID of the fixed or variable length string … … 629 630 NAME: OCITypeElemCharSetForm - Get a fixed or variable length String's 630 631 character set specification form. 631 PARAMETERS: 632 PARAMETERS: 632 633 env (IN/OUT) - OCI environment handle initialized in object mode 633 634 err (IN/OUT) - error handle. If there is an error, it is … … 653 654 deprecated extern (C) sword OCITypeElemParameterizedType (OCIEnv* env, OCIError* err, OCITypeElem* elem, OCIType** type_stored); 654 655 /* 655 NAME: OCITypeElemParameterizedType 656 PARAMETERS: 656 NAME: OCITypeElemParameterizedType 657 PARAMETERS: 657 658 env (IN/OUT) - OCI environment handle initialized in object mode 658 659 err (IN/OUT) - error handle. If there is an error, it is … … 661 662 OCIErrorGet(). 662 663 elem (IN) - pointer to the type element descriptor in the object cache 663 type_stored (OUT) - If the function completes successfully, 664 type_stored (OUT) - If the function completes successfully, 664 665 and the parameterized type is complex, 'type_stored' is NULL. 665 Otherwise, 'type_stored' points to the type descriptor (in the 666 object cache) of the type that is stored in the parameterized 667 type. The caller must allocate space for the OCIType* 666 Otherwise, 'type_stored' points to the type descriptor (in the 667 object cache) of the type that is stored in the parameterized 668 type. The caller must allocate space for the OCIType* 668 669 before calling this routine and must not write into the space. 669 670 REQUIRES: … … 679 680 RETURNS: 680 681 OCI_SUCCESS if the function completes successfully. 681 OCI_INVALID_HANDLE if 'env' or 'err' is null. 682 OCI_INVALID_HANDLE if 'env' or 'err' is null. 682 683 OCI_ERROR if 683 684 1) any of the parameters is null. 684 685 2) 'type_stored' is not NULL but points to NULL data. 685 686 NOTES: 686 Complex parameterized types will be in a future release (once 687 typedefs are supported. When setting the parameterized type 687 Complex parameterized types will be in a future release (once 688 typedefs are supported. When setting the parameterized type 688 689 information, the user must typedef the contents if it's a 689 690 complex parameterized type. Ex. for varray<varray<car>>, use 690 'typedef varray<car> varcar' and then use varray<varcar>. 691 'typedef varray<car> varcar' and then use varray<varcar>. 691 692 */ 692 693 … … 720 721 deprecated extern (C) sword OCITypeAttrByName (OCIEnv* env, OCIError* err, OCIType* tdo, oratext* name, ub4 n_length, OCITypeElem** elem); 721 722 /* 722 NAME: OCITypeAttrByName - OCI Get an Attribute By Name. 723 PARAMETERS: 723 NAME: OCITypeAttrByName - OCI Get an Attribute By Name. 724 PARAMETERS: 724 725 env (IN/OUT) - OCI environment handle initialized in object mode 725 726 err (IN/OUT) - error handle. If there is an error, it is … … 728 729 OCIErrorGet(). 729 730 tdo (IN) - pointer to to the type descriptor in the object cache 730 name (IN) - the attribute's name 731 name (IN) - the attribute's name 731 732 n_length (IN) - length (in bytes) of the 'name' parameter 732 elem (OUT) - If this function completes successfully, 'elem' points to 733 elem (OUT) - If this function completes successfully, 'elem' points to 733 734 the selected type element descriptor pertaining to the 734 735 attributein the object cache. 735 736 REQUIRES: 736 1) All type accessors require that the type be pinned before calling 737 any accessor. 738 2) if 'tdo' is not null, it must point to a valid type descriptor 737 1) All type accessors require that the type be pinned before calling 738 any accessor. 739 2) if 'tdo' is not null, it must point to a valid type descriptor 739 740 in the object cache. 740 741 DESCRIPTION: 741 Get an attribute given its name. 742 RETURNS: 743 OCI_SUCCESS if the function completes successfully. 744 OCI_INVALID_HANDLE if 'env' or 'err' is null. 742 Get an attribute given its name. 743 RETURNS: 744 OCI_SUCCESS if the function completes successfully. 745 OCI_INVALID_HANDLE if 'env' or 'err' is null. 745 746 OCI_ERROR if 746 747 1) any of the required parameters is null. 747 2) the type does not contain an attribute with the input 'name'. 748 2) the type does not contain an attribute with the input 'name'. 748 749 3) 'name' is NULL. 749 750 NOTES: 750 The type descriptor, 'tdo', must be unpinned when the accessed 751 The type descriptor, 'tdo', must be unpinned when the accessed 751 752 information is no longer needed. 752 753 Schema and type names are CASE-SENSITIVE. If they have been created … … 758 759 /* 759 760 NAME: OCITypeAttrNext - OCI Get an Attribute By Iteration. 760 PARAMETERS: 761 PARAMETERS: 761 762 env (IN/OUT) - OCI environment handle initialized in object mode 762 763 err (IN/OUT) - error handle. If there is an error, it is … … 766 767 iterator_ort (IN/OUT) - iterator for retrieving the next attribute; 767 768 see OCITypeIterNew() to initialize iterator. 768 elem (OUT) - If this function completes successfully, 'elem' points to 769 elem (OUT) - If this function completes successfully, 'elem' points to 769 770 the selected type element descriptor pertaining to the 770 771 attributein the object cache. 771 772 REQUIRES: 772 1) All type accessors require that the type be pinned before calling 773 any accessor. 774 2) if 'tdo' is not null, it must point to a valid type descriptor 773 1) All type accessors require that the type be pinned before calling 774 any accessor. 775 2) if 'tdo' is not null, it must point to a valid type descriptor 775 776 in the object cache. 776 777 DESCRIPTION: … … 780 781 OCI_NO_DATA if there are no more attributes to iterate on; use 781 782 OCITypeIterSet() to reset the iterator if necessary. 782 OCI_INVALID_HANDLE if 'env' or 'err' is null. 783 OCI_INVALID_HANDLE if 'env' or 'err' is null. 783 784 OCI_ERROR if 784 785 1) any of the required parameters is null. 785 786 NOTES: 786 The type must be unpinned when the accessed information is no 787 The type must be unpinned when the accessed information is no 787 788 longer needed. 788 789 */ … … 792 793 /* 793 794 NAME: OCITypeCollElem 794 PARAMETERS: 795 PARAMETERS: 795 796 env (IN/OUT) - OCI environment handle initialized in object mode 796 797 err (IN/OUT) - error handle. If there is an error, it is … … 818 819 RETURNS: 819 820 OCI_SUCCESS if the function completes successfully. 820 OCI_INVALID_HANDLE if 'env' or 'err' is null. 821 OCI_INVALID_HANDLE if 'env' or 'err' is null. 821 822 OCI_ERROR if 822 823 1) any of the parameters is null. 823 824 2) the type TDO does not point to a valid collection's type. 824 825 NOTES: 825 Complex parameterized types will be in a future release (once 826 typedefs are supported. When setting the parameterized type 826 Complex parameterized types will be in a future release (once 827 typedefs are supported. When setting the parameterized type 827 828 information, the user must typedef the contents if it's a 828 829 complex parameterized type. Ex. for varray<varray<car>>, use 829 'typedef varray<car> varcar' and then use varray<varcar>. 830 'typedef varray<car> varcar' and then use varray<varcar>. 830 831 */ 831 832 … … 834 835 /* 835 836 NAME: OCITypeCollSize - OCI Get a Collection's Number of Elements. 836 PARAMETERS: 837 PARAMETERS: 837 838 env (IN/OUT) - OCI environment handle initialized in object mode 838 839 err (IN/OUT) - error handle. If there is an error, it is … … 846 847 defined as a domain. 847 848 DESCRIPTION: 848 Get the number of elements stored in a fixed array or the maximum 849 Get the number of elements stored in a fixed array or the maximum 849 850 number of elements in a variable array. 850 RETURNS:851 OCI_SUCCESS if the function completes successfully.852 OCI_INVALID_HANDLE if 'env' or 'err' is null.853 OCI_ERROR if854 1) any of the parameters is null.855 2) 'tdo' does not point to a domain with a collection type.856 NOTES:857 Complex parameterized types will be in a future release (once858 typedefs are supported. When setting the parameterized type859 information, the user must typedef the contents if it's a860 complex parameterized type. Ex. for varray<varray<car>>, use861 'typedef varray<car> varcar' and then use varray<varcar>.862 */863 864 865 extern (C) sword OCITypeCollExtTypeCode (OCIEnv* env, OCIError* err, OCIType* tdo, OCITypeCode* sqt_code);866 /*867 NAME: ortcsqt - OCI Get a Collection element's DTY constant.868 PARAMETERS:869 env (IN/OUT) - OCI environment handle initialized in object mode870 err (IN/OUT) - error handle. If there is an error, it is871 recorded in 'err' and this function returns OCI_ERROR.872 The error recorded in 'err' can be retrieved by calling873 OCIErrorGet().874 tdo (IN) - pointer to the type descriptor in the object cache875 sqt_code (OUT) - SQLT code of type element.876 REQUIRES:877 1) All type accessors require that the type be pinned before calling878 any accessor.879 2) All input parameters must not be NULL and must be valid.880 DESCRIPTION:881 Get the SQLT constant associated with an domain's element type.882 The SQLT codes are defined in <sqldef.h> and are needed for OCI/OOCI883 use.884 851 RETURNS: 885 852 OCI_SUCCESS if the function completes successfully. … … 889 856 2) 'tdo' does not point to a domain with a collection type. 890 857 NOTES: 858 Complex parameterized types will be in a future release (once 859 typedefs are supported. When setting the parameterized type 860 information, the user must typedef the contents if it's a 861 complex parameterized type. Ex. for varray<varray<car>>, use 862 'typedef varray<car> varcar' and then use varray<varcar>. 863 */ 864 865 866 extern (C) sword OCITypeCollExtTypeCode (OCIEnv* env, OCIError* err, OCIType* tdo, OCITypeCode* sqt_code); 867 /* 868 NAME: ortcsqt - OCI Get a Collection element's DTY constant. 869 PARAMETERS: 870 env (IN/OUT) - OCI environment handle initialized in object mode 871 err (IN/OUT) - error handle. If there is an error, it is 872 recorded in 'err' and this function returns OCI_ERROR. 873 The error recorded in 'err' can be retrieved by calling 874 OCIErrorGet(). 875 tdo (IN) - pointer to the type descriptor in the object cache 876 sqt_code (OUT) - SQLT code of type element. 877 REQUIRES: 878 1) All type accessors require that the type be pinned before calling 879 any accessor. 880 2) All input parameters must not be NULL and must be valid. 881 DESCRIPTION: 882 Get the SQLT constant associated with an domain's element type. 883 The SQLT codes are defined in <sqldef.h> and are needed for OCI/OOCI 884 use. 885 RETURNS: 886 OCI_SUCCESS if the function completes successfully. 887 OCI_INVALID_HANDLE if 'env' or 'err' is null. 888 OCI_ERROR if 889 1) any of the parameters is null. 890 2) 'tdo' does not point to a domain with a collection type. 891 NOTES: 891 892 The type must be unpinned when the accessed information is no 892 893 longer needed. 893 894 */ 894 895 895 896 896 897 deprecated extern (C) ub4 OCITypeMethodOverload (OCIEnv* env, OCIError* err, OCIType* tdo, oratext method_name, ub4 m_length); … … 926 927 deprecated extern (C) sword OCITypeMethodByName (OCIEnv* env, OCIError* err, OCIType* tdo, oratext* method_name, ub4 m_length, OCITypeMethod** mdos); 927 928 /* 928 NAME: OCITypeMethodByName - OCI Get one or more Methods with Name. 929 PARAMETERS: 929 NAME: OCITypeMethodByName - OCI Get one or more Methods with Name. 930 PARAMETERS: 930 931 env (IN/OUT) - OCI environment handle initialized in object mode 931 932 err (IN/OUT) - error handle. If there is an error, it is … … 934 935 OCIErrorGet(). 935 936 tdo (IN) - pointer to to the type descriptor in the object cache 936 method_name (IN) - the methods' name 937 method_name (IN) - the methods' name 937 938 m_length (IN) - length (in bytes) of the 'name' parameter 938 939 mdos (OUT) - If this function completes successfully, 'mdos' points to … … 943 944 be obtained by calling 'OCITypeMethodOverload()'. 944 945 REQUIRES: 945 1) All type accessors require that the type be pinned before calling 946 any accessor. 947 2) if 'tdo' is not null, it must point to a valid type descriptor 946 1) All type accessors require that the type be pinned before calling 947 any accessor. 948 2) if 'tdo' is not null, it must point to a valid type descriptor 948 949 in the object cache. 949 950 DESCRIPTION: 950 Get one or more methods given the name. 951 RETURNS: 952 OCI_SUCCESS if the function completes successfully. 953 OCI_INVALID_HANDLE if 'env' or 'err' is null. 951 Get one or more methods given the name. 952 RETURNS: 953 OCI_SUCCESS if the function completes successfully. 954 OCI_INVALID_HANDLE if 'env' or 'err' is null. 954 955 OCI_ERROR if 955 956 1) any of the required parameters is null. … … 957 958 3) 'mdos' is not NULL but points to NULL data. 958 959 NOTES: 959 The type must be unpinned when the accessed information is no 960 The type must be unpinned when the accessed information is no 960 961 longer needed. 961 962 Schema and type names are CASE-SENSITIVE. If they have been created … … 967 968 /* 968 969 NAME: OCITypeMethodNext - OCI Get a Method By Iteration. 969 PARAMETERS: 970 PARAMETERS: 970 971 env (IN/OUT) - OCI environment handle initialized in object mode 971 972 err (IN/OUT) - error handle. If there is an error, it is … … 975 976 iterator_ort (IN/OUT) - iterator for retrieving the next method; 976 977 see OCITypeIterNew() to set iterator. 977 mdo (OUT) - If this function completes successfully, 'mdo' points to 978 the selected method descriptor in the object cache. Positions 978 mdo (OUT) - If this function completes successfully, 'mdo' points to 979 the selected method descriptor in the object cache. Positions 979 980 start at 1. The caller must allocate space for the 980 OCITypeMethod* before calling this routine and must not write 981 nto the space. 982 REQUIRES: 983 1) All type accessors require that the type be pinned before calling 984 any accessor. 985 2) if 'tdo' is not null, it must point to a valid type descriptor 981 OCITypeMethod* before calling this routine and must not write 982 nto the space. 983 REQUIRES: 984 1) All type accessors require that the type be pinned before calling 985 any accessor. 986 2) if 'tdo' is not null, it must point to a valid type descriptor 986 987 in the object cache. 987 988 DESCRIPTION: … … 991 992 OCI_NO_DATA if there are no more attributes to iterate on; use 992 993 OCITypeIterSet() to reset the iterator if necessary. 993 OCI_INVALID_HANDLE if 'env' or 'err' is null. 994 OCI_INVALID_HANDLE if 'env' or 'err' is null. 994 995 OCI_ERROR if 995 996 1) any of the required parameters is null. 996 997 2) 'mdo' is not NULL but points to NULL data. 997 998 NOTES: 998 The type must be unpinned when the accessed information is no 999 The type must be unpinned when the accessed information is no 999 1000 longer needed. 1000 1001 */ … … 1003 1004 deprecated extern (C) oratext* OCITypeMethodName (OCIEnv* env, OCIError* err, OCITypeMethod* mdo, ub4* n_length); 1004 1005 /* 1005 NAME: OCITypeMethodName - OCI Get a Method's NaMe. 1006 PARAMETERS: 1006 NAME: OCITypeMethodName - OCI Get a Method's NaMe. 1007 PARAMETERS: 1007 1008 env (IN/OUT) - OCI environment handle initialized in object mode 1008 1009 err (IN/OUT) - error handle. If there is an error, it is … … 1014 1015 must allocate space for the ub4 before calling this routine. 1015 1016 REQUIRES: 1016 1) All type accessors require that the type be pinned before calling 1017 any accessor. 1017 1) All type accessors require that the type be pinned before calling 1018 any accessor. 1018 1019 2) All input parameters must not be NULL and must be valid. 1019 1020 DESCRIPTION: … … 1022 1023 the non-unique name of the method or NULL if there is an error. 1023 1024 NOTES: 1024 The type must be unpinned when the accessed information is no 1025 The type must be unpinned when the accessed information is no 1025 1026 longer needed. 1026 1027 */ … … 1029 1030 deprecated extern (C) OCITypeEncap OCITypeMethodEncap (OCIEnv* env, OCIError* err, OCITypeMethod* mdo); 1030 1031 /* 1031 NAME: OCITypeMethodEncap - Get a Method's ENcapsulation (private/public). 1032 PARAMETERS: 1032 NAME: OCITypeMethodEncap - Get a Method's ENcapsulation (private/public). 1033 PARAMETERS: 1033 1034 env (IN/OUT) - OCI environment handle initialized in object mode 1034 1035 err (IN/OUT) - error handle. If there is an error, it is … … 1038 1039 mdo (IN) - pointer to the method descriptor in the object cache 1039 1040 REQUIRES: 1040 1) All type accessors require that the type be pinned before calling 1041 any accessor. 1041 1) All type accessors require that the type be pinned before calling 1042 any accessor. 1042 1043 2) All input parameters must not be NULL and must be valid. 1043 1044 DESCRIPTION: … … 1046 1047 the encapsulation (private, or public) of the method 1047 1048 NOTES: 1048 The type must be unpinned when the accessed information is no 1049 The type must be unpinned when the accessed information is no 1049 1050 longer needed. 1050 1051 */ … … 1055 1056 NAME: OCITypeMethodFlags - OCI Get a Method's FLags 1056 1057 (inline, constant, virtual, constructor, 1057 destructor). 1058 PARAMETERS: 1058 destructor). 1059 PARAMETERS: 1059 1060 env (IN/OUT) - OCI environment handle initialized in object mode 1060 1061 err (IN/OUT) - error handle. If there is an error, it is … … 1064 1065 mdo (IN) - pointer to the method descriptor in the object cache 1065 1066 REQUIRES: 1066 1) All type accessors require that the type be pinned before calling 1067 any accessor. 1067 1) All type accessors require that the type be pinned before calling 1068 any accessor. 1068 1069 2) All input parameters must not be NULL and must be valid. 1069 1070 DESCRIPTION: … … 1074 1075 the method 1075 1076 NOTES: 1076 The type must be unpinned when the accessed information is no 1077 The type must be unpinned when the accessed information is no 1077 1078 longer needed. 1078 1079 */ … … 1082 1083 /* 1083 1084 NAME: OCITypeMethodMap - OCI Get the Method's MAP function. 1084 PARAMETERS: 1085 PARAMETERS: 1085 1086 env (IN/OUT) - OCI environment handle initialized in object mode 1086 1087 err (IN/OUT) - error handle. If there is an error, it is … … 1089 1090 OCIErrorGet(). 1090 1091 tdo (IN) - pointer to to the type descriptor in the object cache 1091 mdo (OUT) - If this function completes successfully, and there is a 1092 map function for this type, 'mdo' points to the selected method 1092 mdo (OUT) - If this function completes successfully, and there is a 1093 map function for this type, 'mdo' points to the selected method 1093 1094 descriptor in the object cache. Otherwise, 'mdo' is null. 1094 1095 REQUIRES: 1095 1) All type accessors require that the type be pinned before calling 1096 any accessor. 1096 1) All type accessors require that the type be pinned before calling 1097 any accessor. 1097 1098 2) All required input parameters must not be NULL and must be valid. 1098 1099 DESCRIPTION: … … 1104 1105 RETURNS: 1105 1106 OCI_SUCCESS if the function completes successfully. 1106 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1107 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1107 1108 OCI_ERROR if 1108 1109 the type does not contain a map function. 1109 1110 NOTES: 1110 The type must be unpinned when the accessed information is no 1111 The type must be unpinned when the accessed information is no 1111 1112 longer needed. 1112 1113 */ … … 1116 1117 /* 1117 1118 NAME: OCITypeMethodOrder - OCI Get the Method's ORder function. 1118 PARAMETERS: 1119 PARAMETERS: 1119 1120 env (IN/OUT) - OCI environment handle initialized in object mode 1120 1121 err (IN/OUT) - error handle. If there is an error, it is … … 1123 1124 OCIErrorGet(). 1124 1125 tdo (IN) - pointer to to the type descriptor in the object cache 1125 mdo (OUT) - If this function completes successfully, and there is a 1126 map function for this type, 'mdo' points to the selected method 1126 mdo (OUT) - If this function completes successfully, and there is a 1127 map function for this type, 'mdo' points to the selected method 1127 1128 descriptor in the object cache. Otherwise, 'mdo' is null. 1128 1129 REQUIRES: 1129 1) All type accessors require that the type be pinned before calling 1130 any accessor. 1130 1) All type accessors require that the type be pinned before calling 1131 any accessor. 1131 1132 2) All required input parameters must not be NULL and must be valid. 1132 1133 DESCRIPTION: … … 1138 1139 RETURNS: 1139 1140 OCI_SUCCESS if the function completes successfully. 1140 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1141 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1141 1142 OCI_ERROR if 1142 1143 the type does not contain a map function. 1143 1144 NOTES: 1144 The type must be unpinned when the accessed information is no 1145 The type must be unpinned when the accessed information is no 1145 1146 longer needed. 1146 1147 */ … … 1149 1150 deprecated extern (C) ub4 OCITypeMethodParams (OCIEnv* env, OCIError* err, OCITypeMethod* mdo); 1150 1151 /* 1151 NAME: OCITypeMethodParams - OCI Get a Method's Number of Parameters. 1152 PARAMETERS: 1152 NAME: OCITypeMethodParams - OCI Get a Method's Number of Parameters. 1153 PARAMETERS: 1153 1154 env (IN/OUT) - OCI environment handle initialized in object mode 1154 1155 err (IN/OUT) - error handle. If there is an error, it is … … 1158 1159 mdo (IN) - pointer to the method descriptor in the object cache 1159 1160 REQUIRES: 1160 1) All type accessors require that the type be pinned before calling 1161 any accessor. 1161 1) All type accessors require that the type be pinned before calling 1162 any accessor. 1162 1163 2) All input parameters must not be NULL and must be valid. 1163 1164 DESCRIPTION: … … 1166 1167 the number of parameters in the method 1167 1168 NOTES: 1168 The type must be unpinned when the accessed information is no 1169 The type must be unpinned when the accessed information is no 1169 1170 longer needed. 1170 1171 */ … … 1174 1175 /* 1175 1176 NAME: OCITypeResult - OCI Get a method's result type descriptor. 1176 PARAMETERS: 1177 PARAMETERS: 1177 1178 env (IN/OUT) - OCI environment handle initialized in object mode 1178 1179 err (IN/OUT) - error handle. If there is an error, it is … … 1181 1182 OCIErrorGet(). 1182 1183 mdo (IN) - pointer to the method descriptor in the object cache 1183 elem (OUT) - If this function completes successfully, 'rdo' points to 1184 elem (OUT) - If this function completes successfully, 'rdo' points to 1184 1185 the selected result (parameter) descriptor in the object cache. 1185 1186 REQUIRES: 1186 1) All type accessors require that the type be pinned before calling 1187 1) All type accessors require that the type be pinned before calling 1187 1188 any accessor. 1188 1189 2) 'elem' MUST be the address of an OCITypeElem pointer. … … 1191 1192 RETURNS: 1192 1193 OCI_SUCCESS if the function completes successfully. 1193 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1194 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1194 1195 OCI_ERROR if 1195 1196 1) any of the required parameters is null. 1196 1197 2) method returns no results. 1197 1198 NOTES: 1198 The method must be unpinned when the accessed information is no 1199 The method must be unpinned when the accessed information is no 1199 1200 longer needed. 1200 1201 */ … … 1203 1204 deprecated extern (C) sword OCITypeParamByPos (OCIEnv* env, OCIError* err, OCITypeMethod* mdo, ub4 position, OCITypeElem** elem); 1204 1205 /* 1205 NAME: OCITypeParamByPos - OCI Get a Parameter in a method By Position. 1206 PARAMETERS: 1206 NAME: OCITypeParamByPos - OCI Get a Parameter in a method By Position. 1207 PARAMETERS: 1207 1208 env (IN/OUT) - OCI environment handle initialized in object mode 1208 1209 err (IN/OUT) - error handle. If there is an error, it is … … 1212 1213 mdo (IN) - pointer to the method descriptor in the object cache 1213 1214 position (IN) - the parameter's position. Positions start at 1. 1214 elem (OUT) - If this function completes successfully, 'elem' points to 1215 elem (OUT) - If this function completes successfully, 'elem' points to 1215 1216 the selected parameter descriptor in the object cache. 1216 1217 REQUIRES: 1217 1) All type accessors require that the type be pinned before calling 1218 any accessor. 1219 DESCRIPTION: 1220 Get a parameter given its position in the method. Positions start 1221 at 1. 1222 RETURNS: 1223 OCI_SUCCESS if the function completes successfully. 1224 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1218 1) All type accessors require that the type be pinned before calling 1219 any accessor. 1220 DESCRIPTION: 1221 Get a parameter given its position in the method. Positions start 1222 at 1. 1223 RETURNS: 1224 OCI_SUCCESS if the function completes successfully. 1225 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1225 1226 OCI_ERROR if 1226 1227 1) any of the required parameters is null. … … 1228 1229 method. 1229 1230 NOTES: 1230 The type must be unpinned when the accessed information is no 1231 The type must be unpinned when the accessed information is no 1231 1232 longer needed. 1232 1233 */ … … 1235 1236 deprecated extern (C) sword OCITypeParamByName (OCIEnv* env, OCIError* err, OCITypeMethod* mdo, oratext* name, ub4 n_length, OCITypeElem** elem); 1236 1237 /* 1237 NAME: OCITypeParamByName - OCI Get a Parameter in a method By Name. 1238 PARAMETERS: 1238 NAME: OCITypeParamByName - OCI Get a Parameter in a method By Name. 1239 PARAMETERS: 1239 1240 env (IN/OUT) - OCI environment handle initialized in object mode 1240 1241 err (IN/OUT) - error handle. If there is an error, it is … … 1245 1246 name (IN) - the parameter's name 1246 1247 n_length (IN) - length (in bytes) of the 'name' parameter 1247 elem (OUT) - If this function completes successfully, 'elem' points to 1248 elem (OUT) - If this function completes successfully, 'elem' points to 1248 1249 the selected parameter descriptor in the object cache. 1249 1250 REQUIRES: 1250 1) All type accessors require that the type be pinned before calling 1251 any accessor. 1252 2) if 'mdo' is not null, it must point to a valid method descriptor 1251 1) All type accessors require that the type be pinned before calling 1252 any accessor. 1253 2) if 'mdo' is not null, it must point to a valid method descriptor 1253 1254 in the object cache. 1254 1255 DESCRIPTION: 1255 Get a parameter given its name. 1256 RETURNS: 1257 OCI_SUCCESS if the function completes successfully. 1258 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1256 Get a parameter given its name. 1257 RETURNS: 1258 OCI_SUCCESS if the function completes successfully. 1259 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1259 1260 OCI_ERROR if 1260 1261 1) any of the required parameters is null. 1261 2) the method does not contain a parameter with the input 'name'. 1262 NOTES: 1263 The type must be unpinned when the accessed information is no 1262 2) the method does not contain a parameter with the input 'name'. 1263 NOTES: 1264 The type must be unpinned when the accessed information is no 1264 1265 longer needed. 1265 1266 */ … … 1269 1270 /* 1270 1271 NAME: OCITypeParamPos - OCI Get a parameter's position in a method 1271 PARAMETERS: 1272 PARAMETERS: 1272 1273 env (IN/OUT) - OCI environment handle initialized in object mode 1273 1274 err (IN/OUT) - error handle. If there is an error, it is … … 1278 1279 name (IN) - the parameter's name 1279 1280 n_length (IN) - length (in bytes) of the 'name' parameter 1280 position (OUT) - If this function completes successfully, 'position' 1281 points to the position of the parameter in the method starting 1281 position (OUT) - If this function completes successfully, 'position' 1282 points to the position of the parameter in the method starting 1282 1283 at position 1. position MUST point to space for a ub4. 1283 elem (OUT) - If this function completes successfully, and 1284 the input 'elem' is not NULL, 'elem' points to the selected 1284 elem (OUT) - If this function completes successfully, and 1285 the input 'elem' is not NULL, 'elem' points to the selected 1285 1286 parameter descriptor in the object cache. 1286 1287 REQUIRES: 1287 1) All type accessors require that the type be pinned before calling 1288 any accessor. 1289 2) if 'mdo' is not null, it must point to a valid method descriptor 1288 1) All type accessors require that the type be pinned before calling 1289 any accessor. 1290 2) if 'mdo' is not null, it must point to a valid method descriptor 1290 1291 in the object cache. 1291 1292 DESCRIPTION: … … 1293 1294 RETURNS: 1294 1295 OCI_SUCCESS if the function completes successfully. 1295 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1296 OCI_INVALID_HANDLE if 'env' or 'err' is null. 1296 1297 OCI_ERROR if 1297 1298 1) any of the parameters is null. 1298 2) the method does not contain a parameter with the input 'name'. 1299 NOTES: 1300 The type must be unpinned when the accessed information is no 1299 2) the method does not contain a parameter with the input 'name'. 1300 NOTES: 1301 The type must be unpinned when the accessed information is no 1301 1302 longer needed. 1302 1303 */ … … 1306 1307 /* 1307 1308 NAME: OCITypeElemParamMode - OCI Get a parameter's mode 1308 PARAMETERS: 1309 PARAMETERS: 1309 1310 env (IN/OUT) - OCI environment handle initialized in object mode 1310 1311 err (IN/OUT) - error handle. If there is an error, it is … … 1315 1316 (represented by an OCITypeElem) 1316 1317 REQUIRES: 1317 1) All type accessors require that the type be pinned before calling 1318 any accessor. 1318 1) All type accessors require that the type be pinned before calling 1319 any accessor. 1319 1320 2) All input parameters must not be NULL and must be valid. 1320 1321 DESCRIPTION: … … 1323 1324 the mode (in, out, or in/out) of the parameter 1324 1325 NOTES: 1325 The type must be unpinned when the accessed information is no 1326 The type must be unpinned when the accessed information is no 1326 1327 longer needed. 1327 1328 */ … … 1330 1331 deprecated extern (C) oratext* OCITypeElemDefaultValue (OCIEnv* env, OCIError* err, OCITypeElem* elem, ub4* d_v_length); 1331 1332 /* 1332 NAME: OCITypeElemDefaultValue - OCI Get the element's Default Value. 1333 PARAMETERS: 1333 NAME: OCITypeElemDefaultValue - OCI Get the element's Default Value. 1334 PARAMETERS: 1334 1335 env (IN/OUT) - OCI environment handle initialized in object mode 1335 1336 err (IN/OUT) - error handle. If there is an error, it is … … 1340 1341 (represented by an OCITypeElem) 1341 1342 d_v_length (OUT) - length (in bytes) of the returned default value. 1342 The caller must allocate space for the ub4 before calling this 1343 The caller must allocate space for the ub4 before calling this 1343 1344 routine. 1344 1345 REQUIRES: 1345 1) All type accessors require that the type be pinned before calling 1346 any accessor. 1346 1) All type accessors require that the type be pinned before calling 1347 any accessor. 1347 1348 2) All input parameters must not be NULL and must be valid. 1348 1349 DESCRIPTION: … … 1352 1353 The default value (text) of the parameter. 1353 1354 NOTES: 1354 The type must be unpinned when the accessed information is no 1355 longer needed. 1356 */ 1357 1355 The type must be unpinned when the accessed information is no 1356 longer needed. 1357 */ 1358 1358 1359 1359 1360 deprecated extern (C) sword OCITypeVTInit (OCIEnv* env, OCIError* err); … … 1376 1377 OCI_ERROR if internal errors occurrs during initialization. 1377 1378 */ 1378 1379 1379 1380 1380 1381 deprecated extern (C) sword OCITypeVTInsert (OCIEnv* env, OCIError* err, oratext* schema_name, ub4 s_n_length, oratext* type_name, ub4 t_n_length, oratext* user_version, ub4 u_v_length); … … 1387 1388 The error recorded in 'err' can be retrieved by calling 1388 1389 OCIErrorGet(). 1389 schema_name (IN, optional) - name of schema associated with the 1390 schema_name (IN, optional) - name of schema associated with the 1390 1391 type. By default, the user's schema name is used. 1391 1392 s_n_length (IN) - length of the 'schema_name' parameter … … 1420 1421 The error recorded in 'err' can be retrieved by calling 1421 1422 OCIErrorGet(). 1422 schema_name (IN, optional) - name of schema associated with the 1423 schema_name (IN, optional) - name of schema associated with the 1423 1424 type. By default, the user's schema name is used. 1424 1425 s_n_length (IN) - length of the 'schema_name' parameter … … 1462 1463 tc - The TypeCode for the type. The Typecode could 1463 1464 correspond to a User Defined Type or a Built-in type. 1464 Currently, the permissible values for User Defined 1465 Currently, the permissible values for User Defined 1465 1466 Types are OCI_TYPECODE_OBJECT for an Object Type 1466 1467 (structured), OCI_TYPECODE_VARRAY for a VARRAY … … 1470 1471 the attribute types. For Collection types, 1471 1472 OCITypeSetCollection() needs to be called. 1472 Subsequently, OCITypeEndCreate() needs to be called 1473 Subsequently, OCITypeEndCreate() needs to be called 1473 1474 to finish the creation process. 1474 1475 The permissible values for Built-in type codes are … … 1497 1498 PARAMETERS: 1498 1499 svchp (IN) - The OCI Service Context. 1499 errhp (IN/OUT) - The OCI error handle. If there is an error, it is 1500 errhp (IN/OUT) - The OCI error handle. If there is an error, it is 1500 1501 recorded in errhp and this function returns 1501 1502 OCI_ERROR. Diagnostic information can be obtained by … … 1524 1525 PARAMETERS: 1525 1526 svchp (IN) - The OCI Service Context. 1526 errhp (IN/OUT) - The OCI error handle. If there is an error, it is 1527 errhp (IN/OUT) - The OCI error handle. If there is an error, it is 1527 1528 recorded in errhp and this function returns 1528 1529 OCI_ERROR. Diagnostic information can be obtained by … … 1600 1601 return param_flag && OCI_TYPEPARAM_REQUIRED; 1601 1602 } 1603 1604 } trunk/bbconv/dbi/oracle/imp/xa.d
r11 r115 1 /**1 /** 2 2 * Oracle import library. 3 3 * … … 7 7 * Oracle 10g revision 2 8 8 * 9 * Import library version 0.0 39 * Import library version 0.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ … … 17 16 const uint XIDDATASIZE = 128; /// Size in bytes. 18 17 const uint MAXGTRIDSIZE = 64; /// Maximum size in bytes of gtrid. 18 19 version (dbi_oracle) { 20 19 21 const uint MAXBQUALSIZE = 64; /// Maximum size in bytes of bqual. 20 22 … … 115 117 const long XAER_DUPID = -8; /// The XID already exists. 116 118 const long XAER_OUTSIDE = -9; /// Resource manager doing work outside global transaction. 119 120 } trunk/bbconv/dbi/pg/PgDatabase.d
r34 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.pg.PgDatabase; 9 6 10 version (Ares) { 11 private import util.string : asString = toString; 12 debug (UnitTest) private import std.io.Console; 13 } else { 14 private import std.string : asString = toString; 15 debug (UnitTest) private import std.stdio; 16 } 7 version (dbi_pg) { 8 9 private import tango.stdc.stringz : toDString = fromStringz, toCString = toStringz; 10 debug (UnitTest) private static import tango.io.Stdout; 11 17 12 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 18 13 private import dbi.pg.imp, dbi.pg.PgError, dbi.pg.PgResult; … … 20 15 /** 21 16 * An implementation of Database for use with PostgreSQL databases. 22 *23 * Bugs:24 * Column types aren't retrieved.25 17 * 26 18 * See_Also: … … 91 83 * 92 84 * See_Also:: 93 * http://www.postgresql.org/docs/8. 1/static/libpq.html85 * http://www.postgresql.org/docs/8.2/static/libpq.html 94 86 */ 95 87 override void connect (char[] params, char[] username = null, char[] password = null) { … … 103 95 params ~= " password=" ~ password ~ ""; 104 96 } 105 connection = PQconnectdb( params.ptr);106 m_errorCode = cast(int)PQstatus(connection);107 if ( m_errorCode != ConnStatusType.CONNECTION_OK && m_errorCode) {108 throw new DBIException( asString(PQerrorMessage(connection)), m_errorCode);97 connection = PQconnectdb(toCString(params)); 98 errorCode = cast(int)PQstatus(connection); 99 if (errorCode != ConnStatusType.CONNECTION_OK && errorCode) { 100 throw new DBIException(toDString(PQerrorMessage(connection)), errorCode); 109 101 } 110 102 } … … 120 112 } 121 113 114 /* Escape a _string using the database's native method, if possible. 115 * 116 * Params: 117 * string = The _string to escape. 118 * 119 * Returns: 120 * The escaped _string. 121 */ 122 override char[] escape (char[] string) { 123 if (string == "") { 124 return string; 125 } 126 127 char[] result; 128 result.length = string.length * 2; 129 130 // It's okay to send string.ptr here because string doesnt need to be 0-term 131 result.length = PQescapeStringConn(connection, result.ptr, string.ptr, string.length, null);; 132 133 return result; 134 } 135 122 136 /** 123 137 * Execute a SQL statement that returns no results. … … 130 144 */ 131 145 override void execute (char[] sql) { 132 PGresult* res = PQexec(connection, (sql.dup ~ "\0").ptr);146 PGresult* res = PQexec(connection, toCString(sql)); 133 147 scope(exit) PQclear(res); 134 m_errorCode = cast(int)PQresultStatus(res);135 if ( m_errorCode != ExecStatusType.PGRES_COMMAND_OK && m_errorCode != ExecStatusType.PGRES_TUPLES_OK) {136 throw new DBIException( asString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE)));148 errorCode = cast(int)PQresultStatus(res); 149 if (errorCode != ExecStatusType.PGRES_COMMAND_OK && errorCode != ExecStatusType.PGRES_TUPLES_OK) { 150 throw new DBIException(toDString(PQerrorMessage(connection)), errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 137 151 } 138 152 } … … 151 165 */ 152 166 override PgResult query (char[] sql) { 153 PGresult* res = PQexec(connection, (sql.dup ~ "\0").ptr);167 PGresult* res = PQexec(connection, toCString(sql)); 154 168 ExecStatusType status = PQresultStatus(res); 155 m_errorCode = cast(int)PQresultStatus(res);156 if ( m_errorCode != ExecStatusType.PGRES_COMMAND_OK && m_errorCode != ExecStatusType.PGRES_TUPLES_OK) {157 throw new DBIException( asString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE)));158 } 159 return new PgResult( res);169 errorCode = cast(int)PQresultStatus(res); 170 if (errorCode != ExecStatusType.PGRES_COMMAND_OK && errorCode != ExecStatusType.PGRES_TUPLES_OK) { 171 throw new DBIException(toDString(PQerrorMessage(connection)), errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 172 } 173 return new PgResult(connection, res); 160 174 } 161 175 … … 171 185 */ 172 186 deprecated override int getErrorCode () { 173 return m_errorCode;187 return errorCode; 174 188 } 175 189 … … 185 199 */ 186 200 deprecated override char[] getErrorMessage () { 187 return m_errorString; 201 return "not implemented"; 202 } 203 204 /** 205 * Get the integer id of the last row to be inserted. 206 * 207 * Returns: 208 * The id of the last row inserted into the database. 209 */ 210 override long getLastInsertID() { 211 // TODO: Somehow use PQoidValue with the last INSERT result 212 return 0; 188 213 } 189 214 190 215 private: 191 216 PGconn* connection; 192 int m_errorCode; 193 char[] m_errorString; 217 int errorCode; 194 218 } 195 219 196 220 unittest { 197 version (Ares) { 198 void s1 (char[] s) { 199 Cout("" ~ s ~ "\n"); 200 } 201 202 void s2 (char[] s) { 203 Cout(" ..." ~ s ~ "\n"); 204 } 205 } else { 206 void s1 (char[] s) { 207 writefln("%s", s); 208 } 209 210 void s2 (char[] s) { 211 writefln(" ...%s", s); 212 } 213 } 221 void s1 (char[] s) { 222 tango.io.Stdout.Stdout(s).newline(); 223 } 224 225 void s2 (char[] s) { 226 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 227 } 214 228 215 229 s1("dbi.pg.PgDatabase:"); … … 231 245 assert (row.get("name") == "John Doe"); 232 246 assert (row.get("dateofbirth") == "1970-01-01"); 233 /** Todo: PostgreSQL type retrieval is not functioning */ 234 //assert (row.getFieldType(1) == FIELD_TYPE_STRING); 235 //assert (row.getFieldDecl(1) == "char(40)"); 247 assert (row.getFieldType(1) == 1042); 248 // assert (row.getFieldDecl(1) == "char(40)"); 236 249 res.finish(); 237 250 … … 259 272 db.close(); 260 273 } 274 275 } trunk/bbconv/dbi/pg/PgError.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.pg.PgError; 6 7 version (dbi_pg) { 8 9 9 10 10 private import dbi.ErrorCode; … … 185 185 return ErrorCode.Unknown; 186 186 } 187 188 } trunk/bbconv/dbi/pg/PgResult.d
r11 r115 1 /**1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.pg.PgResult; 9 6 10 version (Ares) { 11 private static import std.regexp; 12 private import util.string : asString = toString; 7 version (dbi_pg) { 8 9 version (Phobos) { 10 private import std.string : trim = strip, toDString = toString; 13 11 } else { 14 private import std.string : strip, asString = toString; 12 private import tango.stdc.stringz : toDString = fromStringz; 13 private import tango.text.Util : trim; 15 14 } 16 private import dbi. Result, dbi.Row;17 private import dbi.pg.imp ;15 private import dbi.DBIException, dbi.Result, dbi.Row; 16 private import dbi.pg.imp, dbi.pg.PgError; 18 17 19 18 /** … … 25 24 class PgResult : Result { 26 25 public: 27 this (PG result* results) {26 this (PGconn* conn, PGresult* results) { 28 27 this.results = results; 29 28 numRows = PQntuples(results); … … 38 37 */ 39 38 override Row fetchRow () { 40 version (Ares) {41 char[] strip (char[] string) {42 return std.regexp.sub(std.regexp.sub(string, "^[ \t\v\r\n\f]+", ""), " [\t\v\r\n\f]+$", "");43 }44 }45 46 39 if (index >= numRows) { 47 40 return null; … … 49 42 Row r = new Row(); 50 43 for (int a = 0; a < numFields; a++) { 51 r.addField( strip(asString(PQfname(results, a))), strip(asString(PQgetvalue(results, index, a))), "", 0);44 r.addField(trim(toDString(PQfname(results, a))), trim(toDString(PQgetvalue(results, index, a))), "", PQftype(results, a)); 52 45 } 53 46 index++; … … 71 64 const int numFields; 72 65 } 66 } trunk/bbconv/dbi/pg/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 14 public import dbi.pg.PgDatabase, 11 version (dbi_pg) { 12 13 public import dbi.pg.PgDatabase, 15 14 dbi.pg.PgResult, 16 15 dbi.all; 16 17 } trunk/bbconv/dbi/pg/imp.d
r11 r115 5 5 * 6 6 * Version: 7 * PostgreSQL version 8. 1.48 * 9 * Import library version 1.0 37 * PostgreSQL version 8.2.1 8 * 9 * Import library version 1.04 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 14 module dbi.pg.imp; 16 15 17 private import std.c.stdio; 18 16 version (dbi_pg) { 17 18 19 version (Phobos) { 20 private import std.c.stdio; 21 } else { 22 private import tango.stdc.stdio; 23 } 19 24 20 25 version (Windows) { … … 22 27 } else version (linux) { 23 28 pragma (lib, "libpq.a"); 29 } else version (Posix) { 30 pragma (lib, "libpq.a"); 24 31 } else version (darwin) { 25 32 pragma (lib, "libpq.a"); 26 33 } else { 27 static assert (0); 28 } 29 30 version (SSL) { 31 private import ssl; 34 pragma (msg, "You will need to manually link in the PostgreSQL library."); 32 35 } 33 36 … … 209 212 struct pgNotify { 210 213 char* relname; /// Notification condition name. 211 int be_pid; /// Process ID of server process.214 int be_pid; /// Process ID of notifying server process. 212 215 char* extra; /// Notification parameter. 213 216 /* Fields below here are private to libpq; apps should not use 'em */ … … 637 640 638 641 /** 639 * Get the SSL structure associated with a connection.642 * Get the OpenSSL structure associated with a connection. 640 643 * 641 644 * Params: … … 645 648 * The SSL structure used in the connection or null if SSL is not in use. 646 649 */ 647 version (SSL) { 648 SSL* PQgetssl (PGconn* conn); 649 } else { 650 void* PQgetssl (PGconn* conn); 651 } 650 void* PQgetssl (PGconn* conn); 652 651 653 652 /** … … 940 939 /** 941 940 * Deprecated: 942 * These functions have poor error handling, nonblocking transfers, binary data, 941 * These functions have poor error handling, nonblocking transfers, binary data, 943 942 * or easy end of data detection. Use PQputCopyData, PQputCopyEnd, and PQgetCopyData instead. 944 943 */ … … 973 972 */ 974 973 int PQisnonblocking (PGconn* conn); 974 975 /** 976 * todo 977 */ 978 int PQisthreadsafe (); 975 979 976 980 /** … … 1271 1275 1272 1276 /** 1277 * todo 1278 */ 1279 int PQnparams (PGresult* res); 1280 1281 /** 1282 * todo 1283 */ 1284 Oid PQparamtype (PGresult* res, int param_num); 1285 1286 /** 1287 * todo 1288 */ 1289 PGresult* PQdescribePrepared (PGconn* conn, char* stmt); 1290 1291 /** 1292 * todo 1293 */ 1294 PGresult* PQdescribePortal (PGconn* conn, char* portal); 1295 1296 /** 1297 * todo 1298 */ 1299 int PQsendDescribePrepared (PGconn* conn, char* stmt); 1300 1301 /** 1302 * todo 1303 */ 1304 int PQsendDescribePortal (PGconn* conn, char* portal); 1305 1306 /** 1273 1307 * Free all memory associated with a result. This includes all returned strings. 1274 1308 * … … 1565 1599 1566 1600 /** 1567 * 1601 * todo 1568 1602 */ 1569 1603 int PQmblen (char* s, int encoding); 1570 1604 1571 1605 /** 1572 * 1606 * todo 1573 1607 */ 1574 1608 int PQdsplen (char* s, int encoding); 1575 1609 1576 1610 /** 1577 * 1611 * todo 1578 1612 */ 1579 1613 int PQenv2encoding (); 1614 1615 /** 1616 * todo 1617 */ 1618 char* PQencryptPassword (char* passwd, char* user); 1619 1620 } trunk/bbconv/dbi/sqlite/SqliteDatabase.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.sqlite.SqliteDatabase; 9 6 10 version (Ares) { 11 private import util.string : asString = toString; 12 debug (UnitTest) private import std.io.Console; 13 } else { 14 private import std.string : asString = toString; 15 debug (UnitTest) private import std.stdio; 16 } 17 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 7 version (dbi_sqlite) { 8 9 10 private import tango.stdc.stringz : toDString = fromStringz, toCString = toStringz; 11 private import tango.util.log.Log; 12 13 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement, dbi.Registry, dbi.PreparedStatement; 18 14 private import dbi.sqlite.imp, dbi.sqlite.SqliteError, dbi.sqlite.SqliteResult; 19 15 … … 25 21 */ 26 22 class SqliteDatabase : Database { 23 24 private Logger logger; 27 25 public: 28 26 … … 30 28 * Create a new instance of SqliteDatabase, but don't open a database. 31 29 */ 32 this () { 30 this () { 31 logger = Log.getLogger("dbi.sqlite.Database"); 33 32 } 34 33 … … 40 39 */ 41 40 this (char[] dbFile) { 41 logger = Log.getLogger("dbi.sqlite.Database"); 42 42 connect(dbFile); 43 43 } … … 61 61 */ 62 62 override void connect (char[] params, char[] username = null, char[] password = null) { 63 if ((errorCode = sqlite3_open(params, &database)) != SQLITE_OK) { 63 logger.trace("connecting: " ~ params); 64 if ((errorCode = sqlite3_open(toCString(params), &database)) != SQLITE_OK) { 64 65 throw new DBIException("Could not open or create " ~ params, errorCode, specificToGeneral(errorCode)); 65 66 } … … 70 71 */ 71 72 override void close () { 73 logger.trace("closing database now"); 72 74 if (database !is null) { 73 75 if ((errorCode = sqlite3_close(database)) != SQLITE_OK) { 74 throw new DBIException(asString(sqlite3_errmsg(database)), sql,errorCode, specificToGeneral(errorCode));76 throw new DBIException(asString(sqlite3_errmsg(database)), errorCode, specificToGeneral(errorCode)); 75 77 } 76 78 database = null; … … 88 90 */ 89 91 override void execute (char[] sql) { 92 logger.trace("executing: " ~ sql); 90 93 char** errorMessage; 91 this.sql = sql; 92 if ((errorCode = sqlite3_exec(database, sql, null, null, errorMessage)) != SQLITE_OK) { 93 throw new DBIException(asString(sqlite3_errmsg(database)), sql, errorCode, specificToGeneral(errorCode)); 94 if ((errorCode = sqlite3_exec(database, sql.dup.ptr, null, null, errorMessage)) != SQLITE_OK) { 95 throw new DBIException(toDString(sqlite3_errmsg(database)), sql, errorCode, specificToGeneral(errorCode)); 94 96 } 95 97 } … … 108 110 */ 109 111 override SqliteResult query (char[] sql) { 112 logger.trace("querying: " ~ sql); 110 113 char** errorMessage; 111 114 sqlite3_stmt* stmt; 112 this.sql = sql; 113 if ((errorCode = sqlite3_prepare(database, sql, sql.length, &stmt, errorMessage)) != SQLITE_OK) { 114 throw new DBIException(asString(sqlite3_errmsg(database)), sql, errorCode, specificToGeneral(errorCode)); 115 if ((errorCode = sqlite3_prepare(database, toCString(sql), sql.length, &stmt, errorMessage)) != SQLITE_OK) { 116 throw new DBIException(toDString(sqlite3_errmsg(database)), sql, errorCode, specificToGeneral(errorCode)); 115 117 } 116 118 return new SqliteResult(stmt); … … 142 144 */ 143 145 deprecated override char[] getErrorMessage () { 144 return asString(sqlite3_errmsg(database)); 146 return toDString(sqlite3_errmsg(database)); 147 } 148 149 /** 150 * Get the integer id of the last row to be inserted. 151 * 152 * Returns: 153 * The id of the last row inserted into the database. 154 */ 155 override long getLastInsertID() { 156 return sqlite3_last_insert_rowid(database); 145 157 } 146 158 … … 149 161 */ 150 162 151 /**152 * Get the rowid of the last insert.153 *154 * Returns:155 * The row of the last insert or 0 if no inserts have been done.156 */157 long getLastInsertRowId () {158 return sqlite3_last_insert_rowid(database);159 }160 163 161 164 /** … … 172 175 * Get a list of all the table names. 173 176 * 174 * Returns: 177 * Returns: 175 178 * An array of all the table names. 176 179 */ … … 242 245 bool isOpen = false; 243 246 int errorCode; 244 char[] sql;245 247 246 248 /** … … 250 252 char[][] items; 251 253 Row[] rows = queryFetchAll("SELECT name FROM sqlite_master WHERE type='" ~ type ~ "'"); 252 for ( int idx = 0; idx < rows.length; idx++) {253 items ~= rows[i dx].get(0);254 for (size_t i = 0; i < rows.length; i++) { 255 items ~= rows[i].get(0); 254 256 } 255 257 return items; … … 266 268 return false; 267 269 } 270 271 IPreparedStatement createStatement(char[] statement) 272 { 273 sqlite3_stmt* stmt; 274 char* pzTail; 275 int res; 276 if((res = sqlite3_prepare_v2(database, toCString(statement), statement.length, &stmt, &pzTail)) != SQLITE_OK) { 277 char* errmsg = sqlite3_errmsg(db_); 278 logger.error("sqlite3_prepare_v2 for statement: \"" ~ statement ~ "\" returned: " ~ Integer.toUtf8(res) ~ ", errmsg: " ~ toDString(errmsg)); 279 return null; 280 } 281 return new SqlitePreparedStatement(stmt, database); 282 } 268 283 } 269 284 285 private class SqliteRegister : Registerable { 286 287 private Logger logger; 288 289 this() { 290 logger = Log.getLogger("dbi.sqlite"); 291 } 292 293 public char[] getPrefix() { 294 return "sqlite"; 295 } 296 297 public Database getInstance(char[] url) { 298 logger.trace("creating Sqlite database: " ~ url); 299 return new SqliteDatabase(url); 300 } 301 } 302 270 303 unittest { 271 version (Ares) { 272 void s1 (char[] s) { 273 Cout("" ~ s ~ "\n"); 274 } 275 276 void s2 (char[] s) { 277 Cout(" ..." ~ s ~ "\n"); 278 } 279 } else { 280 void s1 (char[] s) { 281 writefln("%s", s); 282 } 283 284 void s2 (char[] s) { 285 writefln(" ...%s", s); 286 } 287 } 304 void s1 (char[] s) { 305 tango.io.Stdout.Stdout(s).newline(); 306 } 307 308 void s2 (char[] s) { 309 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 310 } 288 311 289 312 s1("dbi.sqlite.SqliteDatabase:"); … … 343 366 assert (db.hasView("doesnotexist") == false); 344 367 368 s2("close"); 345 369 db.close(); 346 370 } 371 372 } trunk/bbconv/dbi/sqlite/SqliteError.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.sqlite.SqliteError; 6 7 version (dbi_sqlite) { 9 8 10 9 private import dbi.ErrorCode; … … 83 82 return ErrorCode.Unknown; 84 83 } 84 } trunk/bbconv/dbi/sqlite/SqliteResult.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ 8 5 module dbi.sqlite.SqliteResult; 9 6 10 version (Ares) { 11 private import util.string : asString = toString; 12 } else { 13 private import std.string : asString = toString; 14 } 7 version (dbi_sqlite) { 8 9 private import tango.stdc.stringz : asString = fromStringz; 10 15 11 private import dbi.Result, dbi.Row; 16 12 private import dbi.sqlite.imp; … … 58 54 sqlite3_stmt* stmt; 59 55 } 56 57 } trunk/bbconv/dbi/sqlite/all.d
r11 r115 1 1 /** 2 2 * Authors: The D DBI project 3 *4 * Version: 0.2.45 *6 3 * Copyright: BSD license 7 4 */ … … 12 9 } 13 10 11 version (dbi_sqlite) { 12 14 13 public import dbi.sqlite.SqliteDatabase, 15 14 dbi.sqlite.SqliteResult, 16 15 dbi.all; 16 17 } trunk/bbconv/dbi/sqlite/imp.d
r11 r115 1 /**1 /** 2 2 * SQLite import library. 3 3 * … … 5 5 * 6 6 * Version: 7 * SQLite version 3.3. 88 * 9 * Import library version 0.0 47 * SQLite version 3.3.11 8 * 9 * Import library version 0.05 10 10 * 11 11 * Authors: The D DBI project 12 *13 12 * Copyright: BSD license 14 13 */ 15 16 14 module dbi.sqlite.imp; 15 16 version (dbi_sqlite) { 17 17 18 18 version (Windows) { … … 20 20 } else version (linux) { 21 21 pragma (lib, "libsqlite.so"); 22 } else version (Posix) { 23 pragma (lib, "libsqlite.so"); 22 24 } else version (darwin) { 23 pragma (lib, "libsqlite.so"); 25 pragma (lib, "libsqlite.so"); 24 26 } else { 25 static assert (0); 26 } 27 28 private import std.c.stdarg; 27 pragma (msg, "You will need to manually link in the SQLite library."); 28 } 29 30 version (Phobos) { 31 private import std.c.stdarg; 32 } else { 33 private import tango.stdc.stdarg; 34 } 29 35 30 36 /** … … 171 177 const int SQLITE_IGNORE = 2; /// Don't allow access, but don't generate an error. 172 178 173 const void function(void*) SQLITE_STATIC = cast(void function(void*))0; /// The data doesn't need to be freed by SQLite. 179 const void function(void*) SQLITE_STATIC = cast(void function(void*))0; /// The data doesn't need to be freed by SQLite. 174 180 const void function(void*) SQLITE_TRANSIENT = cast(void function(void*))-1; /// SQLite should make a private copy of the data. 175 181 … … 604 610 */ 605 611 int sqlite3_overload_function (sqlite3* database, char* zFuncName, int nArg); 612 606 613 /** 607 614 * … … 617 624 * 618 625 */ 626 int sqlite3_prepare_v2 (sqlite3* database, char* zSql, int nBytes, sqlite3_stmt** stmt, char** zTail); 627 628 /** 629 * 630 */ 631 int sqlite3_prepare16_v2 (sqlite3* database, void* zSql, int nBytes, sqlite3_stmt** stmt, void** zTail); 632 633 /** 634 * 635 */ 619 636 void sqlite3_progress_handler (sqlite3* database, int n, int function(void*) callback, void* arg); 620 637 … … 813 830 */ 814 831 int sqlite3_value_type (sqlite3_value* value); 832 833 } trunk/bbconv/ini.bnf
r16 r115 2 2 3 3 .import("enki.BaseParser"); 4 .import("std.string"); 5 .import("std.file"); 4 .import("tango.io.device.File"); 6 5 7 6 .define("bool","eoi","true","End of Input"); … … 29 28 30 29 public this(String filename){ 31 String data = cast(String) std.file.read(filename);30 String data = cast(String)File.get(filename); 32 31 super.initalize(data); 33 32 auto res = parse_Syntax(); trunk/bbconv/ini.d
r16 r115 6 6 version(build) pragma(export_version,EnkiUTF8); 7 7 8 debug private import std.stdio;8 debug private import tango.io.Stdout; 9 9 private import enki.types; 10 10 private import enki.BaseParser; 11 private import std.string; 12 private import std.file; 11 private import tango.io.device.File; 13 12 14 13 … … 28 27 29 28 public this(String filename){ 30 String data = cast(String) std.file.read(filename);29 String data = cast(String)File.get(filename); 31 30 super.initalize(data); 32 31 auto res = parse_Syntax(); 33 32 } 34 35 36 33 37 34 /* 38 35 … … 42 39 */ 43 40 public ResultT!(bool) parse_Syntax(){ 44 debug writefln("parse_Syntax()");41 debug Stdout.formatln("parse_Syntax()"); 45 42 uint start1 = position; 46 43 //no declarations … … 63 60 uint start5 = position; 64 61 if((parse_Comment().success) || (parse_Entry().success)){ 62 clearErrors(); 65 63 goto loop5; 66 64 }else{ … … 79 77 goto mismatch2; 80 78 match3: 81 {/*do nothing*/}79 clearErrors(); 82 80 goto match1; 83 81 } 84 82 match1: 85 debug writefln("parse_Syntax() PASS");83 debug Stdout.formatln("parse_Syntax() PASS"); 86 84 return ResultT!(bool)(true); 87 85 mismatch2: … … 98 96 */ 99 97 public ResultT!(String) parse_Entry(){ 100 debug writefln("parse_Entry()");98 debug Stdout.formatln("parse_Entry()"); 101 99 uint start6 = position; 102 100 String bind_key; … … 117 115 uint start10 = position; 118 116 if((parse_ws().success && terminal("=").success)){ 117 clearErrors(); 119 118 goto loopend13; 120 119 }else{ … … 128 127 uint start11 = position; 129 128 if((parse_any().assignCat!(String)(bind_key))){ 129 clearErrors(); 130 130 goto loop12; 131 131 }else{ … … 149 149 uint start14 = position; 150 150 if((parse_Comment().success) || (parse_eol().success)){ 151 clearErrors(); 151 152 goto loopend16; 152 153 }else{ … … 160 161 uint start15 = position; 161 162 if((parse_any().assignCat!(String)(bind_value))){ 163 clearErrors(); 162 164 goto loop15; 163 165 }else{ … … 176 178 goto mismatch9; 177 179 match10: 178 {/*do nothing*/}180 clearErrors(); 179 181 goto match8; 180 182 } 181 183 match8: 182 debug writefln("parse_Entry() PASS");184 debug Stdout.formatln("parse_Entry() PASS"); 183 185 addEntry(bind_key,bind_value); 184 186 return ResultT!(String)(sliceData(start6,position)); … … 195 197 */ 196 198 public ResultT!(bool) parse_Comment(){ 197 debug writefln("parse_Comment()");199 debug Stdout.formatln("parse_Comment()"); 198 200 uint start16 = position; 199 201 //no declarations … … 222 224 uint start20 = position; 223 225 if((parse_any().success)){ 226 clearErrors(); 224 227 goto loop22; 225 228 }else{ … … 238 241 goto mismatch19; 239 242 match20: 240 {/*do nothing*/}243 clearErrors(); 241 244 goto match18; 242 245 } 243 246 match18: 244 debug writefln("parse_Comment() PASS");247 debug Stdout.formatln("parse_Comment() PASS"); 245 248 return ResultT!(bool)(true); 246 249 mismatch19: trunk/bbconv/parser.bnf
r29 r115 2 2 3 3 .import("enki.BaseParser"); 4 .import(" std.stdio");4 .import("tango.io.Stdout"); 5 5 .import("bbcode"); 6 6 … … 23 23 } 24 24 25 writefln("data failed convertion\n[%s]\n[%s]\n",getErrorReport(),bbcode);25 Stdout.formatln("data failed convertion\n[{}]\n[Stdout.formatln{}]\n",getErrorReport(),bbcode); 26 26 return bbcode; 27 27 } trunk/bbconv/parser.d
r29 r115 6 6 version(build) pragma(export_version,EnkiUTF8); 7 7 8 debug private import std.stdio;8 debug private import tango.io.Stdout; 9 9 private import enki.types; 10 10 private import enki.BaseParser; 11 private import std.stdio;11 private import tango.io.Stdout; 12 12 private import bbcode; 13 13 … … 24 24 } 25 25 26 writefln("data failed convertion\n[%s]\n[%s]\n",getErrorReport(),bbcode);26 Stdout.formatln("data failed convertion\n[{}]\n[Stdout.formatln{}]\n",getErrorReport(),bbcode); 27 27 return bbcode; 28 28 } … … 36 36 */ 37 37 public ResultT!(BBCode) parse_Syntax(){ 38 debug writefln("parse_Syntax()");38 debug Stdout.formatln("parse_Syntax()"); 39 39 uint start1 = position; 40 40 BBCodeEntity[] bind_ents; … … 78 78 } 79 79 match1: 80 debug writefln("parse_Syntax() PASS");80 debug Stdout.formatln("parse_Syntax() PASS"); 81 81 ResultT!(BBCode) passed = ResultT!(BBCode)(new BBCode(bind_ents)); 82 82 return passed; … … 95 95 */ 96 96 public ResultT!(BBCodeEntity) parse_BBCodeEntity(){ 97 debug writefln("parse_BBCodeEntity()");97 debug Stdout.formatln("parse_BBCodeEntity()"); 98 98 uint start6 = position; 99 99 BBCodeEntity bind_ent; … … 112 112 } 113 113 match8: 114 debug writefln("parse_BBCodeEntity() PASS");114 debug Stdout.formatln("parse_BBCodeEntity() PASS"); 115 115 return ResultT!(BBCodeEntity)(bind_ent); 116 116 mismatch9: … … 127 127 */ 128 128 public ResultT!(Code) parse_Code(){ 129 debug writefln("parse_Code()");129 debug Stdout.formatln("parse_Code()"); 130 130 uint start8 = position; 131 131 String bind_content; … … 183 183 } 184 184 match10: 185 debug writefln("parse_Code() PASS");185 debug Stdout.formatln("parse_Code() PASS"); 186 186 ResultT!(Code) passed = ResultT!(Code)(new Code(bind_content)); 187 187 return passed; … … 200 200 */ 201 201 public ResultT!(Quote) parse_Quote(){ 202 debug writefln("parse_Quote()");202 debug Stdout.formatln("parse_Quote()"); 203 203 uint start14 = position; 204 204 BBCodeEntity[] bind_ents; … … 307 307 } 308 308 match17: 309 debug writefln("parse_Quote() PASS");309 debug Stdout.formatln("parse_Quote() PASS"); 310 310 ResultT!(Quote) passed = ResultT!(Quote)(new Quote(bind_ents,bind_who)); 311 311 return passed; … … 324 324 */ 325 325 public ResultT!(Bold) parse_Bold(){ 326 debug writefln("parse_Bold()");326 debug Stdout.formatln("parse_Bold()"); 327 327 uint start25 = position; 328 328 BBCodeEntity[] bind_ents; … … 380 380 } 381 381 match31: 382 debug writefln("parse_Bold() PASS");382 debug Stdout.formatln("parse_Bold() PASS"); 383 383 ResultT!(Bold) passed = ResultT!(Bold)(new Bold(bind_ents)); 384 384 return passed; … … 397 397 */ 398 398 public ResultT!(Italics) parse_Italics(){ 399 debug writefln("parse_Italics()");399 debug Stdout.formatln("parse_Italics()"); 400 400 uint start31 = position; 401 401 BBCodeEntity[] bind_ents; … … 453 453 } 454 454 match38: 455 debug writefln("parse_Italics() PASS");455 debug Stdout.formatln("parse_Italics() PASS"); 456 456 ResultT!(Italics) passed = ResultT!(Italics)(new Italics(bind_ents)); 457 457 return passed; … … 470 470 */ 471 471 public ResultT!(Underline) parse_Underline(){ 472 debug writefln("parse_Underline()");472 debug Stdout.formatln("parse_Underline()"); 473 473 uint start37 = position; 474 474 BBCodeEntity[] bind_ents; … … 526 526 } 527 527 match45: 528 debug writefln("parse_Underline() PASS");528 debug Stdout.formatln("parse_Underline() PASS"); 529 529 ResultT!(Underline) passed = ResultT!(Underline)(new Underline(bind_ents)); 530 530 return passed; … … 543 543 */ 544 544 public ResultT!(Image) parse_Image(){ 545 debug writefln("parse_Image()");545 debug Stdout.formatln("parse_Image()"); 546 546 uint start43 = position; 547 547 String bind_url; … … 599 599 } 600 600 match52: 601 debug writefln("parse_Image() PASS");601 debug Stdout.formatln("parse_Image() PASS"); 602 602 ResultT!(Image) passed = ResultT!(Image)(new Image(bind_url)); 603 603 return passed; … … 616 616 */ 617 617 public ResultT!(Url) parse_Url(){ 618 debug writefln("parse_Url()");618 debug Stdout.formatln("parse_Url()"); 619 619 uint start49 = position; 620 620 String bind_url; … … 715 715 } 716 716 match59: 717 debug writefln("parse_Url() PASS");717 debug Stdout.formatln("parse_Url() PASS"); 718 718 ResultT!(Url) passed = ResultT!(Url)(new Url(bind_url,bind_name)); 719 719 return passed; … … 732 732 */ 733 733 public ResultT!(Email) parse_Email(){ 734 debug writefln("parse_Email()");734 debug Stdout.formatln("parse_Email()"); 735 735 uint start59 = position; 736 736 String bind_email; … … 789 789 } 790 790 match73: 791 debug writefln("parse_Email() PASS");791 debug Stdout.formatln("parse_Email() PASS"); 792 792 ResultT!(Email) passed = ResultT!(Email)(new Email(bind_email)); 793 793 return passed; … … 806 806 */ 807 807 public ResultT!(Color) parse_Color(){ 808 debug writefln("parse_Color()");808 debug Stdout.formatln("parse_Color()"); 809 809 uint start64 = position; 810 810 String bind_color; … … 888 888 } 889 889 match80: 890 debug writefln("parse_Color() PASS");890 debug Stdout.formatln("parse_Color() PASS"); 891 891 ResultT!(Color) passed = ResultT!(Color)(new Color(bind_color,bind_ents)); 892 892 return passed; … … 905 905 */ 906 906 public ResultT!(Size) parse_Size(){ 907 debug writefln("parse_Size()");907 debug Stdout.formatln("parse_Size()"); 908 908 uint start73 = position; 909 909 String bind_size; … … 987 987 } 988 988 match90: 989 debug writefln("parse_Size() PASS");989 debug Stdout.formatln("parse_Size() PASS"); 990 990 ResultT!(Size) passed = ResultT!(Size)(new Size(bind_size,bind_ents)); 991 991 return passed; … … 1004 1004 */ 1005 1005 public ResultT!(List) parse_List(){ 1006 debug writefln("parse_List()");1006 debug Stdout.formatln("parse_List()"); 1007 1007 uint start82 = position; 1008 1008 bool bind_isAlpha; … … 1093 1093 } 1094 1094 match100: 1095 debug writefln("parse_List() PASS");1095 debug Stdout.formatln("parse_List() PASS"); 1096 1096 ResultT!(List) passed = ResultT!(List)(new List(bind_isAlpha,bind_isNumeric,bind_ents)); 1097 1097 return passed; … … 1110 1110 */ 1111 1111 public ResultT!(ListItem) parse_ListItem(){ 1112 debug writefln("parse_ListItem()");1112 debug Stdout.formatln("parse_ListItem()"); 1113 1113 uint start91 = position; 1114 1114 bool bind_isStart; … … 1189 1189 } 1190 1190 match109: 1191 debug writefln("parse_ListItem() PASS");1191 debug Stdout.formatln("parse_ListItem() PASS"); 1192 1192 ResultT!(ListItem) passed = ResultT!(ListItem)(new ListItem(bind_isStart,bind_ents)); 1193 1193 return passed; … … 1206 1206 */ 1207 1207 public ResultT!(BBText) parse_StartToken(){ 1208 debug writefln("parse_StartToken()");1208 debug Stdout.formatln("parse_StartToken()"); 1209 1209 uint start100 = position; 1210 1210 String bind_tok; … … 1222 1222 } 1223 1223 match121: 1224 debug writefln("parse_StartToken() PASS");1224 debug Stdout.formatln("parse_StartToken() PASS"); 1225 1225 ResultT!(BBText) passed = ResultT!(BBText)(new BBText(bind_tok)); 1226 1226 return passed; … … 1239 1239 */ 1240 1240 public ResultT!(BBText) parse_BBText(){ 1241 debug writefln("parse_BBText()");1241 debug Stdout.formatln("parse_BBText()"); 1242 1242 uint start102 = position; 1243 1243 String bind_tok; … … 1301 1301 } 1302 1302 match123: 1303 debug writefln("parse_BBText() PASS");1303 debug Stdout.formatln("parse_BBText() PASS"); 1304 1304 ResultT!(BBText) passed = ResultT!(BBText)(new BBText(bind_tok)); 1305 1305 return passed; … … 1318 1318 */ 1319 1319 public ResultT!(Newline) parse_Newline(){ 1320 debug writefln("parse_Newline()");1320 debug Stdout.formatln("parse_Newline()"); 1321 1321 uint start109 = position; 1322 1322 … … 1333 1333 } 1334 1334 match133: 1335 debug writefln("parse_Newline() PASS");1335 debug Stdout.formatln("parse_Newline() PASS"); 1336 1336 ResultT!(Newline) passed = ResultT!(Newline)(new Newline()); 1337 1337 return passed; … … 1349 1349 */ 1350 1350 public ResultT!(bool) parse_UID(){ 1351 debug writefln("parse_UID()");1351 debug Stdout.formatln("parse_UID()"); 1352 1352 uint start111 = position; 1353 1353 //no declarations … … 1409 1409 } 1410 1410 match135: 1411 debug writefln("parse_UID() PASS");1411 debug Stdout.formatln("parse_UID() PASS"); 1412 1412 return ResultT!(bool)(true); 1413 1413 mismatch136:
