c++ oracle超过4000字节字符串写入clob类型用sql语句报错

WinHao 2013-06-27 05:13:15
1、使用工具是vs2088,语言是c++
2、字段的类型是clob类型,在字符串长度较小时使用SQL语句插进去是可以的,但是当字符串长度超过一定长度的时候就会报错,提示“字符串长度太长”
3、我在网上查询了一下,可以使用参数的方法,把字符串转换然后再写进入数据库,不知道这种方法是怎么实现的?最好写一个列子,把代码贴出来!
...全文
248 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
橡木疙瘩 2013-06-28
  • 打赏
  • 举报
回复
下面的是C#的代码,参照一下吧。 如果你用的是ADO组件,应该差不多,否则参照你用的数据库连接引擎的文档,对照着写就是了。 http://bbs.csdn.net/topics/390497593
WinHao 2013-06-28
  • 打赏
  • 举报
回复
神马情况!看不懂
赵4老师 2013-06-27
  • 打赏
  • 举报
回复
demo\*.*:
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.
Dobzhansky 2013-06-27
  • 打赏
  • 举报
回复
查驱动的文档

65,187

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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