Gossamer Forum
Home : Products : Gossamer Links : Discussions :

GT::Condition eq/= Questions

Quote Reply
GT::Condition eq/= Questions
I am looking at an example in the docs for GT::Condition:

'Employer', '=', 'Gossamer Threads'

Shouldn't the '=' be an 'eq', if not why?

I am currently have troubles with this in one of my select statements which fails to return hits even though there is a match:

$cond = GT::SQL::Condition->new( 'Username', 'eq', $USER->{Username}, 'VIN', 'eq', $VIN);
$vt->select( GT::SQL::Condition->new( $cond ) );
if (! $vt->hits ) { etc....

Thanks

EDIT: I just tried the statements with '=' and this seemed to work, and I guess that answers my question. So would I be right in assuming that '=' works for both strings and integers in the SQL::Condition statements and that I should NOT use 'eq'?


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jul 6, 2002, 6:59 PM
Quote Reply
Re: [Ian] GT::Condition eq/= Questions In reply to
The condition object builds SQL "WHERE" statements. So 'Employer', '=', 'Gossamer Threads' will be turned into ... Employer = 'Gossamer Threads'. Changing the condition to 'like' will create the condition ... Employer LIKE 'Gossamer Threads'. The compare never happens in perl so you don't need the "eq".

Hopefully I wasn't too confusing. Wink
Quote Reply
Re: [Ian] GT::Condition eq/= Questions In reply to
Yes, the following operaters can be used accross MOST SQL database applications:

> equals greater than
< equals less than
<> equals NOT
IS equals is
IS NOT equals IS NOT
>= equals greater than or equal to
<= equals less than or equal to
= equals = or eq (equals)

For more info, search for SQL operators via Google or even MySQL web site.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Aki] GT::Condition eq/= Questions In reply to
Hi,

Thanks both... much clearer now, thanks! Cool


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] GT::Condition eq/= Questions In reply to
The LIKE operator is not very straightforward in terms of what string you are querying...

Examples:

SomeColumn LIKE 'gossamer%'
SomeColumn LIKE '%gossamer'
SomeColumn LIKE '%gossamer%'

BTW: Didn't you state before that you worked with TSQL via stored procedures in SQL Server? If so, the foundation of TSQL is SQL statements.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] GT::Condition eq/= Questions In reply to
Yes, I have worked with MS SQL, breifly.

I have the like operator working well already, thanks for the examples too.

The confusing issue was the sql::condition using sql operators rather than the perl equivilents.

Thanks


http://www.iuni.com/...tware/web/index.html
Links Plugins