CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 SQL Queries

Print topic Send  topic

Author Message
Goce Starkovski
Posted: 06/05/2001, 6:36 AM

Is there a way to make a sql query in CC based od input parameters ?
If parameter, like p_parameter1 is passed from another form, then is it
possible to write something like: select * from emp where name =
:p_parameter1 ?

Hellen
Posted: 06/05/2001, 6:56 AM

Goce,
yes you can do it entering SQL directly into Form/Properties/SQL tab or you
can create necessary SQL statement in any event. It should be like:
(note syntax depends on laguage you use. I give examples for ASP, PHP, JSP)
ASP:
select * from table_name where any_field = " & GetParam("param_name")
PHP:
select * from table_name where any_field = ".get_param("param_name")
JSP:
select * from table_name where any_field = " + getParam( request,
"param_name")
if you put such sql into SQL tab when you'll return back to form youl' get
the error message that sql statement is incorrect, ignore it if you're sure
that its correct. But if you use one table based form you'd better don't use
custom sql and set parameters as input, then they will be included into sql
statement automatically.

Regards,
CC Support

"Goce Starkovski" <gostar123@yahoo.com> wrote in message
news:9fin8r$c05$1@mail.tankhill.com...
> Is there a way to make a sql query in CC based od input parameters ?
> If parameter, like p_parameter1 is passed from another form, then is it
> possible to write something like: select * from emp where name =
> :p_parameter1 ?
>
>

Goce Starkovski
Posted: 06/06/2001, 12:18 AM

The point is this:
I have 1 page with 2 forms. One is tree form reading from one table where
besides the standard columns needed by the form, I have a parameter
column.The other is grid form reading from another table depending on the
value from the tree form's parameter. My wish is when I click on the tree
form, the grid changes accordig to the selection. I thought that exporting
an parameter from the tree form would do the trick.
Could someone point me another solution (besides getParameter), or an
example.
I work in JSP with Tomcat.

Thanks


Hellen <support@codecharge.com> wrote in message
news:9fiof4$d5c$2@mail.tankhill.com...
> Goce,
> yes you can do it entering SQL directly into Form/Properties/SQL tab or
you
> can create necessary SQL statement in any event. It should be like:
> (note syntax depends on laguage you use. I give examples for ASP, PHP,
JSP)
> ASP:
> select * from table_name where any_field = " & GetParam("param_name")
> PHP:
> select * from table_name where any_field = ".get_param("param_name")
> JSP:
> select * from table_name where any_field = " + getParam( request,
> "param_name")
> if you put such sql into SQL tab when you'll return back to form youl' get
> the error message that sql statement is incorrect, ignore it if you're
sure
> that its correct. But if you use one table based form you'd better don't
use
> custom sql and set parameters as input, then they will be included into
sql
> statement automatically.
>
> Regards,
> CC Support
>
> "Goce Starkovski" <gostar123@yahoo.com> wrote in message
>news:9fin8r$c05$1@mail.tankhill.com...
> > Is there a way to make a sql query in CC based od input parameters ?
> > If parameter, like p_parameter1 is passed from another form, then is it
> > possible to write something like: select * from emp where name =
> > :p_parameter1 ?
> >
> >
>
>

Hellen
Posted: 06/06/2001, 8:14 AM

This is a multi-part message in MIME format.

------=_NextPart_000_00BC_01C0EEB6.1B5FDDE0
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

Goce,
in table Tree form based on add a field 'column', also add it to the =
table your Grid form based on.
Then for Grid form set input parameter 'category_id' (it may has other =
name in your table, but it's a parameter existing in both tables and =
passing from Tree form. You set it up as 'Category ID' on the Tree =
form/Properties/Common tab).=20
Futher you should define the next 'Open' event for grid form:
if ( "".equals("pcategory_id")) {

java.sql.Statement stat1 =3D conn.createStatement();

coll =3D dLookUp( stat1, "categories", "col", "category_id =3D " + =
pcategory_id);

sWhere =3D "WHERE category.col=3D" + coll;

}

else {

sWhere =3D "";

}

where "category" is the table Tree form based on

