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 » GUID column in DB and SqlArray (how to use GUID column in database app)
Re: GUID column in DB and SqlArray [message #46217 is a reply to message #46124] Sun, 27 March 2016 11:48 Go to previous messageGo to previous message
LamerDrv is currently offline  LamerDrv
Messages: 3
Registered: March 2016
Junior Member
Thank you for answer.
Unfortunately, it is appears that handling with GUID, SQL on Upp exceeds my knowledge Confused

First I try direct use the COLUMN_ macros
TABLE_(Customer)
COLUMN_ ("uniqueidentifier", GUID, ID, 0, 0)
...
END_TABLE
and get
error C2664: 'Upp::FieldOperator &Upp::FieldOperator::operator ()(const char *,Upp::Ref)': cannot convert argument 2 from 'GUID' to 'bool &'
when compiling sch-file.
As far as I understanding the data types for db-fields must support Ref.
Then I try to use the Uuid type but get same error.

Then I try to make UGLY fix Smile) for make the Uuid be Ref-compatible:
struct Uuid2 : Uuid
{
	operator Ref() const {return Ref((Value)*this);}
	Uuid2& operator=(const Nuller&){SetNull(); return *this; }
};


After this the compiler passed sch-file
TABLE_(Customer)
COLUMN_ ("uniqueidentifier", Uuid2, ID, 0, 0)
...
END_TABLE

But when I call SqlArray.Query() I get error:
"[Microsoft][SQL Server Native Client 11.0]Numeric value out if range"

Eventually ... I made "simple" call
SQL.Execute("select ID from Customer");
and got same error.

This error is generated by ODBC-function SQLGetData (inside "default" branch of switch in ODBCConnection::Fetch0, ODBC.cpp):
if(!IsOk(SQLGetData(session->hstmt, i + 1, ct, &tm, 0, &li)))
  break;

It is appears, Upp can't execute select query on uniquieidentifier field.
On this point I get stuck.

[Updated on: Sun, 27 March 2016 11:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to close a sqlite session
Next Topic: I am trying to have two sqls one to read another to write
Goto Forum:
  


Current Time: Mon Jun 10 02:49:21 CEST 2024

Total time taken to generate the page: 0.01201 seconds