If I run:
exec('myString') at [myserver]
my selection works correctly
If I do:
declare #mystring nvarchar(max) = 'myString'
exec(#mystring) at [myserver]
(Righe interessate: 2)
OLE DB provider "IBMDASQL" for linked server "myserver" returned message "SQL0104: Token '' non valido. Token validi: ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
Causa . . . : È stato rilevato un errore di sintassi sul token ''. Il token '' non è valido. Un elenco parziale dei token validi è ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. Questo elenco presuppone che l'istruzione sia corretta fino al token. È possibile che l'errore sia precedente nell'istruzione, ,ma la sintassi dell'istruzione sembrava valida fino a questo punto. Correzione . . : Effettuare almeno una delle seguenti operazioni e ripetere: -- Verificare l'istruzione SQL nell'area del token ''. Correggere l'istruzione. L'errore potrebbe essere una virgola o apici mancanti, una parola scritta in modo scorretto oppure potrebbe essere relativo all'ordine delle clausole. -- Se il token di errore è , correggere l'istruzione SQL perché non termina con una clausola valida.".
(Righe interessate: 0)
Messaggio 7215, livello 17, stato 1, riga 308
Could not execute statement on remote server 'myserver'.
Here is the english version of SQL0104
Message ID . . . . . . . . . : SQL0104
Message file . . . . . . . . : QSQLMSG
Library . . . . . . . . . : QSYS
Message . . . . : Token &1 was not valid. Valid tokens: ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
Cause . . . . . : A syntax error was detected at token ''. Token '' is not
a valid token. A partial list of valid tokens is ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. This list assumes that the statement is correct up to the token. The error may be earlier in
the statement, but the syntax of the statement appears to be valid up to
this point.
Recovery . . . : Do one or more of the following and try the request again:
-- Verify the SQL statement in the area of the token ''. Correct the
statement. The error could be a missing comma or quotation mark, it could
be a misspelled word, or it could be related to the order of clauses.
-- If the error token is , correct the SQL statement
because it does not end with a valid clause.
Related
I'm having a problem when I want to send multi e-mails with PHP-Mailer inside a while.
I've the script that sends the email to 15 of 16 people when I'm doing to the SELECT in muy DB, and getting all the data with an array.
The code:
while($row=mysqli_fetch_array($rangocorreo)){
//Server settings
$mail->addAddress($row['correo'], $row['t_name']); // Add a recipient
$mail->Subject = 'Test';
$mail->Body = 'Esto es una mensaje de Prueba';
$mail->AltBody = '¡Test!';
$mail->ConfirmReadingTo = '';
//$mail->send();
if(!$mail->send()) {
//echo 'El mensaje no pudo enviarse. Motivo: ' . $mail->ErrorInfo;
}
$mail->ClearAddresses();
//usleep(500000);
}
I tried with different forms of the code, but finally only sends 15 instead of 16. (The e-mail is missing) Just a note, if I do the SELECT in the DB, gives me the 16 emails that I want, so I think the problem is not in the DB or in the query, I think is in this code.
Can you help me?
Kinds Regards.
I have this error each time I check "remember me" on authentication.
What could be the problem ?
Thank you
Dom
2016.04.12 18:49:27 ERROR web[o.s.s.ui.JRubyFacade] Fail to render: http://cerbere:9001/sessions/login
ActiveRecord::JDBCError: La conversion d'un type de donn?es varchar en type de donn?es datetime a cr?? une valeur hors limites.: UPDATE [users] SET [remember_token_expires_at] = '2016-04-26 16:49:26', [remember_token] = N'4fa37dcb929dce851bb153cebc204bc300518d14', [updated_at] = 1460479767007 WHERE [id] = N'2'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:212:in `log'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:199:in `jdbc_update'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/query_cache.rb:26:in `update_with_query_dirty'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/base.rb:2946:in `update'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/locking/optimistic.rb:81:in `update_with_lock'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/dirty.rb:146:in `update_with_dirty'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/timestamp.rb:64:in `update_with_timestamps'
/opt/sonar/sonarqube-5.4/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/callbacks.rb:282:in `update_with_callbacks'
The problem was on soanrqube 5.4. It was due to my sqlserver user language that was not english.
I read again sonarqube installation documentation, and it's not very clear what to do for MS SQLServer.
I'm working on a script to automatically configure Nodemanager, enroll a machine and starting de managed servers in it. What i currently have is (not exactly):
connect(...)
cd('/')
for m in cmo.getMachines():
nombre_machine=m.getName()
#Solo ejecutamos el NodeManager en el que estamos ejecutando el script.
if nombre_machine in HOST:
cd('/Machines/'+nombre_machine+'/NodeManager/'+nombre_machine)
machine=cmo
nm_srv_addrs[machine.getListenPort()] = machine.getListenAddress()
for nm_port, nm_addr in nm_srv_addrs.iteritems():
printInStyle('Iniciando Nodemanager, favor tener paciencia la primera vez.')
startNodeManager(verbose='false', NodeManagerHome=NM_HOME, ListenPort=str(nm_port), ListenAddress=nm_addr)
print 'Generando nodemanager.properties ',
while not os.path.exists(NM_PROP_FILE):
systime.sleep(10)
print '\b.',
sys.stdout.flush()
print 'Archivo creado!'
cd('/')
servidores = cmo.getServers()
for s in servidores:
nombre = s.getName()
if nombre != 'AdminServer':
start(nombre)
But the last sequence will fail because will try to start all servers and i'm looking to start only the in the one i'm running the script.
What i believe i'm looking is a way to filter the servers in the current machine.
I'll appreciate any help or advice. I am just starting in wlst scripting.
thanks
I figured it out thanks to this link
I'll just need to filter in a couple of loops like this:
import os
cd('/')
current_m=''
machines = cmo.getMachines()
for m in machines:
hostname = os.environ['HOSTNAME']
nm = m.getNodeManager()
if nm.getListenAddress() in hostname:
current_m=m
servers = cmo.getServers()
for s in servers:
name = s.getName()
if name != 'AdminServer':
ref = getMBean('/Servers/'+name+'/Machine/'+current_m.getName())
if ref != None:
start(name)
I read a date from a SQL Server database through Entity Framework. I return the result to the web page and it's displayed like this :
Date(-658436400000)
I presume it's something about date format but all my attempt to resolve it lead to an exception.
Here the Entity Framework code in VB:
Public Function getEvenements(noFacture As String, bd As eFacturationEntities) As Array
Dim evenements As Array = (
From e In bd.ItemFactures Where e.NoFacture_cs = noFacture
Select e Select New With {
.noEvenement = e.NoEvenement_cn,
.depart = e.DetailFactures.FirstOrDefault.LieuPRCH,
.arrivee = e.DetailFactures.FirstOrDefault.LieuDest,
.nomBeneficiaire = e.Beneficiaire,
.NAM = e.DetailFactures.FirstOrDefault.NAM,
.dateDeNaissance = FormatDateTime(e.DetailFactures.FirstOrDefault.DateNaissance_dt),
.dateDeTransport = e.DetailFactures.FirstOrDefault.PRCH_dt,
.noAs811 = e.DetailFactures.FirstOrDefault.NoAS811}).ToArray()
Return evenements
End Function
Solution : call .toString on the date before sending it to the client.
.dateDeTransport = e.DetailFactures.FirstOrDefault.PRCH_dt.ToString,
But this solution may cause an Exceptionon on some case :
"LINQ to Entities ne reconnaît pas la méthode 'System.String
ToString()', et cette dernière ne peut pas être traduite en expression
de magasin."} System.Exception
(the french tradcution of VS is unclear ...)
I have a sql database with data about headers of news. Example:
id title
867 MPE consegue inverter julgamento
868 Defensoria P blica realiza licita
869 Prefeitos eleitos de todas as partes do Estado
870 Inc ndio deixa 80 pessoas desabrigadas
871 Carlos Amastha visita parlamentares
872 Defensoria P blica requer anula o
873 Marcelo Miranda diz que n o possui obriga o
874 Ex-assessor diz que Coimbra lhe deu dois cheques
I need to get each title and see if there are other news to talk about the same subject.
How i do it? My plataform is .Net and use sql server 2012.
You will probably want to put a Full-Text Index on this column and/or table. It's a complex subject, but you can start reading up on it here: http://msdn.microsoft.com/en-us/library/ms142571.aspx