Questions tagged [tablename]

143 questions
1
vote
1 answer

ssis dynamic t-sql statement with use of parameter as table name

I've downloaded Visual Studio 2015 and SQL Data Tools 2015, because I'm trying to make a simple SSIS package for copy some data rows from a table in a db on a server to a table in another db on another server.I have some complications that make my…
1
vote
1 answer

How to use custom table as auth table instead user table?

I am beginner of Laravel 5.3. What i want is to use custom table as auth table instead user table. Because user table should be used for other purpose. How can I edit config/auth.php or other thing? Please help me! file auth.php
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
1
vote
2 answers

Ruby: Variable as tablename

I am looking for a way to get a variable being used as a tablename. As example actually it looks like this: @user = User.new but, can I do this like wrktablename = "User" @my_table = wrktablename.new Please note, that wrktablename really can be…
Cokiehh
  • 63
  • 1
  • 11
1
vote
2 answers

SQLiteLog: no such table

About my app: Saves training performance - one database with many tables(one table is log of workout). Date is name of the table( e.g. d2016_08_09 ). When user presses "save button", app sets name of table. public static final String DB_NAME…
Xalion
  • 623
  • 9
  • 27
1
vote
1 answer

MYSQL - SELECT data from dynamic table names

Imagine that I have several dynamic table names such as : select table_name from INFORMATION_SCHEMA.TABLES where table_name like 'ifhcraw%'; ifhcraw_2016_03_25_13 ifhcraw_2016_03_26_19 ifhcraw_2016_03_28_2 And I don't found any rule on names. To…
Javid
  • 47
  • 2
  • 8
1
vote
2 answers

How to override name mapping between models and SQL table names?

I have my Rails 5 ApplicationRecord: class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end and a bunch of models that inherit from ApplicationRecord. Now, I would like each model name to map to its database table in a…
Jake
  • 15,007
  • 22
  • 70
  • 86
1
vote
1 answer

Using a variable in a table name without dynmaic SQL

How can I use a variable in a SQL query without using dynamic SQL and the concat method? I’d love to be able to declare variables at the start of a script to then use them throughout the script (e.g. table names) Here’s an example of what I’d like…
Lucas
  • 401
  • 1
  • 8
  • 20
1
vote
3 answers

laravel models, class names, table names and directory structure best practices

I was wondering what would be the best practice to create the following tables and relations in eloquent / laravel 4.1 models. table name magazines with fields id, title table name magazine_issues with fields id, title, magazine_id table name…
papas-source
  • 1,221
  • 1
  • 14
  • 20
1
vote
1 answer

How to safely drop a table with a variable name?

Suppose I want to drop a table, whose name is a variable value, such as "#t". SqlCommand cmd = new SqlCommand( "drop table " + TableName ); //Not safe SqlCommand cmd = new SqlCommand( "drop table [" + TableName +"]" ); //Not safe EXEC( 'drop table…
Triynko
  • 18,766
  • 21
  • 107
  • 173
1
vote
0 answers

Select column from similarly named tables

I want to select a specific column form many tables that have similar names i.e.: Tables Names x1 x2 x3 y1 y2 z1 smth like this : select field from like x%; all tables have the same structure and column names
Krisid Misso
  • 126
  • 1
  • 8
1
vote
1 answer

Why is RedBean not using plural table names?

Or can we do that? It's doesn't look good too when you say: $book = R::dispense('books'); and just handle the naming with an RedBean_IModelFormatter or am I missing something? Thanks.
Jojo
  • 643
  • 10
  • 26
1
vote
2 answers

Can I pass table name as argument to a java prepared statement?

I am writing a DAO layer IN Java for my Tomcat server application, I wish to use Prepared Statement wrapping my queries (1. parsing queries once, 2. defend against SQL injections), My db design contains a MyISAM table per data source system. And…
Michael
  • 2,827
  • 4
  • 30
  • 47
1
vote
2 answers

MySQL conditional table name in JOIN

I'm working on intellecual property management system, where I have 2 tables in database - trademark and design. Then I have such thing as opposition. This means, if someone else has trademark or design, that looks like our's clients one, manager…
Serge Kuharev
  • 1,052
  • 6
  • 16
0
votes
2 answers

has_and_belongs_to_many where both models have underscore names

I'm working with Rails 3.2.1 and have the two models CookingVenue and DiningVenue with associated MySQL tables of cooking_venues and dining_venues. I have set up the has and belongs to many relationship between the two models but what's the name of…
nexar
  • 11,126
  • 3
  • 29
  • 32
0
votes
2 answers

Zend_Db_Table_Abstract $_name not working

I encountered a problem regarding changing default table name class Application_Model_DbTable_Game extends Zend_Db_Table_Abstract { protected $_name = 'games'; Error: Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table…
shiva8
  • 2,142
  • 2
  • 19
  • 24