Difference between two statement.

I use 11.2.0.3 oracle version, and when I am running below pieces of code and expect similar results.

Below is the variable declare package level as below.

TYPE mycur IS REF CURSOR;

Now mentioned below is my procedure inside the package. My question is, I want to understand the difference between the following two statement in the same procedure. as as statement: 1 give me several records to pk1, where as statement: 2 gives me the good result which is recorded under the outlet of the slider back.

Statement: 1

PROCEDURE p1 (pk1 in NUMBER,
ret_cursor ON mycur)
AS

BEGIN
Open Select ret_cursor *.
A,.
b,
WHERE a.id = b.id
AND (a.c1 = b.c1
GOLD a.c2 = b.c2)
AND a.c3 = pk1;

END;
/

Statement: 2

PROCEDURE p1 (pk1 in NUMBER,
ret_cursor ON mycur)
AS
V_QUERY VARCHAR2 (4000);

BEGIN
V_QUERY: =.
"SELECT."
A,.
b,
WHERE a.id = b.id
AND (a.c1 = b.c1
GOLD a.c2 = b.c2)
AND a.c3 = ' | PK1;

Ret_cursor OPEN for V_QUERY;
END;

actually my mistake, I just the reason behind the question. I had published the name of the table variable / by their and are different than real.
So the question was naming convention given by the developers, the name of the input variable looked exactly like that of the name of the column, it's why he estimated at something like 'and (1 = 1)'.

The input variable name has been 'c3' as column name 'a' causing problem.

a.C3 = c3

Tags: Database

