Several Programming Questions

  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

I've looked everywhere to find a place that would give me a SQL statement that creates (or modifies) an integer field with auto increment (Autonumber) in my MS ACCESS database.

Below are some of the statements I've tried unsuccessfully!

"CREATE TABLE table_name
(int_field INT AUTOINCREMENT)"

"CREATE TABLE table_name
(int_field INT AUTONUMBER)"

"CREATE TABLE table_name
(int_field INT COUNTER(1,1))"

"CREATE TABLE table_name
(int_field INT UNIQUE IDENTIFIER)"

Can someone please help me!

Thanks in advance.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

You can find the syntax for MySQL, SQL Server, Access, and Oracle over here.
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What are the authentication modes in SQL Server? How can it be changed?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What are the properties and different Types of Sub-Queries?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What is difference between DELETE & TRUNCATE commands?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What are the different index configurations a table can have?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Assuming you're refering to SQL, "TRUNCATE" will delete all of the rows in a table and depending on the SQL engine and engine version, reset any counters such as auto_increment. "DELETE" gets rid of the entire table completely instead of just emptying it.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

What type of server should we assume?
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

The two are very similar, however, the HAVING clause can be used in conjunction with aggregate clauses (like GROUP BY), which allows you a slightly different approach. Have a look here for a more detailed explanation:

http://www.itjungle.com/fhg/fhg050907-story01.html
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Are we doing your homework or what? This is ridiculous - this is like the 5th school-esque question I've answered for you this morning. LMGTFY
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

How do I adopt or take over a module already on CPAN?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

What's the difference between dynamic and lexical (static) scoping? Between local() and my()?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

How can I catch accesses to undefined variables, functions, or methods?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

How do I clear a package?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

How do I declare/create a structure?
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

How can I access a dynamic variable while a similarly named lexical is in scope?
  • mk27
  • Proficient
  • Proficient
  • User avatar
  • Posts: 334

Post 3+ Months Ago

gkumar wrote:
How do I adopt or take over a module already on CPAN?


Probably you would have to contact the current maintainers, but don't quote me. ;)

"my" is a lexically scoped variable and "local" a dynamic one. Meaning you can use local to replace the value of a variable, but this replacement only lasts as long as the block in which it is declared:
Code: [ Select ]
 
#!/usr/bin/perl -w
use strict;
 
our $x = 10;
 
sub test1 {
    local $x = 20;
    test2();
}
 
sub test2 {
    print "$x\n";
}
 
test1();
print "$x\n";
 
  1.  
  2. #!/usr/bin/perl -w
  3. use strict;
  4.  
  5. our $x = 10;
  6.  
  7. sub test1 {
  8.     local $x = 20;
  9.     test2();
  10. }
  11.  
  12. sub test2 {
  13.     print "$x\n";
  14. }
  15.  
  16. test1();
  17. print "$x\n";
  18.  

So this will print 20 then 10, because the value of $x was replaced, but only for the duration of test1() -- hence this is a runtime event and labelled dynamic. If the global $x did not previously exist, the local version in test1() would just be like a normal lexical variable; it would not have the scope to reach test2() and there'd be an error.

"our" is lexical like "my", but you cannot localize a "my" variable.

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 66 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.