Imam u jednoj tabeli kolonu PRO u kojoj vrednosti pocinju sa nulom npr.(001,002,014,058) treba da uklonim nule i da mi ostanu samo 1,2,14,58..
Pokusavao sam funkcije sa sledeceg linka : http://blog.sqlauthority.com/2...s-from-column-in-table-part-2/ , ali mi javlja gresku.
Moj deo koda:
Code:
ADOConnection1->ConnectionString = str;
tabSTAT1->Connection = ADOConnection1;
tabSTAT1->TableName = s;
int x = s.LastDelimiter(".");
int y = s.Length();
int k = y-x;
String h = s.Delete(x,k+1);
ADOQuery1->SQL->Text = "INSERT INTO tabSTAT1 SELECT "+h+".FIRMA ,"+h+".KOMERC ,
"+h+".PRO=REPLACE(STR("+h+".PRO, 3), SPACE(1), '0') AS PRO ,
RIGHT("+h+".NAZIV_ART, LEN("+h+".NAZIV_ART) - 14) AS NAZIV_ART
,"+h+".KOLICINA ,"+h+".NETO , FROM "+h+" ";
ADOQuery1->ExecSQL();
tabSTAT1->Open();
ADOConnection1->ConnectionString = str;
tabSTAT1->Connection = ADOConnection1;
tabSTAT1->TableName = s;
int x = s.LastDelimiter(".");
int y = s.Length();
int k = y-x;
String h = s.Delete(x,k+1);
ADOQuery1->SQL->Text = "INSERT INTO tabSTAT1 SELECT "+h+".FIRMA ,"+h+".KOMERC ,
"+h+".PRO=REPLACE(STR("+h+".PRO, 3), SPACE(1), '0') AS PRO ,
RIGHT("+h+".NAZIV_ART, LEN("+h+".NAZIV_ART) - 14) AS NAZIV_ART
,"+h+".KOLICINA ,"+h+".NETO , FROM "+h+" ";
ADOQuery1->ExecSQL();
tabSTAT1->Open();