Home
Extended ECM
API, SDK, REST and Web Services
Query Strings for CAPI.Exec()...
unknown
Message from Sean M Alderman via eLinkAll,Is there a way I can setup my query string for a CAPI.Exec() call so that I can make a query like -select * from daudit where event = 'FETCH'The word value for the daudit.event field is coming from a list variable in my function. If I have oscript like -myTblName = dauditmyTblField = "event"myList[i] = "FETCH"...queryString = "Select * from " + myTblName + " where " + myTblField + " = '" myList[i] + "'"...I get a string that looks like -"Select * from daudit where event = \'FETCH\'"After executing the query using CAPI.Exec() I get an error. I believe this is because Oracle doesn't like the \'.Is there a way around this? The actual values I'm querying on have spaces in them, so the quoted string is necessary...take a folder name for instance...Select * from dtree where name = 'New Folder' and subtype = 0;- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795
Find more posts tagged with
Comments
eLink User
Message from Sean M Alderman via eLinkAs it turns out, the error message CAPI.Exec was returning had nothing to do with the quoted strings.Although, in the process I changed the query to use the Str.Quote() function, which works fine, and presents a little cleaner approach.At 11:39 AM 05/14/2001 -0400, you (eLink Discussion: Development Discussion) wrote:>Query Strings for CAPI.Exec()...>Posted by eLink on 05/14/2001 11:39 AM>>Message from Sean M Alderman via eLink>>All,>>Is there a way I can setup my query string for a CAPI.Exec() call so that I can make a query like ->>select * from daudit where event = 'FETCH'>>The word value for the daudit.event field is coming from a list variable in my function. If I have oscript like ->>myTblName = daudit>myTblField = "event">myList[i] = "FETCH">...>queryString = "Select * from " + myTblName + " where " + myTblField + " = '" myList[i] + "'">...>>I get a string that looks like ->"Select * from daudit where event = \'FETCH\'">>After executing the query using CAPI.Exec() I get an error. I believe this is because Oracle doesn't like the \'.>>Is there a way around this? >>The actual values I'm querying on have spaces in them, so the quoted string is necessary...take a folder name for instance...>>Select * from dtree where name = 'New Folder' and subtype = 0;>>>>>- Sean M. Alderman>ITRACK Systems Analyst>PACE/NCI - NASA Glenn Research Center>(216) 433-2795>>[To reply to this thread, use your normal e-mail reply function.]>>============================================================>>Discussion: Development Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=view>>Livelink
Server:>
https://knowledge.opentext.com/knowledge/livelink.exe-
Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795
Jeff_Lang_(lang_(Delete)_2245920)
It's common practice to use the Str.Format function to format the strings used for CAPI statements.String statementstatement = Str.Format( "select * from %1 where Event='%2'", tableName, 'FETCH' )