php - How to create nested tables in sql
Get the solution ↓↓↓I am trying to create a nested table for a car website in sql.So I can fetch data from database and include the drop down menu in my website (I am using php, html and css)
So I wanna create a drop down menu like this. When I select the first option of dropdown, then the second option appear based on the previous selection. That's the link of website from where I took the screenshot that is attached above (the image) https://carbuyersonline.com.au/
CREATE OR REPLACE TYPE my_nested_table IS TABLE OF VARCHAR2 (10);
/
create table car (
year int(11) not null,
model varchar(128) not null,
shape varchar(128) not null,
badge varchar(128) not null,
engineofcar varchar(128) not null,
make my_nested_table //here it says unrecorgnised data type near my_nested_table
)NESTED TABLE make STORE AS nested_make;
/
DESC alfa_romeo;
INSERT INTO alfa_romeo(model, shape, badge, engineofcar)
VALUES ("Giulia", "4 Door Sedan", "Auto MY19, Quadrifoglio Auto MY19, Super
Auto MY19, Veloce", "4 Cylinder, 2.0 Litre - Petrol");
//I added same code again just to show example but it will be different car next time
DESC alfa_romeo;
INSERT INTO alfa_romeo(model, shape, badge, engineofcar)
VALUES ("Giulia", "4 Door Sedan", "Auto MY19, Quadrifoglio Auto MY19, Super
Auto MY19, Veloce", "4 Cylinder, 2.0 Litre - Petrol");
I have mentioned the error above, next to the code
make my_nested_table //here it says unrecorgnised data type
my_nest_table)
Any help is appreciated. Also, is there a better way to do that?
Answer
Solution:
I am not familiar with Xampp so I am uncertain what the exact code would be. It appears you may have created a table data type but did not first define it. Perhaps you could try something like this:
CREATE or REPLACE TYPE my_nested_table AS OBJECT
(table_column1 VARCHAR2(10), table_column2 VARCHAR2(10));
CREATE or REPLACE TYPE my_nested_table_type AS TABLE OF
my_nested_table;
If this is not he correct/exact syntax, hopefully I've nudged you in the right direction!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: an exception occurred in the driver: could not find driver
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.