xenon3000  
          
              
                January 16, 2012, 10:37am
               
              1 
           
         
        
          Hello, i have searched information about this but i dont find what i need, maybe some of you can help me.
I work with openreports, so i’d like to get “in real time” (not in log) the executed query from advanded search of a admin page of yii.
If i get it, i can send query to the openreports (by parameter) and i can show the same result in pdf (throught openreport) like admin page of yii.
Sorry for my bad english.
Thanks everybody.
Kind regards.
         
        
           
         
            
       
      
        
          
          
            wisp  
          
              
                January 16, 2012, 11:54am
               
              2 
           
         
        
          Just an idea, but could you create a new log-route and use that to send the query to open reports?
         
        
           
         
            
       
      
        
          
          
            xenon3000  
          
              
                January 16, 2012, 12:14pm
               
              3 
           
         
        
          
Thanks for answer. I though about it, but i think that it is a little dirty to have to read the generated query of the log file to send it to openreports.
isn´t there some object in yii to get last query?
Thanks very much.
         
        
           
         
            
       
      
        
          
          
            vitalets  
          
              
                January 16, 2012,  3:18pm
               
              4 
           
         
        
          If using CDbCommand, you can get SQL via "text" property
         
        
           
         
            
       
      
        
          
          
            xenon3000  
          
              
                January 17, 2012,  8:58am
               
              5 
           
         
        
          
Thanks for the answer, i was doing that but the final query that it show me is with parameters like ‘:ycp0’ (like the log), so do you know if it’s possible get the query with authentic values in parameters?
Thanks very much.
         
        
           
         
            
       
      
        
          
          
            tri  
          
              
                January 17, 2012,  9:07am
               
              6 
           
         
        
          
 xenon3000:
 
Thanks for the answer, i was doing that but the final query that it show me is with parameters like ‘:ycp0’ (like the log), so do you know if it’s possible get the query with authentic values in parameters?
Thanks very much.
 
 
See my suggestion in this post.
At least I don’t know a better way to capture the final SQL statement.
/Tommy