Hi,

On Wed, 19 Feb 2003, Stefan Wintermeyer wrote:

> > > > the keyword "as" is not accepted by SAPDB and its right. IMHO is this
> > > > keyword not allowed here.
> > > Is it working if you use the same statement without "as"?
> >
> > SELECT bla FROM relation1 AS rel1 is a valid SQL statement since SQL92.
> > I'm suprised SAPDB doesn't support this...it does, I found the
> > aproperiate entry in die SAB DB LIBRARY
> > (http://www.sapdb.org/7.4/htmhelp/e2/55683ab81fd846e10000000a11402f/frameset.htm, 
>see Reference Manual -> Basic Elements -> Names -> Reference Name).
> > Wolfgang, could you please check if this works for you and provide us a
> > working SABDB SQL example? We could see if we can lay low and keep it
> > generic or if we have to write specific modules for specific databases
>
> Maybe that is fare to simple, but did you try "AS" in stead of "as" in
> the statement? Maybe SAPDB is stricter with this. Just an idea.

I've tried it:

  Message: [SAP AG][LIBSQLOD SO][SAP DB]Syntax error or access
violation;-3008 POS(216) Invalid keyword or missing delimiter.
(SQL-42000)(DBD: st_prepare/SQLPrepare err=-1), SQL: 'SELECT t.queue_id,
a.ticket_id, a.id, ast.name, a.incoming_time,  q.name, q.escalation_time,
t.tn  FROM  article a, article_sender_type ast, queue q, ticket t,
ticket_state tsd, ticket_lock_type slt, group_user AS ug  WHERE  tsd.id =
t.ticket_state_id  AND  slt.id = t.ticket_lock_id  AND  ast.id =
a.article_sender_type_id  AND  t.id = a.ticket_id  AND  q.id = t.queue_id
AND  q.group_id = ug.group_id  AND  tsd.name in ( 'open', 'new', 'pending
auto close-', 'pending auto close+', 'pending reminder' )  AND  slt.name
in ( 'unlock', 'tmp_lock' )  AND  ug.user_id = 1  AND  ast.name =
'customer'  AND  t.ticket_answered != 1  AND  q.escalation_time != 0
ORDER BY t.ticket_priority_id, a.incoming_time DESC'

so it's the same for "as" and "AS" :-(

It works if AS is avoided and this shouldn't break the sense of the
statement?

The reference manual is for SAPDB 7.4. I'm using 7.3.0.29. Perhaps this
could be a problem, but I don't think so.
AS is working in SELECT bla AS blub but not behind FROM or WHERE.

I found some other problems after fixing those:

- you use "SELECT count(*) AS count" but count is a reserved identifier
  within SAPDB
- LIMIT [n] is not possible in SAPDB and is a proprietary PostgreSQL and
  MySQL addon IMHO

CU,
 Wolfgang


_______________________________________________
OpenTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to