> -----Original Message-----
> From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 2:56 AM
> To: 'Kutler, Christopher '; ''DBI User Group' '
> Subject: RE: Complex SQL statments - Do they work?
> 
> 
> You sure that's an ANSI SQL statement.  Looks like a 
> procedure.  I am not

Yes it's a Transact SQL statement. Should work directly against Sybase as
well but it's not valid ANSI SQL.

Either it needs to be translated through to Perl acting on a result set
(client) or act as a stored procedure (server).

> familiar with SQL Server, but some functions here might be 
> also dependent on
> the tool used to execute this procedure.  You should run as a stored
> procedure, see docs.  Also what error message are you getting 
> and some code
> would be helpful.  Usually procedures should end with ; unlike queries
> inside the string passed to prepare().
> 
> Ilya Sterin
> 
> -----Original Message-----
> From: Kutler, Christopher
> To: 'DBI User Group'
> Sent: 04/17/2001 10:36 AM
> Subject: Complex SQL statments - Do they work?
> 
> Hello All
> 
> I've tried the following SQL statement which does work via SQL Server
> 6.5.
> However, it does't seem to work when I run the same statment through
> DBI:
> 
> select p.pieceref, d.document_id, dd.full_date,
> grant_description, heading,
> convert(varchar(255), document_type_description) as
> document_description,
> physical_format, 
> number_of_folios_etc, language = CASE 
>  when english_indicator = 1 then 'English'
> when french_indicator = 1 then 'French'
> when Latin_indicator = 1 then 'Latin'
>  END, convert(varchar(255), document_note) as document_note,
> names_indicator = CASE names_indicator when 1 then 'includes names of
> individuals' END, 
> goods_indicator = CASE goods_indicator when 1 then 'includes record of
> goods
> assessed' END
>  from list_heading as lh 
> inner join piece_heading as ph on lh.heading_id = ph.heading_id
> inner join piece as p on ph.piece_id = p.piece_id
> left outer join document as d on p.piece_id = d.piece_id
> left outer join document_grant as dg on d.document_id = dg.document_id
> inner join grant_ as g on dg.grant_id = g.grant_id
> inner join document_date as dd on d.document_id = dd.document_id 
> order by p.pieceref
> 
> Any help would be appreciated.
> 
> thanks
> 
> Chris
> 

__________________________________________________________________________
Please Note :
Only  the intended recipient is authorised to access or use this e-mail.  If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately.   The contents
of this e-mail are the writer's 
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.

We use virus scanning software but exclude all liability for viruses or
similar in any attachment.


Reply via email to