Apr 07, 2016; 22:39
Elizabeth K Quigg
Lasso 9.2.3 vs, 9.3 action_param
I did some updating of code from Lasso 8.6 to Lasso 9.2.3 and I was able to use:
[var('id')=(action_param('id'))]
[var('firstname') = action_param('firstname')]
[var('lastname') = action_param('lastname')]
[inline( -host=Array(
-datasource='postgreSQL',
-name=$hostsql,
-port=$portsql,
-username=$usersql,
-password=$pwsql),
-database=$database,
-table='attendees',
'firstname'=$firstname,
'lastname'=$lastname,
-Keyfield='id',
-KeyValue=$id,
-Update)]
Now when I try to run this in Lasso 9.3, it seems totally unhappy with the the parameters.
If I run it as above, I get:
22P02 ERROR: invalid input syntax for integer: "" LINE 1: ...country" = '',"yesno1" = '',"publish" = '' WHERE ("id" = '') ^
None of the strings look right.
So I changed it to use web_request->param
[var('id')=(web_request->param('id'))]
[var('firstname') = web_request->param('firstname')]
[var('lastname') = web_request->param('lastname')]
22P02 ERROR: invalid input syntax for integer: "\x3136" LINE 1: ..."yesno1" = '\x59',"publish" = '\x59' WHERE ("id" = '\x3136') ^
So I think it must want a asString
[var('firstname') = web_request->param('firstname')->asString]
[var('lastname') = web_request->param('lastname')->asString]
22P02 ERROR: invalid input syntax for integer: "\x3136" LINE 1: ...y" = '',"yesno1" = '',"publish" = '' WHERE ("id" = '\x3136') ^
It still is not getting the correct values for the parameters. I decide to do the web_request->param within the inline.
I tried to change it to:
[inline( -host=Array(
-datasource='postgreSQL',
-name=$hostsql,
-port=$portsql,
-username=$usersql,
-password=$pwsql),
-database=$database,
-table='attendees',
'firstname'=(web_request->param('firstname')),
'lastname'=(web_request->param('lastname')),
-Keyfield='id',
-KeyValue=(web_request->param('id’)),
-Update)]
It does not give an error message [error_msg] and [Error_currentError] after the update.
[Error_Msg]<br>
[Error_CurrentError] on update.<br>
[inline( -host=Array(
-datasource='postgreSQL',
-name=$hostsql,
-port=$portsql,
-username=$usersql,
-password=$pwsql),
-database=$database,
-table='attendees',
'firstname'=(web_request->param('firstname')->asString),
'lastname'=(web_request->param('lastname')->asString),
'id'=(web_request->param('id')->asInteger),
-Update)]
Same thing.
I tried putting the actual value of id (16) for a particular record and it did the same thing. After the update code if I do a search, I find the record o.k.,but without the update.
I did not imagine moving from Lasso 9.2.3 to Lasso 9.3 to be so difficult.
It seems very onerous if one has to struggle so to provide the correct parameters to code.
This is my first test with trying to update a record so maybe there is something completely different wrong. I am working with the same development server for PostgreSQL.
Is there something obvious I am doing wrong?
Thanks.
Elizabeth K. Quigg
Education Technology Specialist
Education Office
Fermi National Accelerator Laboratory
630 840 2631 office
ed.fnal.gov<http://ed.fnal.gov/>
liz@fnal.gov<http://person@fnal.gov>
Connect with us!
Facebook <http://www.facebook.com/FermilabEd> | Twitter<http://twitter.com/FermilabEd>
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Apr 08, 2016; 07:45
Jolle Carlestam
Re: Lasso 9.2.3 vs, 9.3 action_param