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 » Convert String to SqlId
Convert String to SqlId [message #19619] Tue, 23 December 2008 16:22 Go to previous message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
I'm using the following code to query my database:

SqlId count("COUNT(*)");
sql * Select(count).From(sqlTable).Where(PRODUKT=="prohibis");


sqlTable is a String. How do i use these String as a SqlId? I get the following errors when compiling:

G:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1048) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 
	'Upp::SqlVal' (or there is no acceptable conversion)
        C:\upp\uppsrc\Core/String.h(297): could be 'Upp::String &Upp::String::operator =(const char *)'
        C:\upp\uppsrc\Core/String.h(298): or       'Upp::String &Upp::String::operator =(const Upp::String &)'
        C:\upp\uppsrc\Core/String.h(299): or       'Upp::String &Upp::String::operator =(Upp::StringBuffer &)'
        while trying to match the argument list '(Upp::String, Upp::SqlVal)'
G:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1052) : error C2668: 'Upp::SqlSelect::From' : ambiguous call to overloaded function
        c:\upp\uppsrc\sql\Sqlexp.h(454): could be 'Upp::SqlSelect &Upp::SqlSelect::From(const Upp::SqlVal &)'
        c:\upp\uppsrc\sql\Sqlexp.h(451): or       'Upp::SqlSelect &Upp::SqlSelect::From(Upp::SqlId)'
        while trying to match the argument list '(Upp::String)'
G:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(1052) : error C2228: left of '.Where' must have class/struct/union
prohibisZA: 1 file(s) built in (0:02.01), 2016 msecs / file, duration = 2047 msecs, parallelization 0%


I get no errors when i replace the String sqlTable with the SqlId KUNDEN which i defined in the schema-file:

sql * Select(count).From(KUNDEN).Where(PRODUKT=="prohibis");


How can i convert my String sqlTable into a SqlId?

[Updated on: Tue, 23 December 2008 16:52]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems with schema-file
Next Topic: Issue with getting data back from a sqlite3 database
Goto Forum:
  


Current Time: Mon Jun 23 18:23:01 CEST 2025

Total time taken to generate the page: 0.03704 seconds