Turning on Trace Flag 460 does not give a better error message - sql

I have a large insert query with ends in an error:
Msg 8152, Level 16, State 4, Line 1
String or binary data would be truncated
After some research I tried using TRACE FLAG 460, using the command below:
INSERT...
VALUES...
OPTION (QUERYTRACEON 460);
This gave the same error as before, so I tried to turn on the flag on server-level, using the command below:
DBCC TRACEON(460, -1);
Again, no change in the output. But when I check the flagstatus it gives all the right information:
DBCC TRACESTATUS(460);
TraceFlag Status Global Session
460 1 1 0
Does anyone have a clue how I can get Trace Flag 460 working? My server information is down below:
Edition: Developer Edition (64-bit)
ProductVersion: 14.0.2037.2
ResourceLastUpdateDateTime: 2020-11-02 21:20:26.783
ResourceVersion: 14.00.2037
BuildClrVersion: v4.0.30319

Have you checked the documentation??
It clearly says:
Note: This trace flag applies to SQL Server 2017 (14.x) CU12 and higher builds
Which means SQL Server 2017 has to have a build version number of 14.0.3045.24 or higher - which you don't seem to have.
So you'll need to install at least CU12 (or better yet: the latest CU22 - https://www.microsoft.com/en-us/download/details.aspx?id=56128) on your machine for this to work
See: SQL Server 2017 build versions - for all the details about the official version numbers of SQL Server 2017 (and it's various CU's)

Related

"Unexpected end of command - line 1, column 8" in JetBrains DataGrip trying to connect to Firebird

I'm trying to connect to a Firebird database hosted in a Docker from the DataGrip client, but this error appears:
WARNING: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding
[42000][335544851] Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 8 [SQLState:42000, ISC error code:335544851]
I've tried to give a path in the file encoding, but I don't have any idea to how Jaybird works.
What do I need to do?
The problem is caused by IntelliJ (DataGrip is based on IntelliJ) executing a "keep-alive query" when testing the connection, but the default configuration for the Firebird driver doesn't have a keep-alive query. When no keep-alive query is configured, IntelliJ seems to execute the query select 1 (though I haven't verified this, the fact the error mentions "column 8" seems to hint at that). This causes Firebird to return an error, because Firebird requires a from-clause.
To solve this, go to the "Drivers" tab of the "Data Sources and Drivers" screen, select "Firebird" (under "Basic Support"), and on the options tab, enter the "Keep-alive query" select 1 from rdb$database.
As an aside, you can make the warning about the connection character set go away by explicitly configuring a connection character set (property charSet) on the "Advanced" tab of the connection configuration.
I reported this to JetBrains: Configuration for Firebird misses default keep-alive query causing error on connection test

DB2 - AUTONOMOUS Stored Procedure

