[Thread Prev][Thread Next][Index]

Re: Constraint "text" concatenation MySQL error



Hi Jerome,
The formatting of the text constraint from the UI request is done in two places on your product server:
1. the method getTextConstraint($constraint) in $lasroot/xml/perl/TMAP/
2. the method addConstraint(@constraint_values) in your database driver (TMAPCIMT.pm)

TMAPDBI.pm and TMAPJGOFS.pm both set up log files. If you used these as exmples for your driver, you should have a log file in $lasroot/server/log recording the constraint and formatted mysql request after each product (or error) is generated. You can ask for more debugging in the addConstraint method to see what exactly is going on. I might be able to see something if you send me the code for addConstraint from TMAPCIMT.pm

Joe
--------------------------------------

Jerome King wrote:

Hi all,

I am working on customizing LAS with in-situ data such as CTD data. I am trying to add a constraint where users can choose a specific station. There is an example of this in the LAS documentation pages for JGOFS.

http://ferret.pmel.noaa.gov/LASdoc/serve/cache/53.html

I have followed the example but I am encountering a MySQL error.
I believe it's a concatenation error with the <constraint> of type 'text' that ultimately becomes part of the SQL query. It requires three different menus that are presented in a single line in the user interface.

<menu type="constraint" name="CIMT_StationText">
<item values="sta_std">Standard Station</item>
</menu>
<menu type="constraint" name="CIMT_StationOps">
<item values="=">=</item>
<item values="!=">!=</item>
</menu>
<menu type="constraint" name="CIMT_Stations">
<item values="T100">T100</item>
<item values="T101">T101</item>
<item values="T201">T201</item>
<item values="T301">T301</item>
<item values="T401">T401</item>
<item values="T402">T402</item>
<item values="T501">T501</item>
<item values="T601">T601</item>
<item values="T701">T701</item>
<item values="T702">T702</item>
</menu>

The MySQL error I get is:

DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=,T201' at line 6 at ../xml/perl/TMAP/TMAPCIMT.pm line 329.

The constraint appears fine on the interface and station names are listed correctly in the drop down menu. For some reason the concatenation produces '=,T201" instead of 'T201'.

I have triple checked that I am not missing any parts in my cimt_ui.xml.
I really doubt I should modify anything in my TMAPCIMT.pm driver but I am running out of ideas.

I have contacted Cyndy Chandler at JGOFS for some help but she mentioned that Jon Callahan developed that specific part of coding between the LAS and the JGOFS database so she directed me to the LAS forum.

Thanks for any help on this problem,

Jerome King
Associate Specialist II
Institute of Marine Sciences
CIMT
phone number: (831) 459-5007.




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement