What does all the punctuation mean?

Results 1 to 2 of 2

Thread: What does all the punctuation mean?

  1. #1
    Larry Kerr Guest

    Default What does all the punctuation mean?

    I have to give a class on ASP. So I need to be able to explain what all the punctuation in an SQL statement means but simply. In the following- where city=&#039" & firstcity & "&#039 - what purpose do the single quote, double quote and ampersand serve? My understanding is the single quote warns there is text coming and then marks the end of the text.

  2. #2
    Jason Miller Guest

    Default String Concationation Explained a bit...

    Let&#039s go for one that&#039s really nasty:<BR> .doSQL("update [" & tbl & "] set dDate = #12/31/99# where goddess like &#039%" & strDiscordian & "%&#039")<BR><BR>Okay, .doSQL is my function which takes a string and hits my database with it. Don&#039t worry about that bit. Same effect as a objConn.execute.<BR><BR>This will set the dDate column of my specified table to just before Y2K whenever the goddess column resembles something discordian (as specified).<BR><BR>" begins our string of SQL.<BR>[ warns the database that the name coming up might not be standard. This is a good practice, at least on MS databases.<BR>" stops the SQL string.<BR>& attaches another string (in this case, it&#039s my asp variable tbl)<BR>& " attaches more sql string.<BR>= sets the stated SQL column to something else,<BR># is a quotation mark for a date (this is a date, not a string or a number, honest! -- though databases don&#039t always appreciate honesty, watch for that...)<BR>&#039 is a quotation mark for a database.<BR>% is a wildcard for a database<BR>" & stop the sql and attach something from my ASP<BR>& " stop the ASP and attach more sql<BR>% another wildcard<BR>&#039 done with the value we&#039re looking for<BR>" done with the sql command.<BR><BR>For a more practical example of %, just do a "Find Files" for *.ex* on your computer -- it returns any files with ".ex" anywhere in them -- the is the * of SQL.<BR><BR>HiH

Posting Permissions

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