Link to home
Start Free TrialLog in
Avatar of Cosine_Consultants
Cosine_Consultants

asked on

PL/SQL question

SELECT CUBEID, PERKEY, PRODKEY, MKTKEY, #1, #3
FROM #2
  WHERE CUBEID IN (SELECT nc_cube_id
                      FROM CUBES1
                   WHERE nc_prodcycle      = #4
                     AND nc_service_id     = #5
                     AND nc_datamart_id    = #6
                     AND nc_application_id = #7)
                            ORDER BY CUBEID, MKTKEY, PRODKEY, PERKEY';


Do you know what is the meaning of #1,#2,#3,#4,#5
Avatar of RainMan82
RainMan82

A temporary table.
A temporary table creates a snapshot of data for a connected user‚’s session. You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions. Prefix local temporary table names with single number sign (#table_name), and prefix global temporary table names with double number sign (##table_name). Queries run quickly against temporary tables because they generally use only one table rather than dynamically joining together several tables to obtain a result set.

sometimes an identifier beginning with a number sign denotes a temporary table or procedure.


good luck
Property names are preceded by either the “at” (@) or number sign (#) character. Use @ for relational queries, and # for regular expression queries.
ASKER CERTIFIED SOLUTION
Avatar of DrSQL - Scott Anderson
DrSQL - Scott Anderson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Whoever created that SQL had DEFINE set to "#", see the following example:

TEST@PROD > SHOW DEFINE
define "&" (hex 26)                                   --<<----------------------- Default value for DEFINE is "&"

TEST@PROD > SET DEFINE #                   --<<------------------------ Lets change it to "#"

TEST@PROD > SELECT * FROM DUAL WHERE DUMMY = #1;         --<<------ The "#" will prompt me for a value

Enter value for 1: 'X'                                                                 --<<-------- I entered 'X'                                            

old   1: SELECT * FROM DUAL WHERE DUMMY = #1
new   1: SELECT * FROM DUAL WHERE DUMMY = 'X'

D
-
X                                        

Elapsed: 00:00:00.12
all of them are bind variables.,
ya beat me to it ram lol...
its a worth a lookup on the code below after this select statement as they might do some replace stuffs which is what dr said in his post., probably a replace inside a loop.,