Post new topic Reply to topic  [ 4 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator

Author Message
 Post subject:
PostPosted: Tue Feb 15, 2005 1:35 pm 
Offline

Joined: Fri Jan 16, 2004 12:00 pm
Posts: 37
Location: Juarez
hi, <br>Im trying to trim a variable from a Visual Fox database. <br>Im using the ALLTRIM function but its not working. <br>Any hint? <br> <br> <br> <br>Here is the log details: <br> <br>Im interested in the @TRIM_SERIE variable (ALLTRIM(num_serie) AS TRIM_SERIE <br> <br> <br>Feb 15 13:36:00.67: [1] START <br>Feb 15 13:36:00.67: [42] DB Connect <br>Feb 15 13:36:00.67: ConnectString: DSN=CONSULTA <br>Feb 15 13:36:00.68: SQL Error State: 01000 <br> Native Error Code: 0 <br> ODBC Error: [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr). <br>Feb 15 13:36:00.68: SQL Error State: HYC00 <br> Native Error Code: 0 <br> ODBC Error: [Microsoft][ODBC Visual FoxPro Driver]Driver not capable <br>Feb 15 13:36:00.70: [11] SQL Begin Transaction <br>Feb 15 13:36:00.70: [12] SQL Statement <br>Feb 15 13:36:00.70: <----- BEGIN -----> <br> SELECT <br> corralon, <br> infraccion, <br> tipo, <br> marca, <br> modelo, <br> fecha_entr, <br> ALLTRIM(placas) AS TRIM_PLACAS, <br> tipoauto, <br> adeudo, <br> corralnom, <br> cproced, <br> ALLTRIM(num_serie) AS TRIM_SERIE <br> FROM <br> infotel.dbf <br> <br> <----- END -----> <br>Feb 15 13:36:00.71: [15] SQL Fetch <br>Feb 15 13:36:00.71: Setting global variable '@CORRALON' to '05' <br>Feb 15 13:36:00.71: Setting global variable '@INFRACCION' to '44611' <br>Feb 15 13:36:00.71: Setting global variable '@TIPO' to '02' <br>Feb 15 13:36:00.71: Setting global variable '@MARCA' to '002' <br>Feb 15 13:36:00.71: Setting global variable '@MODELO' to '1981' <br>Feb 15 13:36:00.71: Setting global variable '@FECHA_ENTR' to '1992-04-29' <br>Feb 15 13:36:00.71: Setting global variable '@TRIM_PLACAS' to '902YMD ' <br>Feb 15 13:36:00.71: Setting global variable '@TIPOAUTO' to 'PICK-UP Ford 1981 ' <br>Feb 15 13:36:00.71: Setting global variable '@ADEUDO' to '165299' <br>Feb 15 13:36:00.71: Setting global variable '@CORRALNOM' to 'CERESO ' <br>Feb 15 13:36:00.71: Setting global variable '@CPROCED' to '01' <br>Feb 15 13:36:00.71: Setting global variable '@TRIM_SERIE' to 'JC4UA2222B0535617 ' <br>Feb 15 13:36:00.73: [78] Run Flowchart <br>Feb 15 13:36:00.73: Flowchart: 'ExtrerCincoDigitos' <br>Feb 15 13:36:00.73: ConsulSerie==> <br>ExtrerCincoDigitos <br>Feb 15 13:36:00.73: [1] START <br>Feb 15 13:36:00.73: [6] Math <br>Feb 15 13:36:00.73: @LONG_SERIE = LENGTH (@TRIM_SERIE) <br>Feb 15 13:36:00.73: @LONG_SERIE = LENGTH (JC4UA2222B0535617 ) <br>Feb 15 13:36:00.73: Setting global variable '@LONG_SERIE' to '20' <br>Feb 15 13:36:00.75: [8] Math <br>Feb 15 13:36:00.75: @START_POS = @LONG_SERIE - 4 <br>Feb 15 13:36:00.75: @START_POS = (integer):20 - (integer):4 <br>Feb 15 13:36:00.75: Setting global variable '@START_POS' to '16' <br>Feb 15 13:36:00.75: [7] Math <br>Feb 15 13:36:00.75: @CINCO_NUM_SER = substr (@TRIM_SERIE, @START_POS, 5) <br>Feb 15 13:36:00.75: @CINCO_NUM_SER = substr (JC4UA2222B0535617 , 16, 5) <br>Feb 15 13:36:00.75: (integer): 5 <br>Feb 15 13:36:00.75: Setting global variable '@CINCO_NUM_SER' to '17 ' <br>Feb 15 13:36:00.75: [2] FINISH <br>Feb 15 13:36:00.75: ConsulSerie<==ExtrerCincoDigitos <br>Feb 15 13:36:00.76: [17] Compare <br>Feb 15 13:36:00.76: @MISERIE = @CINCO_NUM_SER? <br>Feb 15 13:36:00.76: (integer):35617 = (string):17 ? <br>Feb 15 13:36:00.76: FALSE


Back to top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 1:47 pm 
Offline

Joined: Fri Jan 16, 2004 12:00 pm
Posts: 37
Location: Juarez
Sorry, I forgot to say that I only need the last 5 digits of @TRIM_SERIE thats why im using ConsulSerie flowchart (Feb 15 13:36:00.73:)... to extract last 5 digits <br> <br>The problem is that num_serie field of the database is not always the same lenght. Usualy num_serie field has a lenght of 17 plus 3 blank spaces and I have to take the last 5 digits out of the 17 characters, but sometimes num_serie is populated with a string of 13 + 7 blank spaces and in that case I have to take the last 5 digits out of the 13 characters. <br>As a sumary: I have to take the last 5 digits of the populated num_serie field regardless of the blank spaces.


Back to top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 3:15 pm 
Offline

Joined: Wed Mar 19, 2003 4:28 pm
Posts: 510
Location: Canada
If the ODBC driver doesn't do what you need it to, you will have to use TeleFlow to "fix" your variables after retrieving them from the database. <br> <br>The easiest thing to do is add the FindAndRemoveString template flowchart to your application, and pass in the variables you retrieve from the database, and have it remove @SPACE (this is a TeleFlow system variable containing a single space character) from the string. <br> <br>To add the template, go to your TAP screen, and go to the "Templates" tab in the "Steps Toolbar". Click FindAndRemoveString, and drop it into your application. <br> <br>After you remove the spaces, you can continue to copy the 5 characters out of the variable as you are doing now.


Back to top
 Profile WWW 
 
 Post subject:
PostPosted: Tue Feb 15, 2005 5:48 pm 
Offline

Joined: Fri Jan 16, 2004 12:00 pm
Posts: 37
Location: Juarez
thanks Chris.... <br> <br>it works ok


Back to top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Style by Midnight Phoenix & N.Design Studio
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.