RE: PGSQL ext...

"Shay Harding" <sharding-YCNXYxaMkU/[email protected]> Thu, 15 May 2003 05:54:26 -0700
Newsgroups gmane.comp.lang.moto.devel
Message-ID <003001c31ae1$1df27aa0$7500000a@ccbill22ms668m>
getString(int index)

-- OR --

getString(String columnName)


Postgres (as well as MySQL) always retrieves data as char*. The Moto PGSQL
code does all the conversions for other data types.




Shay


> -----Original Message-----
> From: Stefano Corsi [mailto:[email protected]] 
> Sent: Thursday, May 15, 2003 4:15 AM
> To: [email protected]
> Subject: [moto-devel] PGSQL ext...
> 
> 
> Is there a way to retrieve a value from the PGResultSet 
> independently from the 
> column type? In other words, is it possible to retrieve a 
> value without being 
> forced to try a case like this:
> 
> switch (rset.getColumnType(n)) {
> 	case "integer":
> 		int i = rset.getInt(n);
> 	case "String":
> 		String s = rset.getString(n);
> 	...etc...
> }
> 
> I would like to retrive only strings, even if the column type 
> is an int (thus 
> somewhere there must be a conversion...). 
> Is there already a way for doing this in PGSQL.i?
> 
> Thanks,	
> Stefano
> 
> P.S I've used perl a lot, so having differences between data 
> types sometimes 
> is still shocking for me. Perl programmers often forget the 
> difference 
> between apples and grapes, cars and bicycles, cats and dogs. 
> The world tends 
> to become a flattened $ish space.
> What? Should I use two different types of food(for(@animals)) 
> for my $cat and 
> my $dog?

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 5/6/2003