"category_id " is a field existing in both tables and set it up as =
'Category ID' on the Tree form/Properties/Common tab.

Hope it'll help you. If you want I can send you an example of it.

Regards,

CC Support

"Goce Starkovski" <gostar123@yahoo.com> wrote in message =
news:9fklgc$3uf$1@mail.tankhill.com...
> The point is this:
> I have 1 page with 2 forms. One is tree form reading from one table =
where
> besides the standard columns needed by the form, I have a parameter
> column.The other is grid form reading from another table depending on =
the
> value from the tree form's parameter. My wish is when I click on the =
tree
> form, the grid changes accordig to the selection. I thought that =
exporting
> an parameter from the tree form would do the trick.
> Could someone point me another solution (besides getParameter), or an
> example.
> I work in JSP with Tomcat.
>=20
> Thanks
>=20
>=20
> Hellen <support@codecharge.com> wrote in message
>news:9fiof4$d5c$2@mail.tankhill.com...
> > Goce,
> > yes you can do it entering SQL directly into Form/Properties/SQL =
tab or
> you
> > can create necessary SQL statement in any event. It should be like:
> > (note syntax depends on laguage you use. I give examples for ASP, =
PHP,
> JSP)
> > ASP:
> > select * from table_name where any_field =3D " & =
GetParam("param_name")
> > PHP:
> > select * from table_name where any_field =3D =
".get_param("param_name")
> > JSP:
> > select * from table_name where any_field =3D " + getParam( request,
> > "param_name")
> > if you put such sql into SQL tab when you'll return back to form =
youl' get
> > the error message that sql statement is incorrect, ignore it if =
you're
> sure
> > that its correct. But if you use one table based form you'd better =
don't
> use
> > custom sql and set parameters as input, then they will be included =
into
> sql
> > statement automatically.
> >
> > Regards,
> > CC Support
> >
> > "Goce Starkovski" <gostar123@yahoo.com> wrote in message
> >news:9fin8r$c05$1@mail.tankhill.com...
> > > Is there a way to make a sql query in CC based od input parameters =
?
> > > If parameter, like p_parameter1 is passed from another form, then =
is it
> > > possible to write something like: select * from emp where name =3D
> > > :p_parameter1 ?
> > >
> > >
> >
> >
>=20
>=20

------=_NextPart_000_00BC_01C0EEB6.1B5FDDE0
Content-Type: text/html;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dkoi8-r" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Goce,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in table Tree form based on add a field =
'column',=20
also add it to the table your Grid form based on.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Then for Grid form set input parameter=20
'category_id' (it may has other name in your table, but it's a parameter =

existing in both tables and passing from Tree form. You set it up as =
'<SPAN=20
class=3DCapText>Category ID</SPAN>' on the Tree =
form/Properties/Common tab).=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Futher you should define the next =
'Open' event for=20
grid form:</FONT></DIV>
<DIV>
<P>if ( "".equals("pcategory_id")) {</P>
<P>java.sql.Statement stat1 =3D conn.createStatement();</P>
<P>coll =3D dLookUp( stat1, "categories", "col", "category_id =3D " +=20
pcategory_id);</P>
<P>sWhere =3D "WHERE category.col=3D" + coll;</P>
<P>}</P>
<P>else {</P>
<P>sWhere =3D "";</P>
<P>}</P>
<P>where "category" is the table Tree form based on</P>
<P><FONT face=3DArial size=3D2>"category_id " is a field existing in =
both tables and=20
set it up as '<SPAN class=3DCapText>Category ID</SPAN>' on the Tree =

