| View previous topic :: View next topic |
| Author |
Message |
Borland newsgroup Guest
|
Posted: Mon Jul 14, 2003 3:35 pm Post subject: Datasnap..parameters |
|
|
Hello!
How do I send parameters from a client application to a server application ?
I want to send a value to fill an SQL -statement on the server side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
I'm using a Datasnap-server and Client.
Is there a better way to do this?
Is there some whitepapers about this?
Where can I find some examples?
Suggestions...
Regards
/Anders
---------------------------------
|
|
| Back to top |
|
 |
Natalie Brondolo Guest
|
Posted: Mon Jul 14, 2003 3:49 pm Post subject: Re: Datasnap..parameters |
|
|
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote
| Quote: | Hello!
How do I send parameters from a client application to a server application
?
I want to send a value to fill an SQL -statement on the server side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
|
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Mon Jul 14, 2003 4:17 pm Post subject: Re: Datasnap..parameters |
|
|
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote
| Quote: | "Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
Natalie Brondolo Guest
|
Posted: Mon Jul 14, 2003 4:48 pm Post subject: Re: Datasnap..parameters |
|
|
"Anders" <it99ama (AT) du (DOT) se> wrote
| Quote: | It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
|
The code sample that I gave you works for us. We don't use ADO, however. I
am not sure if something is different when using ADO. Did you set the SQL
and also set up the Parameters property of your TADOQuery?
- Natalie
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Tue Jul 15, 2003 6:22 am Post subject: Re: Datasnap..parameters |
|
|
I did set up the parameters on the server TADOQuery, and the sql:
Select* from publishers where pub_id =:in_param
then the in_param came up in the parameters list...
/Anders
----------------------------------------------
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote
| Quote: | "Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f12d782 (AT) newsgroups (DOT) borland.com...
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
The code sample that I gave you works for us. We don't use ADO, however. I
am not sure if something is different when using ADO. Did you set the SQL
and also set up the Parameters property of your TADOQuery?
- Natalie
|
|
|
| Back to top |
|
 |
