Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

when I run the following as a sql statment I get my result, but whenI try and create a view of it I get errors.

 

SELECT TestID, AssyRev, SalesRev, (select passfail from tblpassfail where tblPFtestdata.PFcurrentl = tblpassfail.PFID)
AS PFCurrentL, (select passfail from tblpassfail where tblPFtestdata.PFcurrentNL = tblpassfail.PFID)
AS PFCurrentNL
FROM LIBTEST.tblPFtestData

 

CREATE VIEW qryPFtest AS SELECT TestID, AssyRev, SalesRev, 
([color=red]select[/color] passfail from tblpassfail where tblPFtestdata.PFcurrentl = tblpassfail.PFID) AS PFCurrentL,
(select passfail from tblpassfail where tblPFtestdata.PFcurrentNL = tblpassfail.PFID)
AS PFCurrentNL
FROM LIBTEST.tblPFtestData

 

where the red select is where I get the error. says it is not a valid token. This is being created on IBM DB2, server is AS400. soesn't seem like much experience on here for that but ws hoping this could be a problem on any database since it is standard SQL statement. any clues out there?

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...