form/Properties/Common tab.</FONT></P>
<P><FONT face=3D"Arial CYR" size=3D2>Hope it'll help you. If you want I =
can send you=20
an example of it.</FONT></P>
<P><FONT face=3D"Arial CYR" size=3D2>Regards,</FONT></P>
<P><FONT face=3DArial size=3D2>CC Support</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2>"Goce Starkovski" <</FONT><A=20
href=3D"mailto:gostar123@yahoo.com"><FONT face=3DArial=20
size=3D2>gostar123@yahoo.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message </FONT><A href=3D"news:9fklgc$3uf$1@mail.tankhill.com"><FONT =
face=3DArial=20
size=3D2>news:9fklgc$3uf$1@mail.tankhill.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> The point is =
this:<BR>> I=20
have 1 page with 2 forms. One is tree form reading from one table =
where<BR>>=20
besides the standard columns  needed by the form, I have a=20
parameter<BR>> column.The other is grid form reading from another =
table=20
depending on the<BR>> value from the tree form's parameter. My wish =
is when I=20
click on the tree<BR>> form, the grid changes accordig to the =
selection. I=20
thought that exporting<BR>> an parameter from the tree form would do =
the=20
trick.<BR>> Could someone point me another solution (besides =
getParameter),=20
or an<BR>> example.<BR>> I work in JSP with Tomcat.<BR>> =
<BR>>=20
Thanks<BR>> <BR>> <BR>> Hellen <</FONT><A=20
href=3D"mailto:support@codecharge.com"><FONT face=3DArial=20
size=3D2>support@codecharge.com</FONT></A><FONT face=3DArial =
size=3D2>> wrote in=20
message<BR>> </FONT><A =
href=3D"news:9fiof4$d5c$2@mail.tankhill.com"><FONT=20
face=3DArial =
size=3D2>news:9fiof4$d5c$2@mail.tankhill.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>> > Goce,<BR>> > yes you can do it =
entering  SQL=20
directly into Form/Properties/SQL tab or<BR>> you<BR>> > can =
create=20
necessary SQL statement in any event. It should be like:<BR>> > =
(note=20
syntax depends on laguage you use. I give examples for ASP, PHP,<BR>> =

JSP)<BR>> > ASP:<BR>> > select * from table_name where =
any_field =3D "=20
& GetParam("param_name")<BR>> > PHP:<BR>> > select * =
from=20
table_name where any_field =3D ".get_param("param_name")<BR>> > =
JSP:<BR>>=20
> select * from table_name where any_field =3D " + getParam( =
request,<BR>>=20
> "param_name")<BR>> > if you put such sql into SQL tab when =
you'll=20
return back to form youl' get<BR>> > the error message that sql =
statement=20
is incorrect, ignore it if you're<BR>> sure<BR>> > that its =
correct.=20
But if you use one table based form you'd better don't<BR>> =
use<BR>> >=20
custom sql and set parameters as input, then they will be included =
into<BR>>=20
sql<BR>> > statement automatically.<BR>> ><BR>> >=20
Regards,<BR>> > CC Support<BR>> ><BR>> > "Goce =
Starkovski"=20
<</FONT><A href=3D"mailto:gostar123@yahoo.com"><FONT face=3DArial=20
size=3D2>gostar123@yahoo.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message<BR>> > </FONT><A =
href=3D"news:9fin8r$c05$1@mail.tankhill.com"><FONT=20
face=3DArial =
size=3D2>news:9fin8r$c05$1@mail.tankhill.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>> > > Is there a way to make a sql query in CC =
based od=20
input parameters ?<BR>> > > If parameter, like p_parameter1 is =
passed=20
from another form, then is it<BR>> > > possible to write =
something=20
like: select * from emp where name =3D<BR>> > > :p_parameter1 =
?<BR>>=20
> ><BR>> > ><BR>> ><BR>> ><BR>> <BR>>=20
</FONT></BODY></HTML>

------=_NextPart_000_00BC_01C0EEB6.1B5FDDE0--
CodeCharge
Posted: 06/06/2001, 9:58 PM

It may be a better idea to do this without the Tree form, just use a Grid
with a URL field, which should point to the same page and output a variable
that you want to pass to the 2nd form.
In the 2nd form specify the same variable/field in the Input section.