I would like to write an AUTONOMOUS stored procedure (native). I'm using the DB2 database (V11.01)
CREATE PROCEDURE SP_LOG (IN p_field1 char(2)
,IN p_field2 varchar(50)
,IN p_field3 varchar(50)
,IN p_field4 varchar(3926) )
VERSION V1
ISOLATION LEVEL CS
WLM ENVIRONMENT FOR DEBUG MODE WLMENV1
RESULT SETS 0
LANGUAGE SQL
ALLOW DEBUG MODE
AUTONOMOUS
BEGIN
...
...
END
I'm using IBM DATA STUDIO 4.1.1 and I get the following error:
Creazione di procedura memorizzata restituzioni
SQLCODE: -104, SQLSTATE: 42601. XXXXX.SP_LOG: 11: ILLEGAL SYMBOL
"". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: FOR.
SQLCODE=-104, SQLSTATE=42601, DRIVER=4.18.60 XXXXX.SP_LOG -
Distribuzione per il debug non riuscita. XXXXX.SP_LOG - Rollback
completato correttamente.
If you have any recommendations, I'd love to hear them!
Thanks :)
Good news, I found the issue.
This is a bug of IBM Data Studio (IT26018 - AUTONOMOUS KEYWORD IS NOT CONSIDERED AS A VALID KEYWORD FOR DB2 ZOSV11 AND V12 IN DS.4.1.3 - For more information click here.
Here's how I solved it:
I downloaded the new version (IBM DATA STUDIO 4.1.3) - Link
Installed the new version using IBM INSTALLATION MANAGER
I downloaded the FIX - Link
Installed the FIX (Instructions are included in the .ZIP file (open the "Hotfix Guide.pdf" file)

#1064 - You have an error in your SQL syntax in phpMyadmin

I built the following Query, for MySQL, on Maria Db, phpMyAdmin Ver: 4.8.3
Database server
Server: 127.0.0.1 via TCP/IP
Server type: MariaDB
Server connection: SSL is not being used Documentation
Server version: 10.1.36-MariaDB - mariadb.org binary distribution
Protocol version: 10
Web server
Apache/2.4.34 (Win32) OpenSSL/1.1.0i PHP/7.2.10
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.2.10
SQL
SELECT tblhoadon.MaHoaDon,
tblkhachhang.HoVaTen,
tblphongtro.MaSoPhong,
tblphongtro.GiaThue,
tbldichvu.MaDichVu,
tblchitietdv.TenChiPhi,
tblchitietdv.ThanhTien,
tblhoadon.TongTien
FROM tblhoadon,
tblphongtro,
tbldichvu,
tblchitietdv
WHERE tblhoadon.MaKhachHang = tblkhachhang.MaKhachHang,
tblhoadon.MaSoPhong = tblphongtro.MaSoPhong,
tblhoadon.MaDichVu = tbldichvu.MaDichVu,
tbldichvu.MaDichVu = tblchitietdv.MaDichVu LIKE 10040001
Report error
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
near ' tblhoadon.MaSoPhong = tblphongtro.MaSoPhong, tblhoadon.MaDichVu
= tbldichvu.MaD' at line 1
Can you help me fix syntax error?
You can't just have a series of conditions. You need some logical operator between them, such as and or or.
Additionally, the last condition has several issues:
like` should take a string argument, not a number
You can't chain equalities like that, you should create two conditions with a logical and operator between them.
While it's not strictly wrong to use like without a wildcard, it's a bit pointless, and you can just use an = condition:
SELECT tblhoadon.MaHoaDon,
tblkhachhang.HoVaTen,
tblphongtro.MaSoPhong,
tblphongtro.GiaThue,
tbldichvu.MaDichVu,
tblchitietdv.TenChiPhi,
tblchitietdv.ThanhTien,
tblhoadon.TongTien
FROM tblhoadon,
tblphongtro,
tbldichvu,
tblchitietdv
WHERE tblhoadon.MaKhachHang = tblkhachhang.MaKhachHang AND
tblhoadon.MaSoPhong = tblphongtro.MaSoPhong AND
tblhoadon.MaDichVu = tbldichvu.MaDichVu AND
tbldichvu.MaDichVu = tblchitietdv.MaDichVu AND
tblchitiedv.MaDichVu = '10040001'

error message when trying to connect to Sybase using SSIS

I am using ssis of sql 2008 trying to connect to sybase 12 using sybase 15.2 driver, i even tried sybase 12 driver and got same error
error message
[ZZZZZ]
[Message Class: 16]
[Message State: 5]
[Transaction State: 1]
[Server Name: PHXPROD]
[Native Code: 2812]
[ASEOLEDB]Stored procedure 'sp_oledb_datatype_info' not found.
Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output). (ASEOLEDB)
attached images showing that i am able to connect but soon after connecting i get the error message
Step 1
Step 2
Error message when i used ADO.NET
Look like you have to investigate more about this problem and by reading in the SyBooks Online it say:
If error 2812 occurs on system stored procedures (as your case sp_oledb_tables and sp_oledb_datatype_info) it may be resolved by running the installmaster script, which installs all system procedures and initializes various other Adaptive Server structures.
How to run the installmaster script?
Using isql, run the new installmaster script included with this release by entering:
isql -Usa -P<sa password> -S<server name> -n -i$SYBASE/$SYBASE_ASE/scripts/installmaster
-o<output file>
Reference: Running the installmaster script
Hope it help you

Set param from sql command in spite oracle is down

I have Solaris machine with oracle Release 10.2.0.4.0
I have problem - I cant startup oracle
when I try to start oracle by the command:
hagrp -online oracle1 -sys machine1a
I get:
oracle1 machine1a Y N PARTIAL|FAULTED
remark ( hagrp -clear oracle1 -sys machine1a not help )
After checking and debug the problem I find that oracle not start up
because wrong param - shared_pool_size (this param was set to 0 , while need to set this param to 2G)
So I want to set the param shared_pool_size to 2G but I can’t because oracle is down !!!
My question - how to set the parameter shared_pool_size to 2G in spite oracle is down ??? , is it possible ???
su - oracle -c "sqlplus / as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 5 12:10:44 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system set shared_pool_size=2G scope=BOTH;
init.ora: (from my machine)
grep shared_pool_size /opt/oracle/v10.2.0/srvm/admin/init.ora
#shared_pool_size = 52428800 # INITIAL
shared_pool_size = 67108864 # datewarehouse, transaction processing
If you were starting from an old-style init.ora parameter file you could just change it in that. The scope in your alter system suggests you're using an spfile. You can startup nomount to make parameter changes, then shutdown again and try to start normally.
Are you sure you're connecting to the right database though? The output from your sqlplus command doesn't say connected to an idle instance, so it looks like whatever you're connected to is already running. Check where you are before running anything, and note any parameters you change first (e.g. with output from show parameters).
Based on conversation in chat...
You can create a temporary pfile, edit that and test starting up with it, and then when happy with the new configuration recreate your spfile, and finally restart from that. The steps are:
create pfile='/tmp/init.ora' from spfile;
-- edit /tmp/init.ora and change parms as needed
startup pfile='/tmp/init.ora';
-- repeat as needed until successful start
create spfile=’/path/to/spfile.ora’ from pfile=’/tmp/init.ora’;
shutdown
startup 'spfile=/path/to/spfile.ora';