Temporary tables are tables that automatic lose their content at the end of a transaction or session.
0
votes
0answers
8 views
MySQL procedure temporary table Select
I'm trying to create a temporary table and select results from it, inside a mysql procedure.
Here's a piece of the SQL
DELIMITER $$
CREATE PROCEDURE `mydb`.`simulate_results` (currdate DATETIME, ...
4
votes
2answers
52 views
Why SQL throws an error if I have a legal code the never will be reached?
I've got a very strange behavior with the below code.
--IMPORTANT: Do not use 'GO' since it will terminate
--the batch and it is only usable in Microsoft tools
--and not in the code itself.
--I don't ...
0
votes
4answers
41 views
Insert into sql temp table with a default column
I'm creating a temp table in tsql with 1 column having a default value as below:
DECLARE @MyTable Table (MyName varchar(40) Primary Key not null, Updated SmallInt NULL DEFAULT 0)
When I run an ...
0
votes
2answers
49 views
Check if declared global temporary table exists in current session
How can I check if a declared global temporary table in DB2 exists or not in the current session?
I need to create the temporary table once for a user session and then be able to insert rows in it ...
0
votes
1answer
35 views
Mysql multi statement in php
I'm not very good at speaking English so I'm supporting the translator of google, thanks.
What happens is that I'm working with google maps api and I have a database with some shops, the database is ...
0
votes
2answers
28 views
How to creat a temporary table using existing tables with their records in MySQL?
How to create a temporary table using existing tables with their records in MySQL? These are five tables and I want to apply an UPDATE query. So when I run the query how it finds the real table and ...
0
votes
1answer
23 views
MySQL performance: …IN (SELECT…) vs IN ('12', '18', 30'…) vs Temporary Table
I have a number of calls which are similar. Below is one:
$STH = $DBH->prepare("
SELECT t.mobile, t.unum
FROM teacher t
LEFT JOIN s_group_member m ON m.unum = t.unum
LEFT JOIN s_group g ON g.gnum ...
0
votes
0answers
18 views
ODP.net OracleBulkCopy to global temporary with ORA-39776: fatal Direct Path API error loading table error
I am using the ODP.net OracleBulkCopy to bulk copy to a global temporary table which has no pk and no indexes and it comes back with ORA-39776: fatal Direct Path API error loading table error. I've ...
0
votes
2answers
44 views
SQL: How to create a temp table and fill it with date within a select-from statement
I wish to create a temp table with 1 datetime column and then fill it with date(30 days before today). I wish to do all these in a select-from statement.
I could do it with a "WITH" loop as below ...
0
votes
1answer
79 views
Creating a temporary table with one extra column using Hibernate
I have a sequence of 5 forms that an user has to fill up in my system. On each submitted form, I send the data to my java server and store this data on mySQL database using Hibernate.
In this ...
1
vote
1answer
53 views
Query not giving correct results (PHP/MySQL)
I'm getting a weird result from a quite long query, which I will simplify here:
DROP TEMPORARY TABLE IF EXISTS table1;
CREATE TEMPORARY TABLE table1 AS
(SELECT
parent.id as parent_id,
times.a_time,
...
0
votes
1answer
37 views
Use #temp inside a parenthesis
How use a #temp inside a parenthesis?
Or how to use a table variable inside a parenthesis?
Clearly the real query is much more complex.
Fails:
IF OBJECT_ID(N'tempdb..#Temp', N'U') IS NOT ...
0
votes
1answer
37 views
MySQLdb return `Decimal` for a `sum` of `INT`
This is the table definition I use to reproduce the issue:
create table test_sum_type
(
kind char(1) not null,
n tinyint not null
);
Test data:
+------+---+ ...
0
votes
1answer
30 views
A persistent temporary table?
Right now, I'm using temporary tables in my select queries to speed up the execution. They are created every time I execute the query.
In my current situation, the tables are updated with new data ...
0
votes
0answers
47 views
SQL in Visual Basic, Operation not allowed when object is closed
I'm struggling to connect to a database after having created a temp table using visual basic. A normal SQL query such as select * from table1 works fine, but the moment I introduct a temptable into ...
1
vote
3answers
79 views
What to use? View or temporary Table
I have a problem to decide whether to use a view or a temp table.
I have a stored procedure that i call from program. In that SP i store the result of a long query in a temp table, name the columns ...
1
vote
1answer
100 views
File data propagation between controller actions in Spring MVC
I have to process an Excel file in order to insert some data into a Mysql database on a web based application. I am using Spring MVC as the architecture.
The problem is I need to include a mid-step ...
1
vote
2answers
40 views
Drop temporary tables in a single session
How to drop the temporary tables in procedures for the same session.
Because I am facing a problem regarding temporary tables in Postgres Sql. If two procedures:
A() having a temporary table say ...
0
votes
2answers
52 views
Temporary Tables in Postgres Sql
I am facing a problem regarding global temporary tables in Postgres Sql. If two procedures:
A() having a temporary table say temp(id, name)
B() having a temporary table say temp(id, name, address)
...
1
vote
0answers
74 views
Using a Temporary Table in a Stored Procedure
I am trying to create and then call on a temp table in a stored procedure. What I am trying to accomplish is combining yearly data with quarterly data. For example: I have a field that has data for ...
6
votes
5answers
221 views
Duplicate all rows in a table and prevent duplicate keys
I am tring to do this
Get all rows in a blogs named table.
Copy them in a temporary database
Edit the language field of this temporary table records
Insert into the blogs table
And I'm trying it ...
0
votes
1answer
67 views
SQL script to check a value then if found increment a field by a value of 1
Im trying to write a script that will pull the information from a table called 'bookings', this contains a column that gives the length of each booking called 'hours'. Values in this column are shown ...
1
vote
2answers
123 views
Drop set of columns with only null values from a table using SQL Server 2008
Take for example this example as an illustration so you can see what Î'm trying to do.
This is how the final table of the pivoted information looks like.
Create Table [#Comparative]
(
Branch ...
0
votes
1answer
53 views
What does the suffix of a temporary table's name mean?
If you expand the tempdb node and go to Temporary Tables, you will notice the name of the temporary tables have "______XXXXX" appended. Where does that part refer to?Is it the memory place where the ...
1
vote
1answer
75 views
Insert speed Temporary Table vs Normal table
there are many threads about temporary tables vs table variables.
However, my question is, what makes temporary table much faster than normal table in Microsoft SQL Server?
My stored procedure runs ...
0
votes
0answers
21 views
using @temptable or #temptable and droping them [duplicate]
what is the difference between @temptable and #temptable.
I have used the #temptable and when I tried to access it in Microsoft reports(.rdlc) the column name of the store procedure were not visible.
...
1
vote
2answers
63 views
SQL Generate Missing Records in SELECT
Using MS SQL Server 8.0.760 (2000)
I have a Table like this:
Table A
Day | Hour | Value
2012-10-01| 12 | 780
2012-10-01| 14 | 678
2012-11-02| 08 | 123
2012-11-02| 09 | 473
Expected ...
0
votes
3answers
114 views
How to create a temporary MySQL table with a UUID name in Coldfusion?
I'm using Coldfusion8 and MySQL 5.0.91 and am trying to create a temporary table, import some data from CSV, validate, store in database and drop the temp table.
I can do all steps in MySQL directly, ...
1
vote
2answers
28 views
How to select from a table with criteria needing to match a temporary table?
I have two tables. One contains articles, the other one price quotations. I'm trying to select [EAN] from the articles table and price from the quotation table if dimensions in both tables are ...
0
votes
0answers
37 views
How to use an “IN” clause with an array?
I am trying to do this:
SET @my_array = (54,24,155,76,96,255,...);
INSERT INTO some_table WHERE something IN @my_array...;
DELETE FROM some_table WHERE something IN @my_array...;
INSERT INTO ...
0
votes
0answers
15 views
temporary tables not working if database dont have insert permission
In my application i have used temporary tables but now my database server has been changed and new server don't have insert permission for tables.Now my temporary tables not working.
Is it possible ...
0
votes
1answer
57 views
What does `delete <table name>` in PLSQL code mean?
I have a PLSQL code with the following line of code.
delete my_table;
Where my_table is a Global Temporary Table. I am guessing the above code means, delete all rows from the table. However, I am ...
1
vote
1answer
246 views
oracle pl/sql loading large data into temp table
I have a use case where a large amount of data sometimes a million rows added to a temporary table (session global temp table) and the table to be joined to another table to produce ...
1
vote
1answer
986 views
DECLARE GLOBAL TEMPORARY TABLE Vs CREATE GLOBAL TEMPORARY TABLE in DB2
am creating a GLOBAL TEMPORARY TABLE in DB2. and when i surfed i got a two way to create
1. Declare
2. Create.
1. DECLARE GLOBAL TEMPORARY TABLE SESSION.TEMP_EMP
(EMPNO CHAR(6) NOT NULL,
...
1
vote
2answers
849 views
Creating temporary tables in SQL
I am trying to create a temporary table that selects only the data for a certain register_type. I wrote this query but it does not work:
$ CREATE TABLE temp1
(Select
egauge.dataid,
...
0
votes
1answer
572 views
Insert Data vertically into temp table using cursor
As above mentioned. I have created 2 temp tables in SQL and need to insert vertically to complete all columns but as I understand, you can only insert data horizontally?
Is there a way around this?
...
1
vote
1answer
266 views
Firebird: simulating create table as?
I'm searching a way to simulate "create table as select" in Firebird from SP.
We are using this statement frequently in another product, because it is very easy for make lesser, indexable sets, and ...
0
votes
1answer
228 views
Apache Tomcat Connection Pool and Oracle Global Temporary Table. Can data be shared?
I got some spring batch jobs running on multipartitions...I wanted to use oracle's global temporary tables as my batch job's staging table so that the staging table lives only during my job run...As ...
0
votes
0answers
263 views
MySQL Hibernate delete bulk joined-subclass , temporary table locks the table
I am using PlayFramework (1.2.5) , there is one class MedicalLog extends class Log , as follows :
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class Log extends Model { ... }
and
...
1
vote
1answer
115 views
How to list declared temporary tables in DB2
You can created session temporary tables in DB2 using the DECLARE GLOBAL TEMPORARY TABLE statement. Is there any way to list all the tables that currently exist in the session's SESSION schema? Note ...
-1
votes
2answers
728 views
Unable to copy data to temporary table using select statement in sql - server 2008
I am copying the data to temporary table using select statement which produces the result of pivoting.
My procedure is:
alter procedure proc11 AS
create Table #Temp (Software varchar(max), Ver ...
0
votes
1answer
350 views
Storing records to temporary table inside dynamic query when using Pivot.
I am new to sql programming.
I want to store the records returned as result set from the pivot query.
Pivot's columns are selected dynamically.
My query is:
declare @cols nvarchar(max)
set ...
0
votes
0answers
22 views
ADODB Cursors and Temporary Tables
If I create a temp table using SQL through an ADODB connection with a client-side cursor location, will there be any issues accessing it through an ADODB created using a server side cursor or vice ...
0
votes
0answers
523 views
How to allow temporary tables to accept null values
If you create temp tables using "insert into" in SQL Server it uses the first insert to determine whether a column accepts null value or not. if the first insert has null value the column become ...
0
votes
2answers
342 views
Update from Temp Table
Query:
SELECT ID, T.c.value('@Address', 'nvarchar(20)' ) as Address
INTO #TMP
FROM TABLE1
CROSS APPLY XMLData.nodes('/Document') AS T(c)
UPDATE TABLE1
SET HomeAddress = (SELECT TOP 1 t.Address
...
0
votes
1answer
350 views
How MySQL put all NEW/OLD trigger data to temporary table and use in procedure?
How to put the NEW/OLD data into temporary table without filed name.
I've tried create trigger, procedure like this but it fails:
CREATE TRIGGER `after_insert` AFTER INSERT
ON `master`
FOR EACH ROW ...
0
votes
2answers
251 views
DB2 9.7 SQL syntax, what am I doing wrong?
For one reason or other which are out of my control I am attempting to simply pull data over the past 12 months. However, essentially down to the size of data, I have to query each day into a temp ...
0
votes
1answer
129 views
MySQL Temp Tables or View?
I got 3 tables that have stored common data from registration from users: languages, countries, nationalities. Each table have fields: id and name.
I got a main table users where it stores almost all ...
0
votes
1answer
183 views
Create temporary TABLE inside a FUNCTION [duplicate]
How can I create a temporary table that I can return when the function is called?
0
votes
0answers
59 views
How to work with temporary tables in CakePHP2.x
i read a lot of other postings about my problem, but i don't know how to solve it:
i read 2 tables and want to combine them in one temporary table.
i tried, like other users with following code:
...