in Education by
I have to insert data in a table. It has a colum whose values should negative numbers like -1,-2,-3..... so on upto -50. I thought of using sequence but it wont accept the negative values. How can i genarate i mean insert the values??? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
"I thought of using sequence but it wont accept the negative values." Are you sure? SQL> create table t1 (c1 number) 2 / Table created. SQL> create sequence myseq increment by -1 2 / Sequence created. SQL> insert into t1 values (myseq.nextval) 2 / 1 row created. SQL> r 1* insert into t1 values (myseq.nextval) 1 row created. SQL> r 1* insert into t1 values (myseq.nextval) 1 row created. SQL> select * from t1 2 / C1 ---------- -1 -2 -3 SQL> What version of the database are you using? This is from Oracle 11g R1, but I don't think it's a recent feature.

Related questions

0 votes
    I want to import an oracle dump into a different tablespace. I have a tablespace A used by User A ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I want to import an oracle dump into a different tablespace. I have a tablespace A used by User A ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    Slightly unimportant but it's piqued my curiousity. I've just logged into an Oracle 10g database for the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Slightly unimportant but it's piqued my curiousity. I've just logged into an Oracle 10g database for the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Slightly unimportant but it's piqued my curiousity. I've just logged into an Oracle 10g database for the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    I'm working with secure application roles to grant access to users. In its dumbest form, it looks like ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have not used access before but I have to convert an access query into SQL so I can write a report in crystal ... like this in SQL? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have not used access before but I have to convert an access query into SQL so I can write a report in crystal ... like this in SQL? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    DROP TYPE Position; CREATE OR REPLACE TYPE Position AS OBJECT (longitude NUMBER(11,7), lattitude NUMBER(11, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Select right statement to insert values in the table CUSTOMERS * a) INSERT VALUES INTO CUSTOMERS . b) INSERT INTO ... NONE OF THE ABOV Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    I've come to this code, but from this i have to manually insert all columns and check it by each ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    When I try to create this trigger, I get this exception: The name "SITE_ID" is not permitted in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    When I try to create this trigger, I get this exception: The name "SITE_ID" is not permitted in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible ... the underlying database? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    2- What values must be inserted in Insert table dialog box to create a table ? Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...