William Buchanan Guest
|
Posted: Tue Jul 15, 2003 7:48 am Post subject: Re: Datasnap..parameters |
|
|
You need to setup the params on the client ClientDataSet!
Will
"Anders" <it99ama (AT) du (DOT) se> wrote
| Quote: | It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote in message
news:3f12d05d$1 (AT) newsgroups (DOT) borland.com...
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Tue Jul 15, 2003 8:42 am Post subject: Re: Datasnap..parameters |
|
|
Thanx!
I've done that, but the exact question is:
1.How do I send the parameters to the server?
2.How do I recieve them on the server?
The code I got earlier:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
Is as I understood it, this the way to set the value of the" in_param", but
how do I send it to the server?
And how do I set the parameter on the server side to that value?
/Anders
-----------------------------------------------------------------
"William Buchanan" <wbuchanan_NO_SPAM (AT) eims (DOT) biz> wrote
| Quote: | You need to setup the params on the client ClientDataSet!
Will
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f12d782 (AT) newsgroups (DOT) borland.com...
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote in message
news:3f12d05d$1 (AT) newsgroups (DOT) borland.com...
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Tue Jul 15, 2003 9:05 am Post subject: Re: Datasnap..parameters |
|
|
Seems to work now!
Thanx for all the help;-)
Regards
/Anders
-----------------------------------------------------------------
"Anders" <it99ama (AT) du (DOT) se> wrote
| Quote: | Thanx!
I've done that, but the exact question is:
1.How do I send the parameters to the server?
2.How do I recieve them on the server?
The code I got earlier:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
Is as I understood it, this the way to set the value of the" in_param",
but
how do I send it to the server?
And how do I set the parameter on the server side to that value?
/Anders
-----------------------------------------------------------------
"William Buchanan" <wbuchanan_NO_SPAM (AT) eims (DOT) biz> wrote in message
news:3f13b1a2 (AT) newsgroups (DOT) borland.com...
You need to setup the params on the client ClientDataSet!
Will
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f12d782 (AT) newsgroups (DOT) borland.com...
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a
configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server
where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote in message
news:3f12d05d$1 (AT) newsgroups (DOT) borland.com...
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server
side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
William Buchanan Guest
|
Posted: Tue Jul 15, 2003 9:17 am Post subject: Re: Datasnap..parameters |
|
|
No problem
The params get sent automatically so you do not need to worry about them.
Regards
Will
"Anders" <it99ama (AT) du (DOT) se> wrote
| Quote: | Seems to work now!
Thanx for all the help;-)
Regards
/Anders
-----------------------------------------------------------------
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f13be65 (AT) newsgroups (DOT) borland.com...
Thanx!
I've done that, but the exact question is:
1.How do I send the parameters to the server?
2.How do I recieve them on the server?
The code I got earlier:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
Is as I understood it, this the way to set the value of the" in_param",
but
how do I send it to the server?
And how do I set the parameter on the server side to that value?
/Anders
-----------------------------------------------------------------
"William Buchanan" <wbuchanan_NO_SPAM (AT) eims (DOT) biz> wrote in message
news:3f13b1a2 (AT) newsgroups (DOT) borland.com...
You need to setup the params on the client ClientDataSet!
Will
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f12d782 (AT) newsgroups (DOT) borland.com...
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a
configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server
where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote in message
news:3f12d05d$1 (AT) newsgroups (DOT) borland.com...
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server
side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Tue Jul 15, 2003 9:26 am Post subject: Re: Datasnap..parameters |
|
|
Yes I found out that by my self
/Anders
"William Buchanan" <wbuchanan_NO_SPAM (AT) eims (DOT) biz> wrote
| Quote: | No problem
The params get sent automatically so you do not need to worry about them.
Regards
Will
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f13c3c2$2 (AT) newsgroups (DOT) borland.com...
Seems to work now!
Thanx for all the help;-)
Regards
/Anders
-----------------------------------------------------------------
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f13be65 (AT) newsgroups (DOT) borland.com...
Thanx!
I've done that, but the exact question is:
1.How do I send the parameters to the server?
2.How do I recieve them on the server?
The code I got earlier:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
Is as I understood it, this the way to set the value of the"
in_param",
but
how do I send it to the server?
And how do I set the parameter on the server side to that value?
/Anders
-----------------------------------------------------------------
"William Buchanan" <wbuchanan_NO_SPAM (AT) eims (DOT) biz> wrote in message
news:3f13b1a2 (AT) newsgroups (DOT) borland.com...
You need to setup the params on the client ClientDataSet!
Will
"Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f12d782 (AT) newsgroups (DOT) borland.com...
It still doesn't work, can't find the in_param!!!
More suggestions?
I'm a newbie in borland delphi so it could very well be a
configuration
problem....
But I still think that I'm on the right track.....
To be clear:
-I want to send params from a client app. to a middle tier server
where
SQL-statements are stored(ADOQuery)..
-the param is an argument in a statement...
-I'm working against a SQL-Server database..
-Do I need a ADOQuery on the client aswell? Or can I send the
param.through
the ClientDataset?
I would be very grateful for a code example....
/Anders
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote in message
news:3f12d05d$1 (AT) newsgroups (DOT) borland.com...
"Borland newsgroup" <it99ama (AT) du (DOT) se> wrote in message
news:3f12cdaf$1 (AT) newsgroups (DOT) borland.com...
Hello!
How do I send parameters from a client application to a server
application
?
I want to send a value to fill an SQL -statement on the server
side.
Ex. Server: SELECT* FROM customers WHERE cust_id =:in_param
in_param should come from the client side!
Try something like the following on the client:
MyClientDataSet.FetchParams;
MyClientDataSet.Params.ParamByName('in_param').Value := 5;
MyClientDataSet.Open;
- Natalie
|
|
|
| Back to top |
|
 |
Natalie Brondolo Guest
|
Posted: Tue Jul 15, 2003 11:45 am Post subject: Re: Datasnap..parameters |
|
|
"Anders" <it99ama (AT) du (DOT) se> wrote
| Quote: | Seems to work now!
Thanx for all the help;-)
|
What did you have to do differently from what I suggested?
- Natalie
|
|
| Back to top |
|
 |
Anders Guest
|
Posted: Tue Jul 15, 2003 1:02 pm Post subject: Re: Datasnap..parameters |
|
|
Well I used the code you gave me!
ClientDataset4.Params.ParamByName('clientpub_id').Value:='0877'
Except from:
MyClientDataSet.FetchParams;
MyclientDataSet.Open
It didn't seem to matter if was there or not...
But there was some small settings that I missed too... :-/
Thanx!
/Anders
-----------------------
"Natalie Brondolo" <natalieb-at-sirs-dot-com> wrote
| Quote: | "Anders" <it99ama (AT) du (DOT) se> wrote in message
news:3f13c3c2$2 (AT) newsgroups (DOT) borland.com...
Seems to work now!
Thanx for all the help;-)
What did you have to do differently from what I suggested?
- Natalie
|
|
|
| Back to top |
|
 |
|