Results 1 to 14 of 14
  1. #1
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130

    Unanswered: Silly question (regarding insert)

    how can i insert bulk values in a time
    ex:- i had a table custid and the table consists of single column i,e custid 1 to 100
    table
    i want to insert all the values at a time how can it be done
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  2. #2
    Join Date
    Mar 2009
    Location
    Australia
    Posts
    113
    You could try doing something with a recursive CTE...

    Code:
    WITH BulkCTE AS 
        (
            SELECT 1 AS Value 
            UNION ALL 
            SELECT Value+1 
            FROM BulkCTE 
            WHERE Value <100
        )
    SELECT    * 
    FROM    BulkCTE
    Work that into an insert statement, or alternatively just join to another table that has values 1 to 100 to duplicate the rows in your insert.

    I could come up with another bunch, but these will both work.

  3. #3
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    Thanks EngadaSQL for your reply
    it works but it is not inserting the values into my table
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  4. #4
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    tnks i got o/p i had tried count command and fulfilled the result but another small issue that i want the o/p in vertical view is it possible plz help
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There is no particular order for the rows within a table. A particular database engine will put them in some order, but that is a side effect of the engine and it can change over time. Just imagine them in a vertical view and you should be fine.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    yes you are right i am just trying to learn about pivorting PatP
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  7. #7
    Join Date
    Oct 2010
    Location
    face778c
    Posts
    1
    Thank you for word.

  8. #8
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    Quote Originally Posted by face778c View Post
    Thank you for word.
    wt do you mean by word????
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  9. #9
    Join Date
    Oct 2010
    Posts
    4
    Quote Originally Posted by mathukumali View Post
    wt do you mean by word????
    by answer, I guess

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by mathukumali View Post
    wt do you mean by word????
    face778c and pjumppod are just spammers hoping to have links to their sites indexed by google. We have changed the settings round here so their sites do not get indexed. I have not bothered deleting and banning them since the effort is not worth it any more.

    However, it is worth remembering that not everyone who responds on here has your best interests at heart.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    thanks pootle
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  12. #12
    Join Date
    Oct 2010
    Posts
    4
    Quote Originally Posted by pootle flump View Post
    face778c and pjumppod are just spammers hoping to have links to their sites indexed by google. We have changed the settings round here so their sites do not get indexed. I have not bothered deleting and banning them since the effort is not worth it any more.

    However, it is worth remembering that not everyone who responds on here has your best interests at heart.
    I am sorry for make myself like spammer but I am not spammer,
    I am new for the database and come here for get anther trip.

    and I didn't see any question on this topic....

    but I found the trip and I am happy when I keep up one level.

  13. #13
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    Quote Originally Posted by pjumpod View Post
    I am sorry for make myself like spammer but I am not spammer,
    I am new for the database and come here for get anther trip.

    and I didn't see any question on this topic....

    I am happy when I keep up one level.
    see all the posts one by one you will find what it was
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by pjumpod View Post
    I am sorry for make myself like spammer
    You had posted two pointless posts and filled your profile with links. That smells like spam. You have, however, posted a relevant post in Postgres which I confess I had missed initially. You also came back to defend yourself. As such I'll withdraw my comment and withhold judgement.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •