I am trying to create a script to create tables and inserting rows. I want to create a simulated traffic to the cluster without using the TPC-C, since I need to know exactly what the data I am inserting looks like. This is what I am trying:
CREATE TABLE student ( id int, student VARCHAR, age int ); declare @id int select @id = 1 while @id >=1 and @id <= 1000 begin insert into student values(@id, 'thesis' + convert(varchar(5), @id), 12) select @id = @id + 1 end
Then I pipe it into my cluster by doing:
cockroach sql --insecure < my-file.sql
However, I get this error:
ERROR: at or near "declare": syntax error: unimplemented: this syntax SQLSTATE: 0A000 DETAIL: source SQL: declare @id int ^ HINT: You have attempted to use a feature that is not yet implemented. See: https://go.crdb.dev/issue-v/41412/v20.2
If anyone got an example script that I could use as guidance in how to build a working script, It would be much appreciated.