Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Oracle8: Insert a long RAW Value
Re: Oracle8: Insert a long RAW Value [message #26763 is a reply to message #26761] Wed, 26 May 2010 15:17 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

OK!
The problem is resolved! the problem was: I lock the table in TORA.

Thank you Mirek for help!

I propose to include SqlRaw in Oracle8 class!

The patch is here:
Index: uppsrc/Oracle/Oci8.cpp
===================================================================
--- uppsrc/Oracle/Oci8.cpp	(revision 2421)
+++ uppsrc/Oracle/Oci8.cpp	(working copy)
@@ -69,7 +69,7 @@
 	struct Item {
 		T_OCI8&        oci8;
 		int            type;
-		int16          len;
+		int            len;
 		sb2            ind;
 		ub2            rl;
 		ub2            rc;
@@ -142,6 +142,7 @@
 	void      SetParam(int i, Date d);
 	void      SetParam(int i, Time d);
 	void      SetParam(int i, Sql& refcursor);
+	void      SetRawParam(int i, const String& s);
 
 	void      AddColumn(int type, int len);
 	void      GetColumn(int i, String& s) const;
@@ -296,6 +297,13 @@
 	PrepareParam(i, r.GetOraType(), r.GetMaxLen(), 0, r.GetType());
 }
 
+void OCI8Connection::SetRawParam(int i, const String& s) {
+	int l = s.GetLength();
+	Item& p = PrepareParam(i, SQLT_LBI, l, 0, VOID_V);
+	memcpy(p.Data(), s, l);
+	p.ind = l ? 0 : -1;
+}
+
 class Oracle8RefCursorStub : public SqlSource {
 public:
 	Oracle8RefCursorStub(SqlConnection *cn) : cn(cn) {}
@@ -320,6 +328,9 @@
 		SetParam(i, String());
 	else
 		switch(q.GetType()) {
+		case SQLRAW_V:
+			SetRawParam(i, SqlRaw(q));
+			break;
 		case STRING_V:
 		case WSTRING_V:
 			SetParam(i, String(q));

[Updated on: Wed, 26 May 2010 15:19]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SQLITE3: Bind parameter by name
Next Topic: Access violation since rev 2407
Goto Forum:
  


Current Time: Sun Aug 24 14:13:42 CEST 2025

Total time taken to generate the page: 0.04089 seconds