Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Data VARCHAR and TEXT types

A general discussion forum.

Poco::Data VARCHAR and TEXT types

Postby Dece » 23 Mar 2011, 23:58

Hi,

Using Poco::Data library for the first time.
I can successfully connect to a Sybase database using the ODBC SqlServer Testsuite that comes with the download.
My testcase for table creation
Code: Select all
CREATE TABLE Strings (str VARCHAR(32))
, passes successfully but when I try to insert into the table
using
Code: Select all
INSERT INTO Strings VALUES (?)", use(str)
, I get an error back from sybase db server that it is trying to insert TEXT type into VARCHAR field.

I am wondering if there is a way to specify str vector elements are VARCHAR and not TEXT.

Many thanks in advance for your help.

Dece
Dece
 
Posts: 2
Joined: 23 Mar 2011, 23:50

Re: Poco::Data VARCHAR and TEXT types

Postby alex » 24 Mar 2011, 14:50

Just guessing (I don't have Sybase test environment set up), but maybe LONG VARCHAR would do the trick.
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Data VARCHAR and TEXT types

Postby Dece » 24 Mar 2011, 21:16

Thanks Alex. My question here is how do I make my C++ program use string values as VARCHAR instead of TEXT.
At the moment, it seems like Poco is treating std::string as TEXT when I use in the insert sql.

Is there a way in Poco to specify type while doing sql insertion. By that I mean, when I do a record insert, I want to be able to specify the string is a VARCHAR or it is a TEXT.

Thanks again for your help
Dece
Dece
 
Posts: 2
Joined: 23 Mar 2011, 23:50


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron