How to use the number as a variable?
Hello
I use SQL Developer 4.1.0.19.07... and every time I have use something like...
variable myVar Number; execute :myVar := 10;
A query as...
select :myVar "myVar" from dual;
Give me the output...
myVar ----- -- that is "null", as I don't have a null replacement ;-)
What I am doing wrong? Any advice (in addition to using VarChar2)?
Thanks in advance
Peter
This seems to be the same bug as noted in a discussion earlier: print in SQL Developer 4.1
Tags: Database
Similar Questions
-
How to find the number of bind variables declared in the current session
Hi all
I want to know a query to find out the number of variables declared in the current session.Note that the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions) * ', as well as for the issues with the SQL Developer tool. Please post these questions under the dedicated [SQL and PL/SQL | https://forums.oracle.com/forums/forum.jspa?forumID=75] forum (you have posted here before).
Kind regards
K. -
How to use the functions Timestampadd/Timestampdiff variable repository
Hello - I tried to build a block of initialization with Variables of repository to fill for below mentioned scenarios. In the EDIT SOURCE of the initialization block, I was trying to write the suite of applications:
Select
TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR FROM CURRENT_DATE) *-(1) + 1, CURRENT_DATE) as F_DAY_CY,
TIMESTAMPADD (SQL_TSI_YEAR-1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR FROM CURRENT_DATE) *-(1) CURRENT_DATE + 1)) as F_D_PY,
......
......
......
Double;
for which he throws following error thus failing to create the initialization block. Enjoy all the entries on this error.
Behold, I wanted to create for variables
First day of current year
TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) + 1, CURRENT_DATE)
First day of the previous year
TIMESTAMPADD (SQL_TSI_YEAR-1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) CURRENT_DATE + 1))
First day of the new year
TIMESTAMPADD (SQL_TSI_YEAR, 1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) CURRENT_DATE + 1))
First day of the previous month
TIMESTAMPADD (SQL_TSI_MONTH-1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) CURRENT_DATE + 1))
First day of the current month
TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) + 1, CURRENT_DATE)
First day of the following month
TIMESTAMPADD (SQL_TSI_MONTH, 1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) CURRENT_DATE + 1))
Last day of the previous month
TIMESTAMPADD (SQL_TSI_DAY,-(1), TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) CURRENT_DATE + 1))
Last day of the current month
TIMESTAMPADD (SQL_TSI_DAY, TIMESTAMPADD (1), (SQL_TSI_MONTH, 1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) CURRENT_DATE + 1)))
Last day of the following month
TIMESTAMPADD (SQL_TSI_DAY, TIMESTAMPADD (1), (SQL_TSI_MONTH, 2, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-(1) CURRENT_DATE + 1)))
Last day of the previous year
TIMESTAMPADD (SQL_TSI_DAY-1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) CURRENT_DATE + 1))
Last day of the current year
TIMESTAMPADD (SQL_TSI_YEAR, 1, TIMESTAMPADD (SQL_TSI_DAY-1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) CURRENT_DATE + 1)))
Last day of next year
TIMESTAMPADD (SQL_TSI_YEAR, 2, TIMESTAMPADD (SQL_TSI_DAY-1, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR CURRENT_DATE) *-(1) CURRENT_DATE + 1)))
Thank you!
Hello
Pool use in your init block, you had to choose a connection pool to use for the query, so the code to be used in an init block isn't OBIEE LSQL but it is true SQL based on the database of your connection.
So it depends on if your connection pool to connect to Oracle DB, SQL Server, or another type of database for the syntax to use in your query for date calculations.
-
Trying to figure out how to use the Windows calculator to convert a basic number of 50pico.
I can't find out how to enter to the power 10 - 12. When I type exp it evokes 10th + 0, I want 10-12. I also can't figure out how to use the brackets and parentheses, I tried to use help and can not find an answer for what I am trying to do. I need to convert a number of basic rating scientist 50pF.
Thank you, Doug
I found the answer to my question. When I clicked on the button in the calculator of + /-he would change 50 * 10 + 12 to 50 * 10-12 and give me the answer I was looking for.
Doug
-
How to limit the number of printers can be installed on this computer by using Group Policy?
How to limit the number of printers can be installed on this computer by using Group Policy?
Hello
Thanks for asking! If I understand correctly, you should limit the printers installed on the computer by using Group Policy. I suggest you follow the troubleshooting steps to check if this may help.
The question you have posted is related to Technet and would be better suited to the Technet community. Please visit the link below to find a community that will provide the best support.
http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer -
How to use the global variable in the table target?
Hello
I am trying to load several files into a single interface. the data is loaded successfully. 92. the files are there. for this I used variables and package.
My requrement is 92 files of data loaded into the target table. I want to know what data from file.
to this I added a column (filename) to the existing target table.
If I used joints (not same condition), its totally wrong. all file names are coming.
Please see the following screenshots.
exit; target table.
in fact in the target table. first 10 lines are coming from file.i.e first _ACCOUNT_LIMIT_511.TXT. but all the files names are coming.
I'm confuse. After the first data file inserted then insert second data file. in that all file names are coming. Please help me.
I thought that the global variable is preferable to identify the data came from which file.
to do this, the global variable is used in the target table. I don't always have my exit.
Please help me.
Thanks in advance.
Hello
You can use the same way, how you use the project variable, just you have to do a thin is #GLOBAL.variable_name for example: #GLOBAL. SMART_AL_FILE_NAME_S
Note: Make sure you that while you use one variable overall in interface, indicator should be staged as you chose above the screen
hope this helps you
Kind regards
Phanikanth
-
Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.
CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
)
RETURNS INTEGER
AS
-Declaring variables
v_is_true INTEGER.
BEGIN
SELECT
CASE
WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)
THEN 1
ON THE OTHER
0
END
IN
v_is_true
Of
in_schema.in_tablename
;
RETURN v_is_true;
END;
/
When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist
How to use the values of the input variables on the table select statement names?
Hello
Here's a way you can use dynamic SQL statements for this task:
CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
in_first_date DATE DEFAULT SYSDATE - 1,.
in_last_date DATE by DEFAULT NULL
)
RETURNS INTEGER
AS
-IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield
-contains all the dates in the in_first_date of the range through included in_last_date
- and it returns 0 if there is no such lines.
-If in_last_date is omitted, the search only the data on in_first_date.
-If in_first_date is omitted, it defaults to yesterday.
-Time parts of the in_first_date and in_last_date are ignored.
-Declaring variables
sql_txt VARCHAR2 (1000);
v_is_true INTEGER.
BEGIN
sql_txt: = 'SELECT COUNT (*).
|| 'FROM ' | in_schema | '.' || in_tablename
|| 'WHERE ' | in_datefield | ' > =: d1'
|| «AND» | in_datefield | '< > >
|| 'AND ROWNUM = 1';
dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE"); -For debugging
Sql_txt EXECUTE IMMEDIATE
IN v_is_true
With the HELP of TRUNC (in_first_date) - d1
TRUNC (NVL (in_last_date
in_first_date
)
) + 1 -- d2
;
RETURN v_is_true;
END is_ydaydata_to_table;
/
DISPLAY ERRORS
If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above. In this way, you can easily see exactly what will be executed. Comment out the call to dbms_output under test is completed.
Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future. For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days. The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).
-
How to count the number of columns in an oracle table using sql
How to count the number of columns in an oracle table using sqlYou must put the name of the table in capital letters
As
SELECT COUNT(1) FROM user_tab_columns WHERE table_name = 'EMP'; or SELECT COUNT(1) FROM user_tab_columns WHERE table_name = UPPER('Emp');
Concerning
Arun -
How to use the Page number in the IF condition
Hello
I have an obligation to change the output based on Page numbers. Can you please help me how to use the Page number in IF condition.
Thank youCan u send me a sample xml and RTF file to my email in my profile identification, so that I can have a look.
-
How to use the variable in the path of the source of an image in flex
Hello
I just want to know that how to use the variable in the path of the source of an image in flexHello
I just want to know that how to use the variable in the path of the source of an image in flex -
Can we use the value of a variable in a warning message
I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?Gul says:
I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?Try
DECLARE err_txt VARCHAR2(200) t; al_id ALERT; al_button Number; BEGIN al_id := FIND_ALERT('My_Error_Alert'); SET_ALERT_PROPERTY(al_id, alert_message_text, 'Hello how are you mr. variable '||:variable_name ); al_button := SHOW_ALERT( al_id ); END;
Hope it works...
Hamid
-
How to count the number of data records?
Hey guys, how to count the number of records, I had on a data object variable?
Im having a result of sql query in a variable like this:
oDB.resolveNode("#command").query.select.value = "SELECT * FROM Customers WHERE CliNombre LIKE ' % ' + input1 +" %' ";
oDB.open ();
oDB.first ();
So I need to count the number of records retrieved by this SQL query at the moment. Help please
Then move the cursor back to the first record after you have your account.
There is a keyword count in SQL that will allow you to get the account of your request. You can run that first - get your account, and then run the actual query to get the Recordset. This would require a separate data connection. Some examples of code.
var xfa.event.newText = inName;
If (inName == "") {}
App.Alert ("you must enter a name--try again!")
}
var nIndex = 0;
While (xfa.sourceSet.nodes.item (nIndex) .name! = "DataConnection2")
{
nIndex ++;
}oDB = xfa.sourceSet.nodes.item (nIndex) .racing var (1); pertaining to the specified data connection node
App.Alert (ODB.saveXML ("Pretty"));var nIndex = 0;
While (xfa.sourceSet.nodes.item (nIndex) .name! = "DataConnection3")
{
nIndex ++;
}
var oDBCount = xfa.sourceSet.nodes.item (nIndex) .racing (1); pertaining to the specified data connection node
Configure sql call DB to get the number of records that match the criteriaoDBCount.nodes.item (1).query.setAttribute ("text", "commandType");
oDBCount.nodes.item (1).query.select.nodes.item (0) .value = "Select count (*) from table1 where AcctNumber = '" + inName + "'";
oDBCount.open)
oDBCount.close)Configure sql call DB to get the specified employee number
oDB.nodes.item (1).query.setAttribute ("text", "commandType");
oDB.nodes.item (1).query.select.nodes.item (0) .value = "Select * from table1 where AcctNumber = '" + inName + "'";
App.Alert (ODB. Nodes.Item (1) .saveXML ("Pretty"));now connect to the DB and get a recording
oDB.open)
oDB.close ();Note the SQL command use the keyword count (take a look at the oDBCount section). This will return a number of return to the cllaer. When I set up the data connection, a node count (*) that appeared there. I dragged to the form and it has created a field called count that the onus at this node. When the query is executed, the number of resulting records returns to this field. You can have hidden it so that your users can not see it and also to change the binding votes to zero, so it is not included in the data file that is submitted when the form is complete.
Paul
-
How to use the recovery CD?
Hello
Ive lost the instructions to tell me how to use the recovery CD. I forgot, I need to press to access the disks when I reboot!
Can anyone help please?
St. ClareHi clear, before using the recovery CD make you that all important data has been saved to the floppy or USB key because the procedure will erase the entire hard drive. The method for booting from a cΘdΘrom may vary according to the model number of your laptop, but it's something like hold the 'B' button for the Toshiba Startup logo. If this fails you can try to change the boot sequence or use the Toshiba from Windows or the BIOS configuration tool (ESC then F1 when prompted from a cold start) make CD-ROM the first device startup in the list.
Richard S.
-
T420s: how to use the numeric keypad #?
Do not really understand how to use the numbers on the numeric keypad.
Please advice where I can find them?
FN - J - does not work
Activate the numeric keypad by pressing Fn + NmLk.
Then you have access using the number keys.
-
How to find the number of data items in a file written with the ArryToFile function?
I wrote a table of number in 2 groups of columns in a file using LabWindows/CVI ArrayToFile... Now, if I want to read the file with the FileToArray function so how do I know the number of items in the file. during the time of writing, I know how many elements array to write. But assume that I want the file to be read at a later time, then how to find the number of items in the file, so that I can read the exact number and present it. Thank you all
Hello
I start with the second question:
bytes_read = ReadLine (file_handle, line_buffer, maximum_bytes);
the second argument is the buffer to store the characters read, so it's an array of characters; It must be large enough to hold maximum_bytes the value NULL, if char [maximum_butes + 1]
So, obviously the number of lines in your text tiles can be determined in a loop:
Open the file
lines = 0;
While (ReadLine () > 0)
{
lines ++;
}
Close the file
Maybe you are looking for
-
WITH THE NEW UPDATE 10/11, 5. I CAN'T DOWN LOAD SONY PLAY MEMORIES
WITH THE NEW SOFTWARE UPDATE, I LOST ALL MY MEMORIES OF GAME FROM SONY PICTURES. WHEN I REINSTALL THE PROGRAM FREEZE CAN YOU HELP ME PLEASE. I LOST ABOUT 23 000 PHOTOES AND 132 VIDEOS
-
Satellite Pro M15-S405 - no sound on XP
Several weeks ago my Satellite Pro M15-S405 lost all sound. No error message appears anywhere and everything looks good (on where should be and resolved volumes okay, etc..) I tried to download the current audio drivers (SoundMAX) on the Toshiba site
-
Always get "an unknown error has occurred." When you try to reset the password.
I got an email from iCloud and forgot his password. I'm 100% sure that safety issues are correct, but always gets "an unknown error has occurred." pop up when I press continue after having answered the questions. What answer I go, good or bad, will g
-
Original title: cannot install a security update for MSO 2010 (KB2289161) 32-Bit Edition and Windows Malicious Software Removal Tool x 64-November 2010. What is the problem? Does not install
-
Hi, I have about 5 GB of stuff on my 8 GB rocket, but for some reason, my computer takes a few minutes now to enter in my MUSIC file. When I click on my computer then removable disk E (the letter given to the hard drive on my computer), and then it t