ciao,
devo eseguire degli script sql con un programma java.
il problema è che alla lettura del 'go' contenuto in alcune parti dello script java entra in errore.
sapete dirmi xkè????
ho provato a escluderlo,ma in certi casi è necessario eseguire anke il 'go' affinchè lo scrip funzioni.
questo è un pezzo di query che devo eseguire...codice:{ if(!h.equals("GO")) //tolgo il 'GO' { System.out.println("h "+h); r.append(h+"\n "); } } //System.out.println(" exit "+r); try { stmt1.addBatch(r.toString()); stmt1.executeBatch(); //stmt1.close(); main.db_conn(0,true,"finito.!."+file_update); main.db_conn(0,true,file_update); return; } catch (SQLException e) { //System.out.println(st.countTokens()); System.out.println("query NO:"); System.out.println(e.toString()); //return; //System.out.println(st.countTokens()); } }
ALTER TRIGGER [dbo].[TRUpd_Racks] ON [dbo].[Racks]
FOR INSERT, UPDATE
AS
DECLARE @RackID int, @UsedInWeldingstation bit
SET @RackID = (SELECT RackID From Inserted)
IF (SELECT TOP 1 ISNULL(WeldingStation,'') FROM WeldingStations WHERE
RackID_1 = @RackID OR RackID_2 = @RackID OR RackID_3 = @RackID ) <> ''
BEGIN
UPDATE HHC_Parameters SET ForceParamRefresh = 1
END
GO
....e questo è l errore.... java.sql.BatchUpdateException: Incorrect syntax near 'GO'.
grazie.!!

Rispondi quotando