I don't know PostgreSQL, but in general, SQL is the same, in broad strokes across implementations.
The error message:
Query failed: ERROR: syntax error at or near "contact_name_owner"The beginning of the statement:
(SELECTI think the problem is a missing AS in the column alias.
meetings.id ,
meetings.name,
meetings.status,
' ' AS contact_name ,
' ' AS contact_id ,
' ' contact_name_owner ,
' ' contact_name_mod ,
meetings.date_modified ,
jt1.user_name AS assigned_user_name ,
jt1.created_by AS assigned_user_name_owner ,
'Users' AS assigned_user_name_mod,
' ' filename ,
meetings.assigned_user_id ,
'meetings' AS panel_name
FROM meetings LEFT JOIN users AS jt1 ON jt1.id= meetings.assigned_user_id
AND jt1.deleted=0
AND jt1.deleted=0
where
(
meetings.parent_id= 'd3e15dc6-9525-d1b8-63fb-474f614635fa' AND
meetings.parent_type='Leads' AND
meetings.deleted=0 AND
(
meetings.status='Held' OR meetings.status='Not Held'
)
)
AND meetings.deleted=0
) UNION ALL
...
' ' contact_name_ownerIt should be
' ' AS contact_name_ownerIt appears to be missing it in a few places.
Hey, at least you got an error. Sometimes you don't even get an error, it just doesn't work.
3 comments:
Also it pays not to show elaborate SQL errors to the average web user in view of the security risks associated. Instead SQL errors can be written to a log file which can be securely accessed only by the admin
Chrisranjana.com
Php Programmers
1. I didn't write the mess.
2. I didn't port the mess (from MySQL to PostgreSQL)
3. I have to deal with the mess.
Most projects I work on tend to follow your three step approach.
Post a Comment