Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL translation from Access/VB/ADO to Oracle/VB/ADO

SQL translation from Access/VB/ADO to Oracle/VB/ADO

From: Johnston, Steve <stvjston_at_sapphire.jcn1.com>
Date: Mon, 02 Jul 2001 13:01:20 -0700
Message-ID: <F001.0033F5D0.20010702124023@fatcity.com>

I have a sql string generated in a vb function that returns a sql string. Worked fine in Access but as it uses internal vb functions in a couple of places it fails in Oracle. If someone could point the error of my ways I'd appreciate the language lesson..
(I take no responsibility for the table design!.. existing app!)

Working Access String:
SELECT H.SSNO, CDbl([A.GIFTVAL]*-1) AS GVal, H.EMPNO, H.FNAME, H.LNAME FROM H1EMP H INNER JOIN AWARDS_AWARDS A ON A.EmpNo = H.EmpNo WHERE ((A.ORDERNO)='& CStr(6) &' AND
((A.BATCHKEY)=6) ORDER BY H.LNAME, H.FNAME;
Non-Working Oracle String:
SELECT H.SSNO, TO_NUMBER([A.GIFTVAL]*-1) AS GVal, H.EMPNO, H.FNAME, H.LNAME FROM H1EMP H INNER JOIN AWARDS_AWARDS A ON A.EmpNo = H.EmpNo WHERE ((A.ORDERNO)= TO_CHAR(6) & AND ((A.BATCHKEY)=6) ORDER BY H.LNAME, H.FNAME;

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Johnston, Steve
  INET: stvjston_at_sapphire.jcn1.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Mon Jul 02 2001 - 15:01:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US