0

I'd like to know if it's possible to create a table with multidimentional integer array, I tried this syntax, but it didn't work for me unfortuantly:

create table testarray(testarr INT(20)(10));

so what to do in this case? thanks.

1
  • What are you trying to accomplish by storing trying to store an array in a relational field? Commented Apr 20, 2014 at 16:34

2 Answers 2

1

You can't. You could do something like convert your array to a comma-separated string, and store this. Use serialize function and store it into the varchar field

Sign up to request clarification or add additional context in comments.

Comments

0

No. But you could create a test array table and link to it.

CREATE TABLE testarray(ID NT, RowId INT, Element_0 INT, Element_1 INT..Element_9 INT);

Not you reference the array with testarray.ID as a foreign key from wherever you wanted to have the array original.

That's arguable better then using a comma-separated.

Or stick a json syntax array in a varchar field.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.