mindarch
Posts: 30
|
| Posted: 03/22/2006, 11:19 AM |
|
I am using ccs 3.0. I have a form page with a date field and a time field. I need to get these combined to the php time format for use with mktime and strftime later.
So i have code before insert that does this, no problem.
Now I need to use a custom insert, so I choose SQL for the type.
Then for custom insert I am presented with a box with a n area for sql and an area for parameters. Everything I've done seems to fail.
Is there somewhere in the manual that explains how to use and format this sql statement? Is there somewhere here in the forums. I've just spent 3 hours trying to get this working and can't find any documentation to help.
Mostly I don't know how to use the parameter part. Do I need to add a parameter for each field? The ones that get the data from the preceding form, is that a form or control? How to I ad dit to parameter - name, $name, $_POST["name"]? Is the variable specified as name, $name or what? The variable I created, how do I add that here.
Or - is there a way to completely skip using the generated insert and only run a completly custom insert that I put in. I only see ability to do code before or after the insert and the above confusion seems to be the only way to add a custom insert.
Help appreciated. I don't mind using an example or reading in the manual, but I can't find anything that explains this like I seem to need.
_________________
Mind Architecture
stephen@mindarch.com |
 |
 |
peterr
Posts: 5971
|
| Posted: 03/22/2006, 11:52 AM |
|
Hi,
You would need to create a parameter for each form field, with the parameter type = Control. But this is actually done automatically so you shouldn't even have to do much, just modify the generated SQL.
For example I opened a record form in one of the examples and opened the "Custom Insert ..." dialog, then changed the Custom Insert Type from "Table" to "SQL" and now my SQL and all parameters are there.
Here is sample SQL that was created:
"INSERT INTO employees(emp_name, title, department_id) VALUES('{name}', '{title}', {dep_id})"
And all matching parameters were also created. There is also the "Rebuild" button to get all of this rebuilt again. If needed, you may want to look at those existing parameters to see how they were setup.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|