Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

2 votes
1 answers
901 views
WEHRE IN array values using stored procedure
I have a select query that uses a `WHERE IN` clause in a MemSQL database. The list of values searched in are a result of another select query. Before, I inserted the values for that clause as a string through a web service like so: `(1,2,3..)`. Now I want to move the second query into a stored proce...
I have a select query that uses a WHERE IN clause in a MemSQL database. The list of values searched in are a result of another select query. Before, I inserted the values for that clause as a string through a web service like so: (1,2,3..). Now I want to move the second query into a stored procedure, and have the values mentioned above be a part of the parameters for that procedure. Say I have a table: create table t (num int); Then when I try to create the sp: DELIMITER // CREATE PROCEDURE test (nums ARRAY(INT)) AS BEGIN ECHO SELECT * FROM t WHERE num IN nums; END // DELIMITER ; I get: ERROR 1064 (42000): Compilation error in function test near line 3: 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 'nums' So apparently it doesn't work that way. Is there way I can get this to recognize the data type I'm inserting? I want to avoid manipulating strings, but if there is no choice, would it require running the query as a string in the stored procedure?
Nexaspx (123 rep)
Sep 11, 2019, 07:19 AM • Last activity: Jul 26, 2022, 10:30 PM
1 votes
1 answers
79 views
SingleStore Execute Immediate a SP/Func inside SP from a query table
I’m having trouble to execute immediate a SP inside a SP from a table. because i have a lot of SP stored in a table (as a data/string). in oracle we can use “select sp_1(:1,:2) from dual” and running it via execute immediate. how’s singlestore do that? i get error. please help, because we want to mi...
I’m having trouble to execute immediate a SP inside a SP from a table. because i have a lot of SP stored in a table (as a data/string). in oracle we can use “select sp_1(:1,:2) from dual” and running it via execute immediate. how’s singlestore do that? i get error. please help, because we want to migrate from oracle to singlestore. i changed a lot of SP from oracle to singlestore. thanks.
Matt Brown (49 rep)
Jun 30, 2022, 08:35 PM • Last activity: Jul 25, 2022, 11:54 AM
1 votes
2 answers
271 views
Primary Key issue in MemSQL doesn't support case sensitive
Creating table in MemSQL and creating composite primary key. Lets create simple table with following structure: Table User Data Name userid Primary Key (userid) And assume application support case sensitive userid. So that following user id considered to be different: abc ABC Insert following data:...
Creating table in MemSQL and creating composite primary key. Lets create simple table with following structure: Table User Data Name userid Primary Key (userid) And assume application support case sensitive userid. So that following user id considered to be different: abc ABC Insert following data: 1) JOHN ABC b) ALEX abc Insert fails in MemSQL as it consider 'ABC' same as 'abc'. Please help me to understand if case sensitive primary key possible in MemSQL table or not.
Abhishek (21 rep)
Oct 15, 2019, 09:12 AM • Last activity: Jul 24, 2022, 09:01 PM
1 votes
1 answers
437 views
SingleStore: Sign Up Log In Cannot get source metadata for pipeline. Failed to create consumer: ssl.ca.location failed: No further error info
below is the command that i am using, but when i create the kafka pipeline command i get the below error: ERROR 1933 ER_EXTRACTOR_EXTRACTOR_GET_LATEST_OFFSETS: Cannot get source metadata for pipeline. Failed to create consumer: ssl.ca.location failed: No further error information available Command u...
below is the command that i am using, but when i create the kafka pipeline command i get the below error: ERROR 1933 ER_EXTRACTOR_EXTRACTOR_GET_LATEST_OFFSETS: Cannot get source metadata for pipeline. Failed to create consumer: ssl.ca.location failed: No further error information available Command used: CREATE PIPELINE ticketmaster_pipeline AS LOAD DATA KAFKA ‘b-3.etainmentnonprod.z2xjta.c25.kafka.us-east-1.amazonaws.com:9094,b-1.etainmentnonprod.z2xjta.c25.kafka.us-east-1.amazonaws.com:9094,b-2.etainmentnonprod.z2xjta.c25.kafka.us-east-1.amazonaws.com:9094/ticketmaster’ CONFIG '{“sasl.username”: “AWS_ACCESS_KEY”, "sasl.mechanism": "PLAIN", "security.protocol": "SASL_SSL", "ssl.ca.location": "/etc/pki/ca-trust/extracted/java/cacerts"}' CREDENTIALS ‘{“sasl.password”: “AWS_PSWD/Z”}’ INTO TABLE ticketmaster_kafka FORMAT JSON (event_url ← event_url,event_id ← event_id,timestamp ← timestamp,event_name ← event_name,venue ← venue,event_datetime ← event_datetime,city ← city,state ← state,section ← section,row ← row,qty ← qty,seat_ids ← seat_ids,seat_numbers ← seat_numbers,inventory_type ← inventory_type,price ← price); My kafka setup in on AWS MSK insatnce and i have data in the topic also
Matt Brown (49 rep)
Jun 30, 2022, 09:33 PM • Last activity: Jul 14, 2022, 11:26 PM
1 votes
1 answers
163 views
SingleStore exception no_data_found
I’m having difficulty finding the exception `no_data_found` in **singlestore**. In **Oracle**, we use `no_data_found` exception. Is there any alternative solution in **singlestore** for the `no_data_found` exception?
I’m having difficulty finding the exception no_data_found in **singlestore**. In **Oracle**, we use no_data_found exception. Is there any alternative solution in **singlestore** for the no_data_found exception?
Matt Brown (49 rep)
Jun 23, 2022, 08:54 PM • Last activity: Jul 5, 2022, 11:31 PM
0 votes
1 answers
1531 views
MySQL syntax error 1064 near IN stored procedure
an aspiring DBA Here. I'm trying to create a stored procedure for a query I'm running. It is a memsql server which is MySQL based. The procedure is as such: delimiter // CREATE PROCEDURE calc_campaign (IN usr VARCHAR(38)) BEGIN Awesome SELECT statement that uses a variable END // The error descripti...
an aspiring DBA Here. I'm trying to create a stored procedure for a query I'm running. It is a memsql server which is MySQL based. The procedure is as such: delimiter // CREATE PROCEDURE calc_campaign (IN usr VARCHAR(38)) BEGIN Awesome SELECT statement that uses a variable END // The error description is: ERROR 1064 (42000): 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 'IN usr VARCHAR(38)) BEGIN my_statement; END' at line 1 The syntax I used seems to correspond with this: https://dev.mysql.com/doc/refman/8.0/en/create-procedure.html And with pretty much every other procedure I saw on Stack forums. What is it I'm missing here? Thanks for any help!
Nexaspx (123 rep)
Dec 6, 2018, 10:08 AM • Last activity: Jun 24, 2022, 09:40 PM
Showing page 1 of 6 total questions