Similar Questions

  • Difference between two data aquistion

    Hello

    I got a data aquistion system that is supposed to keep data acquisition selection until the difference between two points a lot. For example, I get voltage (mv) as 2.31, 2.32, 2.34. 2.33 2.32, 2.33 2.32. the data up to a point, say 0.1V higher or lower than the first. Thewhole procss stop. Thank you for your suggestions.

    Try this... (Labview 8.2)

  • difference between two dates in the year/month/day in Obiee

    Hi gurus,

    I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.

    I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to the below SQL output

    SQL > select end_date, start_date,

    trunc (months_between (end_date, start_date) / 12) years.

    months of mod (trunc (months_between (end_date, start_date)), 12).

    End_date - add_months (start_date, trunc (months_between (end_date, start_date))) days

    t

    Thanks in advance

    SK

    Search for this

    "TIMESTAMPDIFF IN THE FORM OF MTHS # YEARS."

    or else

    To get the current mandate of employees since the date of hiring in the form of # years # mths or # year (s) # month (s)

    Concat (concat (cast (TIMESTAMPDIFF (SQL_TSI_Month, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) / 12 as char),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Month (s)'))

    Concat (concat (CAST (TIMESTAMPDIFF (SQL_TSI_YEAR, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) as CHAR),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Mth (s)'))

  • difference between two timestamps

    Hi gurus,

    I have a procedure which has 2 input parameters of type timestamp. I need to find the difference between these two stamps and be converted to a timestamp and return. Help, please

    Diifernce between two timestamps is interval. You can not convert the difference between two timestamp timestamp and it makes no sense. What you expect:

    25/06/2014 11:25:37.524000 - 13:07:22.987654 20/06/2014

    SY.

  • Exact differences between two images

    I need to be able to tell the difference between two images of a pastel artwork.


    The first image is of the piece, to be hung on a wall or placed on a table.


    The second is a photo of the piece after it has been moved, shaken or vibrated during which time particles were moved.


    I tried superimposing the two images and see the difference between the layers.  The images never seem to perfectly align along the lines of reference drawn in ink on the piece, and I do not understand the presentation of grayscale of the layer mode of difference.  I would like to know if anyone has any photographic photoshopic, or insightful ideas on how to capture this specific detail of change.  Another big challenge is now the images themselves to the exact distance and exposure to the room at the before and after photos, especially if they were taken in two different places on different dates.

    Best I can think of is to load into Photoshop layers >, select the two layers and go Edit > auto alignment of layers.  Then to the blending mode of the layer from the top to the difference.

    You can test so that you know what to expect by opening an image and copy the layer of BG and setting the blending mode of the layer copied the difference.  It will show as a pure black.  Now make tiny changes to the upper layer.

  • Difference between DELETE statements

    Hello

    What is the difference between these statements to delete

    a. DELETE TABLE_NAME WHERE COLUMN_NAME =: B1
    and
    b. DELETE FROM TABLE_NAME WHERE COLUMN_NAME =: B1

    Is there any problem with the performance?

    Thank you
    SK

    Welcome to the forum!

    Whenever you post, provide your Oracle version 4-digit.
    >
    What is the difference between these statements to delete

    a. DELETE TABLE_NAME WHERE COLUMN_NAME =: B1
    and
    b. DELETE FROM TABLE_NAME WHERE COLUMN_NAME =: B1

    Is there any problem with the performance?
    >
    No difference. They are a single statement.

    It is probably more common to use the delete FROM statement, but Oracle itself doesn't care that one you use.

    If you look at the diagram of the syntax in the SQL language Doc, you'll see that the word FROM is optional
    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/statements_8005.htm#i2112830

  • How do the time difference between two dates?

    Hi all

    I use this query to get the time difference between two dates.

    Select to_timestamp ('2012-10-03 12:00 ',' YYYY-MM-DD hh)-to_timestamp ('2012-10-03 11:00 ',' YYYY-MM-DD hh) as double diff;

    but do not get the correct result.

    Thank you

    Left KEY... Left Padding of tanks.

  • Difference between two times

    I am building a working method in LiveCycle, and I want to track how long the procedure takes. To do this, I have two time fields, and then a third time field to find the difference between two time fields. Looking at other posts to discussion, I could find a Javascript code that was part of what I wanted, but I can't get the third time field to display in the format I want. I tried to change the habits of the fields and that did not work. Could someone offer some advice on how to change the format or help me with the code?  I couldn't figure to attach the actual file, but I have attached a picture of the PDF file and the Javascript code I used.  If you look at the TimeIn (hh: mm) and time (hh: mm) areas (on the photo, I have attached), you will notice that the TotalTime comes out like HMM, and I want that it out as hh: mm.

    Adobe Time Difference Example.jpg

    Javascript Time Difference Code.jpg

    Any help would be greatly appreciated!

    Thank you

    this.rawValue = (totalHrs > 9? String (totalHrs): '0' + String (totalHrs)) + ':' + (totalMins > 9? String (totalMins): '0' + String (totalMins));

  • How to find the difference between two dates in the presentation layer

    Hi gurus,

    Hello to everyone. Today, I came with the new requirement.


    I need to know the difference between a date and the current date in the formula column application presentation layer.by.



    Thank you and best regards,
    Prates

    Hi Navin,

    TIMESTAMPDIFF function first determines the timestamp component that corresponds to the specified interval setting. For example, SQL_TSI_DAY corresponds to the day component and SQL_TSI_MONTH corresponds to the component "month".

    If you want to display the difference between two dates in days using SQL_TSI_DAY, unlike butterflies SQL_TSI_MONTH and so on...

    hope you understand...

    Award points and to close the debate, if your question is answered.

    See you soon,.
    Aravind

  • Find the difference between two date and time

    Hi friends,

    I wanted to find the difference between two date and time, but my qury is slightest error "invalid number."

    select sql_step_num,proc_name,run_seqno,start_date,end_date,(to_char(start_date,'HH24-MI-SS') - to_char(end_date,'HH24-MI-SS') ) as ed  
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate) 
    order by sql_step_num;

    You try to get the feel between two char strings.
    And more difference between two dates gives a NUMBER of days.
    Try this:

    select sql_step_num,proc_name,run_seqno,start_date,end_date,numtodsinterval(end_date-start_date,'DAY') as ed
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate)
    order by sql_step_num;
    
  • Difference between two rows in a table.

    Hi all

    I have a requirement where I need to calculate the difference of a column, but the values are in two rows.

    Its exactly like that, I'll have a table where I have stored incidents with their status and their modification dates

    example:
    Incident_Id: Status: Modified_Date (in seconds from a specific date)
    1: 1: 9080890
    1: 2: 9080999
    1: 3: 9081900
    2: 1: 10000900
    2: 2: 10001000
    2: 3: 10002000

    Now there I show the time spent by each incident in each State.

    That is to say for the State 1 I need the difference between the date of change of condition 2 and updated the date of status 1 Similarly

    2 necessary status the difference between the date of change of condition 3 and updated the status date 2 and so on.

    the real result, I need is like that

    Incident_Id: Status: Timespent
    1: 1: (modified_date (status2) - modified_date (status1))


    Please help me to write the query to do this.

    Kind regards
    Tauceef

    Can we assume that the lines are classified according TO the event status ?
    This (i.e. an Ordering) is necessary in order to systematically identify consecutive lines.

    Please try the analytical function LAG and less to the current value.

  • Formula of FormCalc to make the difference between two time fields if they are populated - help please


    Hello

    I have a laptop (TotalTime1) which refers to two other cells in the updated hour-shaped (Start1 and 1 to finish).

    The formula below is intended to make the difference between the time of departure and of arrival if they are populated.

    I had to work unconditionally HasValue, but the formula was calculated when there is no value in the Start1 and Finish1 (due to the time format).

    This is the code I have, it is said that there is an error of almost the last line; I'm sorry if I'm posting this in the wrong way, I haven't posted on this forum before but this is:

    If (HasValue (Finish1) and HasValue (Start1)) then if (Time2Num (Start1.formattedValue, "HH: mm") < Time2Num (Finish1.formattedValue, "Hh: mm")) then Abs (Time2Num (Start1.formattedValue, "HH: mm")-Time2Num (Finish1.formattedValue, "HH: mm")) / (60 * 60 * 1000) another 24 - ABS (Time2Num (Finish1.formattedValue, "HH: mm")-Time2Num (Start1.formattedValue, "HH: mm")) / (60 * 60 * 1000) endif

    Any help would be appreciated.

    Cordially Fetachini

    you need an another endif at the end (you have nested statement and only 1 endif)

  • Find the difference between two numbers (DBL)

    Hi all

    Is there a function in labview other than the subtraction function that can find the difference between the two numbers given?

    Thank you

    Davidson


  • Difference between two numbers of laptop models

    Can someone tell me if there is a difference between these models of computers two laptops? As far as I can tell they are the same.
    M7-j120dx and M7-J010D. Thank you.

    Hello

    To the second machine:

    http://support.HP.com/us-en/document/c03770540

    You can check yourself, BUT I found at least 2 things that tell me that the first one is the best: it has screen FULL HD and better card WiFi (b/g/n a/c).

    Kind regards.

  • Difference between two dates

    Hello

    I have two columns both of them date data types.

    I would like to know the difference between these two dates.

    SELECTION INTERVAL ' + 2342 23:23:23 ' DAY (4) TO THE SECOND - INTERVAL ' + 102 13:13:13 ' DAY (4) SECOND FROM DUAL;

    But, I get this:

    '+ 2240 10:10:10.000000'

    I'd like to see the result in a year-month and jour-deuxieme groups. I can't do anything with + 2240 days...

    Thanks in advance!

    Hello Adme12

    You can use it.

    SET LINESIZE 110 PAGESIZE 20

    COLUMN today FORMAT A20

    COLUMN TOMORROW FORMAT A20

    COLUMN YEAR_MONTHS FORMAT A15

    COLUMN DAY_SEC FORMAT A30

    SET ECHO ON

    SELECT TO_CHAR (today, ' JJ.) MR. HH24:MI:SS' YYYY) LIKE TODAY

    , TO_CHAR (tomorrow, ' JJ.) MR. HH24:MI:SS' YYYY) TOMORROW

    NUMTOYMINTERVAL (MONTHS_BETWEEN (TOMORROW, TODAY), 'MONTHS') AS YEAR_MONTHS

    , NUMTODSINTERVAL (TOMORROW - ADD_MONTHS (TODAY, TRUNC (MONTHS_BETWEEN (TOMORROW, TODAY))), 'DAY') AS DAY_SEC

    Of

    (SELECT SYSDATE + INTERVAL ' + 102 13:13:13 ' DAY (4) ON THE SECOND THAT TODAY ' HUI)

    , SYSDATE + INTERVAL ' + 2342 23:23:23 ' DAY (4) ON THE SECOND TOMORROW

    OF THE DOUBLE

    )

    ;

    TODAY TOMORROW YEAR_MONTHS DAY_SEC

    -------------------- -------------------- --------------- ------------------------------

    23.04.2014 04:49 10.06.2020 14:59:10 + 000000006-02 + 000000018 10:10:10.000000000

    Of course, it is not so good that you have so many 0, but you can convert the result to a char (TO_CHAR) and you can enter.

    I hope this helps you!

    Kind regards

    David

Maybe you are looking for

  • Share photos added to the photo library via the menu are not visible on the Photos

    Hello I started using DxO OpticsPro 10 to process Raw files. When I used the share menu in this application to "Add photo" pictures are exported but not visible in the Photos app. I see that they are in the photo library (Show Package Contents > Mast

  • LM35 component file

    Hello members of the jury. First of all, I am very new to multisim and this Council. I tried to search the kittmaster database and this forum with some luck. What I'm looking for is a component file of LM35 can I use in multisim. (if there is, a diod

  • HP deskjet 1515 print margin setting?

    I have recently bought all-in-one printer, HP Deskjet 1515 and cannot adjust the margins of the print area. When I print an A4 document, an area at the bottom does not print. When I print a 6 "x 4" or photo 10 x 15 cm, the entire surface of the paper

  • Installation of fonts by program

    HelloIn BlackBerry OS, it was possible to install fonts programmatically, by using the net.rim.device.api.ui.FontManager class.Is it possible to do the same thing for Tablet OS Install and use a police custom in Java of BlackBerry applicationhttp://d

  • height of the composition

    I have a blank publication that is much more profound it must do and shoot the other content below. Is it possible to adjust the height? Even when I adjust the height of the elements within the composition, I can't fix the outside border of the compo