Results 1 to 7 of 7
Like Tree2Likes
  • 1 Post By UtOkbOlinAO
  • 1 Post By Eden Arnoco

VB, MySQL, Looping thru several columns


This discussion is about "VB, MySQL, Looping thru several columns" in the "Programming" forums.
gusto ta nako nga i.loop ang columns bitaw from q1,q2...q13, unsay dapat ibutang na sql syntax ani?...

  1. #1
    Junior Member Eden Arnoco's Avatar
    Join Date
    May 2012
    Gender
    Female
    Posts
    291

    Default VB, MySQL, Looping thru several columns




    gusto ta nako nga i.loop ang columns bitaw from q1,q2...q13, unsay dapat ibutang na sql syntax ani?

  2. #2
    Elite Member UtOkbOlinAO's Avatar
    Join Date
    Nov 2008
    Gender
    Male
    Posts
    1,273
    Quote Originally Posted by Eden Arnoco View Post


    gusto ta nako nga i.loop ang columns bitaw from q1,q2...q13, unsay dapat ibutang na sql syntax ani?
    why do you need to loop all the columns of a table?

    murag dili man ni siya good practice, kay one good reasons is that once mausab ang structure sa table mag.error nana imong insert script.
    Eden Arnoco likes this.

  3. #3
    Junior Member Eden Arnoco's Avatar
    Join Date
    May 2012
    Gender
    Female
    Posts
    291
    Quote Originally Posted by UtOkbOlinAO View Post
    why do you need to loop all the columns of a table?

    murag dili man ni siya good practice, kay one good reasons is that once mausab ang structure sa table mag.error nana imong insert script.
    noted! pero ang gusto sa amo leader sa group project nga i.shortened dw, given nga di mausab ang Questionnaire Table.. mahulog na xa karon ug 60 plus columns.

  4. #4
    Elite Member UtOkbOlinAO's Avatar
    Join Date
    Nov 2008
    Gender
    Male
    Posts
    1,273
    aw, good luck. hehehehe

    pero if ingon ana jud inyong approach, you can try the following, mao ni ako gihimo provided same ta ug database.

    1. Query all the columns of the said table. something like "from user_tab_columns" or with the likes.
    2. store it in a string variable with comma separated values
    3. use it in your string variable.

    Caveat:

    Always check the output of your string kung sakto ba ang porma and good luck

  5. #5
    Junior Member Eden Arnoco's Avatar
    Join Date
    May 2012
    Gender
    Female
    Posts
    291
    Quote Originally Posted by UtOkbOlinAO View Post
    aw, good luck. hehehehe

    pero if ingon ana jud inyong approach, you can try the following, mao ni ako gihimo provided same ta ug database.

    1. Query all the columns of the said table. something like "from user_tab_columns" or with the likes.
    2. store it in a string variable with comma separated values
    3. use it in your string variable.

    Caveat:

    Always check the output of your string kung sakto ba ang porma and good luck

    na.okay na.. hehehe.. thanks! gidebatehan pa ni namo.. kay igka sunday na deadline.. tapos di pa jud mi programmers.. lol

    UtOkbOlinAO likes this.

  6. #6
    Newbie
    Join Date
    Feb 2019
    Gender
    Male
    Posts
    53
    Yep, look like the person is the real programmer so he provided the solution to that matter anyway. And how else it really needs to be done for whatever reason out there. I do not want to make it anyway. I do want to take some letters with you.

  7. #7
    C.I.A. Rainerius's Avatar
    Join Date
    Jan 2008
    Gender
    Male
    Posts
    2,082
    From stackoverflow.com, easy peasy.

    SELECT *
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = N'ACTUAL_NAME_OF_TABLE'

    this should give you a list of columns, sa .NET maybe an SQLDataReader would be good with a while loop.

  8.    Advertisement

Similar Threads

 
  1. Replies: 0
    Last Post: 09-09-2009, 11:22 AM
  2. vb loops algorithm
    By hybrid_X in forum Programming
    Replies: 2
    Last Post: 05-25-2007, 08:07 AM
  3. unsay nindot software para mag fax thru ur cpu?
    By etgo in forum Software & Games (Old)
    Replies: 8
    Last Post: 06-07-2006, 10:29 AM
  4. VB OLEDB ---> APACHE SERVER MYSQL
    By rvyne in forum Websites & Multimedia
    Replies: 12
    Last Post: 07-09-2005, 12:10 PM
  5. Unsa.un pag transfer games sa nokia 3300 thru data cable?
    By piaosigua in forum Gizmos & Gadgets (Old)
    Replies: 4
    Last Post: 04-29-2005, 02:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top