CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 SQL search

Print topic Send  topic

Author Message
sarah65536

Posts: 13
Posted: 12/05/2007, 1:32 AM

Hi :-D

I would like to do a research on a field whithout making difference between upper case and lower case.
s_field is the field of the form.
table.field is from database

To do that, there are 3 functions :
upper()
lower()
ILIKE

But I can't use them. because where I wrote my SQL request I have two choices of condition parameters or expression.
In parameters there are list box which permit to choose what we need. name, type and format of the field, the condition and the source of parameter.
In expression I wrote everything, but it does'nt accept variable.

example
parameter

field : table.field
condition : LIKE
source : s_field
then, codecharge make alone the request :
table.field LIKE '%{s_field}%'

expression
in first, in expresision put " table.field LIKE '%{s_field}%'"
but, when I publish the page, in does'nt put the same result that with parameter's solution. So I can't put ILIKE or upper() or lower(), because using the same thing, it does'nt work.

Now I've explained the problem, I'd like somebody helps me.


_____________________________________________________________________________

I'm french and I did my possible to explain correctly my problem, so, I hope you understand everything
View profile  Send private message
wkempees
Posted: 12/05/2007, 2:15 AM

If you are using PhP/MySQL (not sure about the others)
Search i case insensitive by default.
Meaning, you do not have to do anything.

Walter

"sarah65536" <sarah65536@forum.codecharge> schreef in bericht
news:24756703d8e48a@news.codecharge.com...
> Hi :-D
>
> I would like to do a research on a field whithout making difference
> between
> upper case and lower case.
> s_field is the field of the form.
> table.field is from database
>
> To do that, there are 3 functions :
> upper()
> lower()
> ILIKE
>
> But I can't use them. because where I wrote my SQL request I have two
> choices
> of condition parameters or expression.
> In parameters there are list box which permit to choose what we need.
> name,
> type and format of the field, the condition and the source of parameter.
> In expression I wrote everything, but it does'nt accept variable.
>
> example
> parameter
>
> field : table.field
> condition : LIKE
> source : s_field
> then, codecharge make alone the request :
> table.field LIKE '%{s_field}%'
>
> expression
> in first, in expresision put " table.field LIKE '%{s_field}%'"
> but, when I publish the page, in does'nt put the same result that with
> parameter's solution. So I can't put ILIKE or upper() or lower(), because
> using
> the same thing, it does'nt work.
>
> Now I've explained the problem, I'd like somebody helps me.
>
>
> _____________________________________________________________________________
>
> I'm french and I did my possible to explain correctly my problem, so, I
> hope you understand everything

> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

sarah65536

Posts: 13
Posted: 12/05/2007, 2:21 AM

thank you for your reply. :-)

euh... Where You do that ? in codecharge ? or in the database ?
Cause in codecharge I search a long time and I didn't find.
I will search in postgres.

View profile  Send private message
Oper


Posts: 1195
Posted: 12/05/2007, 4:56 AM

sarah what type is teh field you are looking for VARCHAR?

also UTF8?

cuase if you using UTF8 format you "B" = "b" is false
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
sarah65536

Posts: 13
Posted: 12/05/2007, 6:13 AM

Quote :
sarah what type is teh field you are looking for VARCHAR?

also UTF8?

cuase if you using UTF8 format you "B" = "b" is false
_______________________________________________________________________________


the type field I looking for is "text". it's not VARCHAR cause it don't have a limit size.


I know that whith UTF8, 'B' is diferent of 'b'. But I have to use it because I need accents.


Do you know how can I do whithout changing it ?

thank you

View profile  Send private message
datadoit
Posted: 12/05/2007, 6:35 AM

To get more granular control over your SQL, you will need to switch to
Data Source Type: SQL, or dynamically modify your WHERE parameter(s).

See:
http://docs.codecharge.com/studio32/html/ProgrammingTec...Clause.html?toc

sarah65536

Posts: 13
Posted: 12/05/2007, 6:39 AM

:-D Thank you :-D
I'll see that

View profile  Send private message
Oper


Posts: 1195
Posted: 12/05/2007, 1:20 PM

Sara we use the accented char

like Teléfono, Solución etc, since our main
core is in Spanish

if you use Latin1 generic you wont have that isue (we are using right now without isue)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
matheus

Posts: 386
Posted: 12/06/2007, 3:20 AM

Sarah, which in your database?

In PostgreSQL, I change the LIKE condition from Codecharge, to ILIKE.

I used Java.

Send more information about your project (language, database).

_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
sarah65536

Posts: 13
Posted: 12/07/2007, 12:03 AM

this is good idea, but I can't change it in Potgres, because, in future, it is possible I change of database. So I have to use SQL language and not postgres language. That's why I have to change it in codechare and not in postgres.

It was a very good idea, but I can't use it. thank you for it .


PS : to do my project, I use PHP language, and my database is Postgres
View profile  Send private message
datadoit
Posted: 12/07/2007, 6:09 AM

sarah65536 wrote:
> this is good idea, but I can't change it in Potgres, because, in future, it is
> possible I change of database. So I have to use SQL language and not postgres
> language. That's why I have to change it in codechare and not in postgres.
>
> It was a very good idea, but I can't use it. thank you for it .
>
>
> PS : to do my project, I use PHP language, and my database is Postgres
> ---------------------------------------

Sounds like you will need to determine what type of database you're
running, then adjust your WHERE parameter accordingly.

if (running postgresql) {
$Container->ds->Where .= "field ILIKE 'Whatever'";
}
else {
$Container->ds->Where .= "field LIKE 'Whatever'";
}

I don't know how to determine what database you're running. I'm sure
there's a variable hidden somewhere in CodeCharge that hold's this. May
even be a PHP function that will get this for you.
asaavedra

Posts: 15
Posted: 12/07/2007, 7:10 AM

Quote :
this is good idea, but I can't change it in Potgres, because, in future, it is possible I change of database. So I have to use SQL language and not postgres language. That's why I have to change it in codechare and not in postgres.

If you're on PHP5, I suggest using Propel (http://propel.phpdb.org/trac/).

And for the utf8 part:
Quote :
sarah what type is teh field you are looking for VARCHAR?

If your collation is binary, then you're right, "a" is different from "A". But if your collation is anything else, "a" is the same as "A".

HTH,

A. Saavedra
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.