Creating Real-Time Indexes in Sphinx - real-time

I'm stuck at creating a real-time index with sphinx search engine. I'm following the documentation but I get weird results:
mysql> attach index profile to rtindex rt_profile;
ERROR 1064 (42000): sphinxql: syntax error, unexpected PROFILE, expecting IDENT near 'profile to rtindex rt_profile'
I'm using Sphinx 2.1.2-id64-release (r4245)
Any ideas on what I'm doing wrong ?

OK I just figured it out - profile is a key word: ( used in SHOW PROFILE command)

Related

Line Numbers for Errors not returning in SQL Developer when querying postgres

As the title states, I am not getting the line numbers for errors in SQL Developer when I query a Postgres DB. Just a position error. Something like:
ERROR: syntax error at or near "SELECT"
Position: 135
I went into the preference and have the 'Show Line Numbers' enabled:
but they aren't showing. Is this an issue with Postgres in SQL Developer or something else?
Thanks.
Preference you set is related to line numbers here:
(that's the result of a mouse right-click).
What you're looking for is related to the way database reports errors. As far as Oracle is concerned, it works as expected:
As I don't use PostgreSQL, I can't comment it.

Postgresql Transaction ID Not Found

Whenever I am executing a query in postgresql, this is the error message I receive
Transaction ID not found in the session.
Does anyone have any idea how to resolve this? I recently created a new user, but I was unable to find documentation that even shows this as a valid error.
Additional Details:
I've managed to resolve the error by re-connecting with admin credentials.
I was using PG Admin V4 with Postgres V9.6, and that was the only message appearing in any query I executed, even if it was a basic query like 'SELECT NOW()'.
At the same time, this was the error message being received by the client device (an iOS device with a AWS Lambda / NodeJS backend) :
'message' : {
'name' : 'error',
'length' : 114,
'severity' : 'fatal',
'code' : '28000',
'file' : 'miscinit.c',
'line' : '587',
'routine' : 'InitializeSessionUserId'
}
I assume you found a solution, but for anyone else that finds this post, I had the same issue and I just closed PG Admin 4 and restarted it and it cleared up.
To anyone who has this problem, all you have to do is:
1) Reconnect to the database
2) Open a new Query Tab. (Run your query here)
You're welcome.
For me helped changing 'localhost' in connection settings to '127.0.0.1', as mentioned here: https://stackoverflow.com/a/59747781/2590805
Disconnecting and reconnecting to the database solved this issue for me; it wasn't necessary to exit/open PGAdmin 4 completely.
Create a new Query editor tab, that works for me
This is not a PostgreSQL error message. It must come from something else in the stack you are using - a client driver, ORM, etc.
Please post a more detailed question with full information on the stack you're using.
So I don't know the exact specifics of my solution, but I found this issue in the following circumstance:
Database user was created.
Role was assigned for the user.
A transaction was used
I'm still not entirely sure I discovered the solution of the root problem, but if others have the same scenario, it might help troubleshoot it further. If any of those three are not used, then I never encountered the issue.
Has anyone found an explanation for this problem? I am also getting a "Transaction ID not found in the session.". It's for a long running (several days) query. I ran it on a 10% sample of my data and had no trouble, but now need to repeat the process for the full dataset. I reconnect to the database and the query appears as still active. A new idle query appears as follows:
SELECT rel.oid, rel.relname AS name,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers,
(CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_partitioned
FROM pg_class rel
WHERE rel.relkind IN ('r','s','t','p') AND rel.relnamespace = 2200::oid
AND NOT rel.relispartition
ORDER BY rel.relname;

MySQLi Update data in a table

Please help me out with this. Basically to update an existing table (chem_users) with data using 2 keys UserId & Password (or only 1 primary key is allowed?).
Using MySQLi, what is wrong with this syntax.
$sql = "UPDATE chem_users SET (Prj1, Prj2) VALUES ('{$_POST['kinetics']}',
'{$_POST['thermo']}') WHERE (UserId=JohnKing Password=1234rewq)";
I got this error:
Error saving user data You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(Prj1, Prj2) VALUES ('kinetics' at line 1
Try using this syntax:
$sql="UPDATE `chem_users` SET `Prj1`=".$_POST['kinetics'].",`Prj2`=".$_POST['thermo']." WHERE `UserId`='JohnKing' AND `Password`='1234rewq'";
By the way, you shouldn't just concatenate a variable inside a query like you are doing,you should use Prepared Statements.You can learn a little bit about it in this link: http://www.w3schools.com/php/php_mysql_prepared_statements.asp

Lesson 3 for MSDN error SQL Server Data Tools

i'm currently following this link and performing the steps
https://msdn.microsoft.com/en-us/library/ms170625.aspx
however, after importing in the Transact-SQL query, it tells me that
"Could not create a list of fields for the query. Verify that you connect to the data source and that your query syntax is correct. Query (7,24) Parser: The syntax for 'sp' is incorrect"
What could be the problem? I have tested connection of the database and it is connected. (and yes, the table exists in the database)

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

What does sqlcode -302 means?
Where do i get the sqlcode definitions?
Please advice
Thanks,
You can find the codes in the DB2 Information Center. Here's a definition of the -302 from the z/OS Information Center:
THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS
INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE
On Linux/Unix/Windows DB2, you'll look under SQL Messages to find your error message. If the code is positive, you'll look for SQLxxxxW, if it's negative, you'll look for SQLxxxxN, where xxxx is the code you're looking up.
To get the definition of the SQL codes, the easiest way is to use db2 cli!
at the unix or dos command prompt, just type
db2 "? SQL302"
this will give you the required explanation of the particular SQL code that you normally see in the java exception or your db2 sql output :)
hope this helped.
As a general point when using a search engine to search for SQL codes make sure you put the sqlcode e.g. -302 in quote marks - like "-302" otherwise the search engine will exclude all search results including the text 302, since the - sign is used to exclude results.