Search code examples
coldfusioncfmlcoldfusion-2016

QueryExecute equivalent to new Query getPrefix()


I have some existing code

local.query = new Query();
local.query = setDataSource(application.DSN);
local.setSQL("
  SELECT ... 
  ");

local.result = local.query.execute(); // I am OK up to this point

local.prefix = local.result.getPrefix();

I understand that this gets the meta information for the query.

How do I convert this to

local.prefix = QueryExecute("
 SELECT ... 
 ",
 [],
 {datasource : application.DSN}
 ); 

Now what? Where do I do getPrefix()?


Solution

  • A resultset is returned from queryExecute()

    local.result = QueryExecute("
     SELECT ... ", [],
     {datasource : application.DSN}
     ); 
    
    local.prefix = result.prefix