Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. urgent plz

urgent plz

Scheduled Pinned Locked Moved Database
databasehelp
11 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M magedhv

    after a spacific search criteria (sql statement ) the results was some names required : i want to edit all this records with another name plz help me

    K Offline
    K Offline
    kubben
    wrote on last edited by
    #2

    In your select statement is where you would change column names. So if your table looks like this: Select Firstname, LastName, account, PhoneNumber from yourtable you can change the column names like so: Select FirstName as First, LastName as Last, account as Acct, PhoneNumber as Phone from yourtable Hope that helps. Ben

    M 1 Reply Last reply
    0
    • K kubben

      In your select statement is where you would change column names. So if your table looks like this: Select Firstname, LastName, account, PhoneNumber from yourtable you can change the column names like so: Select FirstName as First, LastName as Last, account as Acct, PhoneNumber as Phone from yourtable Hope that helps. Ben

      M Offline
      M Offline
      magedhv
      wrote on last edited by
      #3

      no that's not what i mean but thnaks 4 ur reply i mean when i made this statement he gave me a coloum called fatrname this coloum contain some names like this : maged1 maged2 maged3 all what i mean is if there is any way to type insetad of all these names one word as "maged" only or whatever in another words i want to integrate all these (maged1,maged2, .... )to the word that i want which is "maged"

      K 1 Reply Last reply
      0
      • M magedhv

        no that's not what i mean but thnaks 4 ur reply i mean when i made this statement he gave me a coloum called fatrname this coloum contain some names like this : maged1 maged2 maged3 all what i mean is if there is any way to type insetad of all these names one word as "maged" only or whatever in another words i want to integrate all these (maged1,maged2, .... )to the word that i want which is "maged"

        K Offline
        K Offline
        kubben
        wrote on last edited by
        #4

        Ok it sounds like you have three columns in a table and you want to return only one column. If all three columns are of the same type you can do a union. So if you have: Select maged1, maged2, maged3 from yourtable You can do select maged1 as maged from yourtable union select maged2 as maged from yourtable union select maged3 as maged from yourtable Ben

        M 1 Reply Last reply
        0
        • M magedhv

          after a spacific search criteria (sql statement ) the results was some names required : i want to edit all this records with another name plz help me

          K Offline
          K Offline
          Krish KP
          wrote on last edited by
          #5

          your query is not clear. is that you want to use column alias for your insert/update/....

          Regards KP

          1 Reply Last reply
          0
          • K kubben

            Ok it sounds like you have three columns in a table and you want to return only one column. If all three columns are of the same type you can do a union. So if you have: Select maged1, maged2, maged3 from yourtable You can do select maged1 as maged from yourtable union select maged2 as maged from yourtable union select maged3 as maged from yourtable Ben

            M Offline
            M Offline
            magedhv
            wrote on last edited by
            #6

            sorry to tell u that's wrong too i have table here contain some itmes after search he gave me this results maged1 maged2 maged3 .... and here is my sql statement :select fatrname from reglz where fatrname LIKE '%" & TextBox1.Text & "%' after that i want to edit them to only the word maged

            P 1 Reply Last reply
            0
            • M magedhv

              sorry to tell u that's wrong too i have table here contain some itmes after search he gave me this results maged1 maged2 maged3 .... and here is my sql statement :select fatrname from reglz where fatrname LIKE '%" & TextBox1.Text & "%' after that i want to edit them to only the word maged

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #7

              You want to issue an update statement, like this:"update reglz set fatrname = 'maged' where fatrname like '%" + TextBox1.Text + "%'"Now, before you go getting all excited about this there are a couple of things you should be aware of. 1. This code is extremely prone to SQL Injection attacks, so I would suggest that you would want to look at changing this to use parameters (without knowing which database you are using, I can't really tell you which parameters to use). (See this[^] article on SQL Injection attacks. Colin does a great job of explaining what it's all about. 2. You should never rely on the default names of properties. Please change TextBox1 to be something meaningful.

              Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

              1 Reply Last reply
              0
              • M magedhv

                after a spacific search criteria (sql statement ) the results was some names required : i want to edit all this records with another name plz help me

                L Offline
                L Offline
                leckey 0
                wrote on last edited by
                #8

                Please read the forum guidelines. Do not use words like 'urgent' or 'help' in your message titles. Give them some meaning. Also, do not use text speak.

                _____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!

                P 1 Reply Last reply
                0
                • L leckey 0

                  Please read the forum guidelines. Do not use words like 'urgent' or 'help' in your message titles. Give them some meaning. Also, do not use text speak.

                  _____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #9

                  I would like to see a function that tells people that their message couldn't be posted because text speak is in the message. Wouldn't be that hard to validate the subject line...

                  "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

                  V 1 Reply Last reply
                  0
                  • M magedhv

                    after a spacific search criteria (sql statement ) the results was some names required : i want to edit all this records with another name plz help me

                    V Offline
                    V Offline
                    Vasudevan Deepak Kumar
                    wrote on last edited by
                    #10

                    Please use an appropriate subject.

                    magedhv wrote:

                    urgent plz

                    This does not convey anything.

                    magedhv wrote:

                    spacific

                    Check your spelling (typo). I was interpreting it as South Pacific. :mad:

                    Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                    1 Reply Last reply
                    0
                    • P Paul Conrad

                      I would like to see a function that tells people that their message couldn't be posted because text speak is in the message. Wouldn't be that hard to validate the subject line...

                      "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

                      V Offline
                      V Offline
                      Vasudevan Deepak Kumar
                      wrote on last edited by
                      #11

                      In Brinkster.com free hosting, I think if you violate hosting rules like setting more ScriptTimeout, your ASP would be renamed as .BADTIMEOUT by an ISAPI filter. How about having such a ISAPI filter that does the following tasks: (*) Append 'VIOLATING_POST' (*) Auto Vote (1) from CP Server itself. ;) :)

                      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups