LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

database connectivity toolkit -- create table

Is it possible to implement the SQL command of AUTO_INCREMENT for the 1st column while creating table right at the start? ie making use of the "create table.vi" in the database connectivity toolkit?
I know this can be done if i execute the SQL Command via the "execute query.vi". Just asking if there might be a better way. Thanks.
 
Hope to achieve a similar output as shown below where the 1st column is set for auto-increment:
 
No | Name| Age
1   | John  | 25
2   | David | 28
3  | .....      | ....
4.....
5 .........
0 Kudos
Message 1 of 5
(2,554 Views)
Hey HWJ,

I checked around and I think that the "execute query" method would be the best way to go about doing this.  I couldn't find a VI that had the AUTO_INCREMENT option and checked the Database Connectivity Toolset Manual and didn't find any reference to that command.  Please let me know if you have any further questions!

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 5
(2,535 Views)

hi Andy, thanks for your reply. Just 1 more question. I received a syntax error prompt for the following SQL command when i attempted to execute it via the "execute query.vi". Any reason for this?

SQL Command - price Double (4,2) DEFAULT '0.00' NOT NULL,

the error  -- syntax error near '('.

I had used the same command for the SQL 5.0.19 and it worked. But couldnt understand or find out why executing the same command in labview resulted an error.

0 Kudos
Message 3 of 5
(2,523 Views)
HWJ,

I am not sure what is causing the syntax error there.  What are you trying to do with that query command? 

Thanks!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 4 of 5
(2,515 Views)
hi Andy, it's part of my programming for the development of 1 of my projects related to SQL server. I had been encountering difficulties in executing certain SQL commands mainly due to syntax errors which I dont know why especially if they could been executed via the command prompt of the SQL, why errors occur in Labview. Anyway, thanks for all your help, I'll try to think of some other ways to implement my login for the program. Have a nice day Smiley Happy 
0 Kudos
Message 5 of 5
(2,510 Views)