"Goce Starkovski" <gostar123@yahoo.com> wrote in message
news:9fklgc$3uf$1@mail.tankhill.com...
> The point is this:
> I have 1 page with 2 forms. One is tree form reading from one table where
> besides the standard columns needed by the form, I have a parameter
> column.The other is grid form reading from another table depending on the
> value from the tree form's parameter. My wish is when I click on the tree
> form, the grid changes accordig to the selection. I thought that exporting
> an parameter from the tree form would do the trick.
> Could someone point me another solution (besides getParameter), or an
> example.
> I work in JSP with Tomcat.
>
> Thanks
>
>
> Hellen <support@codecharge.com> wrote in message
>news:9fiof4$d5c$2@mail.tankhill.com...
> > Goce,
> > yes you can do it entering SQL directly into Form/Properties/SQL tab or
> you
> > can create necessary SQL statement in any event. It should be like:
> > (note syntax depends on laguage you use. I give examples for ASP, PHP,
> JSP)
> > ASP:
> > select * from table_name where any_field = " & GetParam("param_name")
> > PHP:
> > select * from table_name where any_field = ".get_param("param_name")
> > JSP:
> > select * from table_name where any_field = " + getParam( request,
> > "param_name")
> > if you put such sql into SQL tab when you'll return back to form youl'
get
> > the error message that sql statement is incorrect, ignore it if you're
> sure
> > that its correct. But if you use one table based form you'd better don't
> use
> > custom sql and set parameters as input, then they will be included into
> sql
> > statement automatically.
> >
> > Regards,
> > CC Support
> >
> > "Goce Starkovski" <gostar123@yahoo.com> wrote in message
> >news:9fin8r$c05$1@mail.tankhill.com...
> > > Is there a way to make a sql query in CC based od input parameters ?
> > > If parameter, like p_parameter1 is passed from another form, then is
it
> > > possible to write something like: select * from emp where name =
> > > :p_parameter1 ?
> > >
> > >
> >
> >
>
>

Goce Starkovski
Posted: 06/07/2001, 4:43 AM

Many Thanks
I took the less complicated way, thry use of Grid with a URL field,
constructed several nessesary pages, and it worked just fine.
Thanks ALL from CC team for GREAT support.


CodeCharge <support@codecharge.com> wrote in message
news:9fn1m5$is3$1@mail.tankhill.com...
> It may be a better idea to do this without the Tree form, just use a Grid
> with a URL field, which should point to the same page and output a
variable
> that you want to pass to the 2nd form.
> In the 2nd form specify the same variable/field in the Input section.
>
>
>
> "Goce Starkovski" <gostar123@yahoo.com> wrote in message
>news:9fklgc$3uf$1@mail.tankhill.com...
> > The point is this:
> > I have 1 page with 2 forms. One is tree form reading from one table
where
> > besides the standard columns needed by the form, I have a parameter
> > column.The other is grid form reading from another table depending on
the
> > value from the tree form's parameter. My wish is when I click on the
tree
> > form, the grid changes accordig to the selection. I thought that
exporting
> > an parameter from the tree form would do the trick.
> > Could someone point me another solution (besides getParameter), or an
> > example.
> > I work in JSP with Tomcat.
> >
> > Thanks
> >
> >
> > Hellen <support@codecharge.com> wrote in message
> >news:9fiof4$d5c$2@mail.tankhill.com...
> > > Goce,
> > > yes you can do it entering SQL directly into Form/Properties/SQL tab
or
> > you
> > > can create necessary SQL statement in any event. It should be like:
> > > (note syntax depends on laguage you use. I give examples for ASP, PHP,
> > JSP)
> > > ASP:
> > > select * from table_name where any_field = " & GetParam("param_name")
> > > PHP:
> > > select * from table_name where any_field = ".get_param("param_name")
> > > JSP:
> > > select * from table_name where any_field = " + getParam( request,
> > > "param_name")
> > > if you put such sql into SQL tab when you'll return back to form youl'
> get
> > > the error message that sql statement is incorrect, ignore it if you're
> > sure
> > > that its correct. But if you use one table based form you'd better
don't
> > use
> > > custom sql and set parameters as input, then they will be included
into
> > sql
> > > statement automatically.
> > >
> > > Regards,
> > > CC Support
> > >
> > > "Goce Starkovski" <gostar123@yahoo.com> wrote in message
> > >news:9fin8r$c05$1@mail.tankhill.com...
> > > > Is there a way to make a sql query in CC based od input parameters ?
> > > > If parameter, like p_parameter1 is passed from another form, then is
> it
> > > > possible to write something like: select * from emp where name =
> > > > :p_parameter1 ?
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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