Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!nprdc!carroll From: carroll@nprdc.navy.mil (Larry Carroll) Newsgroups: comp.databases Subject: ORACLE Dynamic SQL Problem Keywords: oracle, sql Message-ID: <9588@arctic.nprdc.arpa> Date: 17 Sep 90 14:14:23 GMT Sender: news@nprdc.arpa Reply-To: carroll@nprdc.navy.mil (Larry Carroll) Organization: Navy Personnel R&D Center, San Diego Lines: 35 I have written a sql script generator which queries the agency table to get the values for agency and agency_id, then builds the sql script to insert the data. The problem I am running into is that I need to include a quote within a quote. (there does not seem to be a way of changing single to double with the set command.) example: select 'insert into aim.agency(agency_id, agency)' || ' ' || 'values (' || agency_id || ',' || agency || ');' ^^^^^^ from agency; since agency returns the agency name, it needs to be ^^^^^^ enclosed with quotes for valid sql syntax. If you use quotes around agency it will return the literal word agency. How can I get the quote in there? --Any ideas? Thanks in advance Larry Carroll carroll@nprdc.navy.mil ...}ucsd!nprdc!carroll Larry Carroll carroll@nprdc.navy.mil ...}ucsd!nprdc!carroll