Get the string variable name in PL/SQL

Hello
Strange question. Is there a way to have access to the object of a decision of the variable IN the name in a procedure?

for example.
procedure (var1    IN VARCHAR2(6),
                var2    IN VARCHAR2(6),
                var3    IN VARCHAR2(6))

IS....
You run this procedure and pass in parameters to:

var1 = > "abcdef"
var2 = > "defghi",.
var3 = > 'ghikjl ';

In the code, I want to access the number in the string of the + variable name: var1+.

In a naïve sense,.
num_of_in_var := substr(var1, 4,1) 
would I hoped to achieve, but

var1 is set to 'abcdef' if so,
num_of_in_var := substr(var1, 4,1) 
would return was '.

Any thoughts?

Thank you

Published by: chris001 on November 20, 2012 13:16

Hi Chris,

You can find the details of the $user_arguments data dictionary view settings.

select argument_name from user_arguments where object_name = 'PROCEDURE_NAME';

Tags: Database

Similar Questions

  • Get the bind variables name string SQL or the cursor

    Hello

    Is there way to get of the bind variables name string SQL or the cursor?

    Example of
    DECLARE
      l_sql VARCHAR2(2000);
      desctab DBMS_SQL.DESC_TAB;
      curid   PLS_INTEGER;
    BEGIN
    
      l_sql := 'SELECT * FROM emp WHERE mgr = :X and deptno = :Y';
    
      curid := dbms_sql.open_cursor;
      dbms_sql.parse(curid, l_sql, dbms_sql.NATIVE);
      ....
    END;
    What I mean with the SQL string:
    I love to get using some functions from above code variable l_sql all the bind variable.
    In this case the function should return array where is for example: X and: Y

    Back to bind the cursor variable names, I mean same but rather string I pass number of cursor.

    Y at - it sucks ready function or some may share a code customized for this purpose?

    Thanks

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0Regards,

    Published by: jarola December 19, 2011 02:44

    I found there are wwv_flow_utilities.get_binds of the function not documented in APEX packages that do what I want.
    Usage example
    set serveroutput on
    DECLARE
      binds DBMS_SQL.varchar2_table;
    BEGIN
      binds := wwv_flow_utilities.get_binds('select :P1_TEST from dual');
      FOR i IN 1 .. binds.count
      LOOP
        dbms_output.put_line(binds(i));
      END LOOP;
    END;
    /
    
    anonymous block completed
    :P1_TEST
    But I would not use these functions without papers as those who can change or there is no future versions APEX.
    Is there a documented function or the custom function that do the same thing as wwv_flow_utilities.get_binds?

    Some old basic example code of my friends. Also the media getting the bind variable of PL/SQL code blocks anon.

    SQL> create or replace function GetBindVariables( statement varchar2 ) return TStrings is
      2          --// bind variables names are terminated by one the following special chars
      3          SPECIAL_CHAR    constant TStrings := TStrings(' ',')','+','-','>','<','*',',','=',';',CHR(10),CHR(13));
      4
      5          --// max size of a bind var name
      6          MAX_VARSIZE     constant integer := 100;
      7
      8          pos     integer;
      9          pos1    integer;
     10          occur   integer;
     11          varName varchar2(100);
     12          varList TStrings;
     13  begin
     14          varList := new TStrings();
     15
     16          --// looking for the 1st occurance of a bind variable
     17          occur := 1;
     18
     19          loop
     20                  pos := InStr( statement, ':', 1, occur );
     21                  exit when pos = 0;
     22
     23                  varName := SubStr( statement, pos, 100 );
     24
     25                  --// find the terminating char trailing the
     26                  --// bind variable name
     27                  pos1 := Length( varName );
     28                  for i in 1..SPECIAL_CHAR.Count
     29                  loop
     30                          pos := InStr( varName, SPECIAL_CHAR(i) ) - 1;
     31                          if (pos > 0) and (pos < pos1) then
     32                                  pos1 := pos;
     33                          end if;
     34                  end loop;
     35
     36                  --// extract the actual bind var name (without
     37                  --// colon char prefix)
     38                  varName := SubStr( varName, 2, pos1-1 );
     39
     40                  --// maintain a unique list of var names
     41                  if not varName member of varList then
     42                          varList.Extend(1);
     43                          varList( varList.Count ) := varName;
     44                  end if;
     45
     46                  --// look for the next occurance
     47                  occur := occur + 1;
     48          end loop;
     49
     50          return( varList );
     51  end;
     52  /
    
    Function created.
    
    SQL>
    SQL> select
      2          column_value as BIND_VAR
      3  from TABLE(
      4          GetBindVariables('select * from foo where col=:BIND1 and day = to_date(:B2,''yyyy/mm/dd'')')
      5  );
    
    BIND_VAR
    ------------------------------
    BIND1
    B2
    
    SQL> 
    

    PS. just realize this code is case-sensitive, while variable bind is not. Should throw a upper() or lower() by adding the name of the var to the list - never really a problem for me because I'm pretty tense when it use cases correctly in the code. ;-)

    Published by: Billy Verreynne, December 19, 2011 06:19

  • Using the string Variable name to ChnFind

    Overview - I find crossing points of zero on a set of data so that I can calculate the phase shift of channel to another in my data.

    Small image - I start by finding the zero 1 cross in the data, once I found I want to use the index to find the next and so on

    Problem

    The posted script comes from looking for the 1st pass by zero before moving on to the next channel. The problem is that I can't find out do my group and channel changes with loops.

    Option Explicit  ' force explicit declaration of all variables in a script.
    Dim intCount, intChan ' loop variables
    Dim z

    IntCount = 2 GroupCount-1 ' groups
    Call GROUPDEFAULTSET (intCount) ' change the current group
    IntChan = 1 to ChnNoMax ' Browse channels
    Z = ChnFind ("Ch(""[intCount]/[intchan]"")<0") 'this="" does="" not="" work,="" but="" i'm="" not="" sure="" how="" to="" fix="">
    MsgBox (z)
    next

    I don't know I'm missing something obvious.

    MK

    Hi Michael,

    You need not global variables to simplify this, but I would certainly use object variables to simplify.  When indexing of groups or channels, it is easier to use the variable of index with the Data.Root.ChannelGroups collect or Group.Channels collection directly.  I also prefer to store the group object and the channel object in a variable.  For example, you can then use Channel.DataType to add exactly the same string data to the new group coming from the old group.  You can also easily get the name, unit and all sorts of other properties directly from the object variable.  I prefer to use a separate group object variable to reduce congestion in the colde, although it adds 2 lines to your example of code snippet.

    Set FromGroup = Data.Root.ChannelGroups (intCount)
    Set FromChannel = FromGroup.Channels (intChan)
    Define participatory = Data.Root.ChannelGroups ("Index" & FromGroup.Name)
    The rise in the value = ToGroup.Channels.Add (FromChannel.Name & "Rising", DataTypeChnFloat64)
    Fall in the value = ToGroup.Channels.Add (FromChannel.Name & "Falling", DataTypeChnFloat64)

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to get the value of a column in sql query?

    Hi, anyone knows how to get the value of a column in sql query?

    Here is my code, the value must be 1350079224397 in my PB, but I get 0

    QString query ("SELECT version FROM db_version");

    QVariant result = sda.execute (query);
    QVariantMap versionMap = result.toList () such () .toMap ();
    If (! versionMap.IsEmpty ())
    {
    qDebug()<"Version: "=""><>
    }

    OK, I have the solution

    QString query ("SELECT version as version FROM db_version");

  • Get the only table name in model executing the revese engineer but columns do not come

    Get the only table name in model executing the revese engineer but columns do not come. I used the standard procedure.  Please let me know why I am not getting column in my model.

    I have attached the screen shot for the same thing.

    This is a table or a synonym? In the case of synonym or try to add the property as it appears below thread.

    Reverse engineering a synonym in ODI 11 G.

    Or maybe go with personal setbacks.

  • Why do I get the error invalid name anchor in muse adobe

    Why do I get the error invalid name anchor in muse adobe

    has responded to your other Candran.

    Why do I get the name of the invalid anchor in muse adobe

  • I want to get the multiple tilesetters name.

    I want to get the multiple tilesetters name.

    The command "activeDocument.activeLayer" returns only a layer name. Even if several layers have been selected.

    I can solve the problem?

    Please try this example...

    #target Photoshop
    app.bringToFront();
    main();
    function main(){
    if(!documents.length) return;
    var selectedLayers = getSelectedLayersIdx();
    var selectedLayersNames =[];
    for(var a in selectedLayers){
        selectedLayersNames.push(getLayerNameByIndex( Number(selectedLayers[a]) ));
        }
    alert("Number of Layers selected = " + selectedLayers.length + "\rLayer Names = " + selectedLayersNames.toString());
    }
    
    function getLayerNameByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Nm  " ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        return executeActionGet(ref).getString(charIDToTypeID( "Nm  " ));;
    };
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i		   
  • get the connection variable in jython

    Hi experts,

    How to get the connection variable in the procedure using jython, or to assign the connection of the source variable in variable jython
    as in java bean shell, I used to use these

    Chantal Connection = snpRef.getJDBCConnection ("SRC");

    the procedure, I would like to create is source: oracle, target: jython.

    Thanks in advance

    Hello

    I believe in jython would make it almost similar

    for example

    Chantal = snpRef.getJDBCConnection ("SRC")

    or

    Chantal = odiRef.getJDBCConnection ("SRC")

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to get the client computer name database?

    Hiya

    As part of the authentication of the user of our application, the requirement is that if a user is connected from a machine, the same connection of can not the user to different machines at the same time.

    In Forms6i, we had accomplished this by using the following query:

    Select the Terminal
    Session $ v
    Where username = v_username
    And v_terminal terminal <>;

    Where
    v_username = USER-> Oracle Forms reserve Word
    v_terminal = Client_Win_API_Environment.Get_Windows_Username

    In Forms 6i, the column Terminal of V$ Session used to return the name of the local client computer.

    However, in the form of 10g, it returns the name of the computer on which Oracle Application Server is installed, which seems correct to me.

    So my question is how do we get the client computer name of the database in the context of Oracle's 10g? Is there another package of database or view/table that returns the client computer name?

    Your suggestions/comments will be much appreciated.

    See you soon

    Mayur

    We have implemented the same exact requirement to retrieve the IP address of the client (WebUtil provides a function for this) and write it in the field v$ session.action (this can be done using the dbms_application_info package DB). We are so in shape 10g v assessment $session.action instead of v$ session.terminal.

  • How to get the global variable for an instanceId

    Hello

    I have data in global variables of an instance level. And using that instanceId, how can I get the global-level variables data.

    Please me tips


    Thank you
    Sailendra

    Hello
    I guess you want to get the value of the external variable within the process. You can do like this:

    assuming that it is of type string. For other types of type cast properly...
    String extVarValue = (String) (New Component(instance: this)).get(attribute: extVarName);

    Replace "extVarName" with your project name. It returns the value of your project for the instance that you are currently working.

    -Thank you,
    Malar.

  • Get the string invalid Base64 of image of toDataURL() for the first time in 10 of blackberry webworks

    Hello

    I need to get the Contact image converted to string Base64 using BB 10 Webworks (blackberry.pim.contacts) I get only the contact.photos [0] .smallFilePath which returns the path to the phonebook file.

    Now, I want to get the image of this path and convert it to a Base64 string.

    Here's the javascript code :

    var img = document.createElement ('Image');
    var canvas = document.createElement ('Canvas');

    function getBase64Image (p) {}
    img.setAttribute ("src", p);

    Img.width = Canvas.Width;

    Canvas.height = img.height;

    CTX var = canvas.getContext ("2d");
    ctx.drawImage (img, 0, 0);
    Return canvas.toDataURL("image/jpg");

    }

    This means bad Base64 string of image for the first time. When I convert this string to the image it displays white screen. But returns a string in the Mithraeum and after conversion, display a correct image.

    I use Blackberry Z10 (OS 10) for the test.

    I think that the canvas is not drawing image properly for the first time.

    I have searched and tried many things, but not got success. What will be the solution.

    Thanks in advance.

    My guess is that the image did not load the source completely still. Setting the src / image loading is an asynchronous event, which means that your code will continue to the next line regardless of whether the image has loaded yet or not.

    After calling setAttribute instead of execute the code of the Web, you will probably need define an event on img for the load event listener. Once the image is loaded, you can then use the img with canvas variable to retrieve its data.

    Note that getBase64 will return immediately, so you may need to develop some sort of mechanism to wait before returning, or the asynchronous approach and integrate reminders for the success trigger the next piece of code.

  • How to get the string contents of itemByRange?

    Hi all

    Here's what I'm trying to achieve:

    I selected a Word and you want to get the content of the 1st word in the string (the name of a person).

    1.png

    In fact, the selected text is the source * a hyperlink and my goal is to get the name of the person designated by him.

    [0] is the same as hyperlink.source.sourceText

    Since I can not get the paragraph or line where the selected word is (or simply do not know how to do this), I'm trying to get the full story: from the 1st character of the selected word and moving backward character by comparing its content. When it hits '\r', I know it's the beginning of the line. This way I can get the part of the line, I'm interested with the itemByRange() method, which returns "Array of Character."

    Main();
    
    function Main() {
        var doc = app.activeDocument;
        var sel = app.selection[0];
    
        GetName(sel);
    }
    
    function GetName(txt) {
        var lastCharacter = txt.characters[0];
        var character = txt.characters[0];
        var story = txt.parentStory;
        var index = lastCharacter.index;
    
        while (character.contents != "\r") {
            character = story.characters[index];
            index--;
        }
    
        // Array of Character itemByRange (from: varies, to: varies)
        // Returns the Characters within the specified range. 
        var arr = story.characters.itemByRange(character, lastCharacter);
    
        var str1 = arr.contents[0];
        var str2 = str1.match(/^\S+/);
    
        return str2;
    }
    

    My problem is that I can't get the content- str1 - by script. However, I can see in the data browser that it is there. If I click on str1, it appears:

    2.png

    If I type str1 in the Console, I also get:

    3.png

    I also tried to use:

    arr.getElements)

    arr.getElements () [0]

    .silence arr.getElements () [0]

    etc.

    but that didn't work either.

    I must be missing something very obvious, but I'm stuck. Can someone help me, please?

    Kind regards

    Kasyan

    Hello

    I did something wrong or

    App.Selection [0]. Lines [0]. Words [0] .silence

    is a 1 Word, you are looking for?

    I hope that...

  • get the strings '? ' instead of strings stored in the db

    Hello

    I migrate an application from Weblogic 8 to 10 and Oracle 9i and 10g

    I question my database by calling a procedure stored that paintings of buildings of type which is defined like this:

    CREATE OR REPLACE
    TYPE 'XXXXX '. "' STRING_ARRAYTYP ' IS THE TABLE OF 40;

    I run a CallableStatement and get the berries via cs.getArray (stored in a java.sql.array).

    In the field of data debug mode, I get a byte []: [-120, 1, -2, 0, 0, 2, 93,-110, 1, 3, 0, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50] 48-48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51,...]

    When I convert it to a string in debug mode, I give myself: "[special characters] 200505252005052520050525200505252005052" who are my data.

    but when I get the result set and I call rs.getString (2), I get a '? ' string (after rs.next () call of course)

    The application worked before we migrate.

    Any idea?

    '?' is the replacement for a character unknown character (in an unknown character) so I suggest you add orai18n.jar in your classpath. Is the jar of Oracle that supports all charset conversions. The JDBC jar does support a few games of characters.

  • Function call for the ActionScript variable name

    I am tempted to call a function dynamically by using a string variable.  I know that to do this normally, I would use code like this:

    var functionName:String = '' + currentItem.id;

    var myData:Array = this [functionName] (parameter1, parameter 2, parameter3);

    However, my function is actually in another directory of flex/package called UploadApps.customUploadFunctions.  I tried this sort of thing:

    var functionName:String = '' + currentItem.id;

    var myData:Array = UploadApps.customUploadFunctions.this [functionName] (parameter1, parameter 2, parameter3);

    but it does not work.  Any ideas on how to call a function with a variable name in another package?

    John

    My suggestion is to stop using the methods at the level of the package. Just do static methods in a utility class as we do in the framework in the mx.utils package. Then you can easily call them UtilityClassName [functionName] (param1, param2, param3). Given that the programming in AS3 is 99.9% on classes, I don't know why AS3 allows even the methods package level.

    Gordon Smith

    Adobe Flex SDK team

Maybe you are looking for

  • iOS 10 in Safari keyboard problem

    Since the update to iOS 10, keyboard on my iPad 2 Air does not work in any web form on Safari, but works very well using Dolphin. I can normally type in the bar URL, but on any page in Safari, where I need to fill out forms the keyboard flashes off a

  • not receiving emails

    Office of Mac OS X 10.7 I am able to send emails but not receive.

  • iPad2 activation after update of the operating system

    I updated my old ipad2 on the 22.3.2016 and I was not able to activate my ipad and itunes does not recognize it. It has been two days now! Please help someone!

  • Problem to connect with MS account

    Hello I try to sign in to Skype with my Microsoft account. I use the same login/password Outlook.com and Skype portal (Yes, I can connect on Skype Portal). When I try to login, I get this error message: Sorry, we does not recognize your connection de

  • Problem with TTL trigger

    Hello everyone, I try to start acquiring the image of a TTL pulse generated in Labview (PIV). I have a TTL signal (I hope it's TTL) generated through devices to the switch to zero of a periodic signal, type sinewave 1.42 Hz [I use PXI 6221 Council wi