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

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

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

From: Norrell, Brian <BNorrell_at_QuadraMed.com>
Date: Tue, 03 Jul 2001 08:32:46 -0700
Message-ID: <F001.00340105.20010703080553@fatcity.com>

The brackets are the problem. Access likes to throw them into the queries it uses but Oracle does not like them so much.

See if this works:
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;
Also, there is the funny '&' in your where clause that should not be there
(in the original it was inside the quotes)

Brian Norrell
Manager, MPI Development
QuadraMed
511 E John Carpenter Frwy, Su 500
Irving, TX 75062
(972) 831-6600

-----Original Message-----
Sent: Monday, July 02, 2001 3:40 PM
To: Multiple recipients of list ORACLE-L

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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Norrell, Brian INET: BNorrell_at_QuadraMed.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 Tue Jul 03 2001 - 10:32:46 CDT

Original text of this message

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