|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using a varible as a table name
Originally posted by : Janet (janet.miller@noaa.gov)I want to assign a table name to a variable and use the variable in the sql statement.Can someone provide me with the correct syntax to do this?Thanks!Janet
|
|
#2
|
|||
|
|||
|
Originally posted by : LosEnricos (TheDude@bananateam.nl)try something like this:"SELECT * FROM " & variable_name if you want to put in a where statement try somthing like this:"SELECT * FROM " & variable_name & " WHERE ID = "1" if this doesn't work, be more specific, and I will try againregards The Dude------------Janet at 1/3/2002 8:55:46 AMI want to assign a table name to a variable and use the variable in the sql statement.Can someone provide me with the correct syntax to do this?Thanks!Janet
|
|
#3
|
|||
|
|||
|
Creating table busing variable table name
I am trying to create a table using the following line of code in Java using Jdbc_Odbc bridge.
The following statement is not working: statement.execute("create table " & tablename & " (Name char, Id number, Age number)"); I have checked with the whitespaces also but I am not able to track my mistake in syntax Error give: operator & cannot be applied to java.lang.String,java.lang.String tablename is variable which has the name of the table being given by the user. Can you help me on this fast. Thanks |
|
#4
|
|||
|
|||
|
Just for reference, for other searchers, this works in FrontPage too. My code below
CREATE TABLE " & title & " (MyField1 varchar,MyField2 varchar) |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Using a varible as a table name |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|