oracle occi operator new()

上上之杰 2015-01-12 10:23:58
OTT创建的类中 重载了operator new();
void *operator new(size_t size, const oracle::occi::Connection * sess, const OCCI_STD_NAMESPACE::string& table);
但是我 address *addr = new (conn, "Mytable") address("state" , "zip");的时候为什么不能正确的插入表中 。
这问题困扰了我好久了。 有没有人知道我到底错在哪的? 上面的程序我编译成功了,但是就是不能真正插入表中。
求网友助攻
...全文
112 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2015-01-14
  • 打赏
  • 举报
回复
引用 2 楼 u011131596 的回复:
[quote=引用 1 楼 zhao4zhong1 的回复:] 运算符重载是语法糖。 语法糖越甜,编译调试查错越苦! 把有限的生命浪费在品尝/品鉴无穷多种的语法糖中,我认为不值当。
我才不会去重载运算符。 只是那是工具oracle的oTT工具得出来的。我要懂怎么用而已[/quote] 参考oracle自带的例子代码 demo/*.c
Program Name                              Features Illustrated
cdemo81.c                                 Using basic SQL processing with release 8 and later functionality.
cdemo82.c                                 Performing basic processing of user-defined objects.
cdemocor.c                                Using complex object retrieval (COR) to improve performance.
cdemodr1.c,cdemodr2.c,cdemodr3.c          Using INSERT/UPDATE/DELETE statements with RETURNING clause used with basic datatypes, LOBs and REFs.
cdemodsa.c                                Describing information about a table.
cdemodsc.c                                Describing information about an object type.
cdemofo.c                                 Registering and operating application failover callbacks.
cdemolb.c                                 Create and insert LOB data and then read, write, copy, append and trim the data.
cdemolb2.c                                Writing and reading of CLOB/BLOB columns with stream mode and callback functions.
cdemolbs.c                                Writing and reading to LOBs with the LOB buffering system.
cdemobj.c                                 Pinning and navigation of REF object.
cdemorid.c                                Using INSERT, UPDATE, DELETE statements and fetches to get multiple rowids in one round-trip.
cdemoses.c                                Using session switching and migration.
cdemothr.c                                Using the OCIThread package.
cdemosyev.c                               Registering predefined subscriptions and specifying a callback function to be invoked for client notifications (for more information about Advanced Queuing, see Oracle Streams Advanced Queuing User’s Guide and Reference).
ociaqdemo00.c,ociaqdemo01.c,ociaqdemo02.c Advanced queuing.
cdemodp.c,cdemodp_lip.c                   Loading data with the direct path load functions.
cdemdpco.c                                Loading a column object with the direct path load functions.
cdemdpno.c                                Loading a nested column object with the direct path load functions.
cdemdpin.c                                Loading derived type (inheritance) - direct path.
cdemdpit.c                                Loading an object table with inheritance - direct path.
cdemdpro.c                                Loading a reference with the direct path load functions.
cdemdpss.c                                Loading SQL strings with the direct path load functions.
cdemoucb.c,cdemoucbl.c                    Using static and dynamic user callbacks.
cdemoupk.c,cdemoup1.c,cdemoup2.c          Using dynamic user callbacks with multiple packages.
cdemodt.c                                 Datetime and interval example.
cdemosc.c                                 Scrollable cursor.
cdemol2l.c                                Accesses LOBs using the LONG API.
cdemoin1.c                                Inheritance demo which modifies an inherited type in a table and displays a record from the table.
cdemoin2.c                                Inheritance demo to do attribute substitutability.
cdemoin3.c                                Inheritance demo that describes an object, inherited types, object tables, and a sub-table.
cdemoanydata1.c                           Anydata demo. Inserts and selects rows to and from anydata table.
cdemoanydata2.c                           Anydata demo. Creates a type piecewise using OCITypeBeginCreate() and then describes the new type created.
cdemosp.c                                 Session pooling.
cdemocp.c                                 Connection pooling.
cdemocpproxy.c                            Connection pooling with proxy functionality.
cdemostc.c                                Statement caching.
cdemouni.c                                Program for OCI UTF16 API.
nchdemo1.c                                Shows nchar implicit conversion feature and codepoint feature.
赵4老师 2015-01-13
  • 打赏
  • 举报
回复
运算符重载是语法糖。 语法糖越甜,编译调试查错越苦! 把有限的生命浪费在品尝/品鉴无穷多种的语法糖中,我认为不值当。
上上之杰 2015-01-13
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
运算符重载是语法糖。 语法糖越甜,编译调试查错越苦! 把有限的生命浪费在品尝/品鉴无穷多种的语法糖中,我认为不值当。
我才不会去重载运算符。 只是那是工具oracle的oTT工具得出来的。我要懂怎么用而已

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