Oracle 9i - passing a string as parameter when integer is required yet

Dear all;
I am trying to fix this problem with a limited amount effort and also prevent redesigning it as well. I know it is completely wrong but it was done by a past developer and I am just trying to make a simple twick to it. I will try to explain my current problem so please bear with me
I have a table with a field called SN which is number type field, I have a select statement similar to this below
select stype from tbl_one where sn = 1ok, the select statement works for numbers and numbers with dash(e.g 03-2). In the case of numbers with dash, it returns null which is okay now, I am having a bit of problems where sometimes the user entry is a an actual string like this (cat). Now the select statement isnt going to work for this case because I am going to get a Ora-00904 - invalid identifier error.
The solution I had in mind is first use a regular expression to determine whether the parameter is a string or a numeric value and if it is a numer value pass it as a parameter to the select statment if not, then just return null in the select statement. However, since I am using oracle 9i I cant use regualr expression is there any suitable sql statment i can use in replacement of a regular expression or any other ideas.
All help is appreciated. Thank you.

Hi,
user13328581 wrote:
... the select statement works for numbers and numbers with dash(e.g 03-2). That's actually not a number with a dash. That's a subtraction operation involving two numbers, 03 (which is the same as 3) and 2. 3 - 2 = 1, so it's the same as typing 1.
The solution I had in mind is first use a regular expression to determine whether the parameter is a string or a numeric value and if it is a numer value pass it as a parameter to the select statment if not, then just return null in the select statement. However, since I am using oracle 9i I cant use regualr expression is there any suitable sql statment i can use in replacement of a regular expression or any other ideas.If you just want to see if the string s contains anything other than a digit, use
LTRIM ( s
      , '0123456789'
      )  IS NOT NULLThe condition above will be TRUE when s contains anything other than a digit.
If you want to check for signs, decimal points, and scientific notation, then see this thread:
How to identify if a Varchar2 string has a-z characters?
for a user-defined function.
Edited by: Frank Kulash on Apr 21, 2011 11:28 AM

Similar Messages

  • ## A Simple VB Client which passes a String as parameter ##

    Hello Everybody,
    I am looking for a simple VB client that should be able to pass a String
    (not FML) to a tuxedo service. I have already seen the FML example. Help
    would be highly appreciated.
    Thank you
    Nadeem
    @8563

    Hello,
    Please refer to my posting "Re: VB6 client and Tuxedo".
    The sample can be easily modified for STRING instead of FML.
    HTH
    regards
    MS

  • I can't pass empty string as column of Table Valued Parameter.

    Hello.
    I have stored procedure which accept TVP with columns of 'sql_variant' type. And I have C++ application which call this stored procedure.
    When i pass some non-empty string as sql_variant from my application - all works fine.
    But when I need to pass empty string ("") as sql_variant - I get following error:
    "OLEDB hr = 0x80040e14
     #0:  OLEDB provider error 3621  "The statement has been terminated."
     #1:  OLEDB provider error 8062  "The data for the table-valued parameter 1 doesn't conform to the table type of the parameter."
     #2:  OLEDB provider error 8046  "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Table-valued parameter 0 (""), row 1, column 1: The supplied length is not valid for data type sql_variant.
    Check the source data for invalid lengths. An example of an invalid length is data of nchar type with an odd length in bytes."  
    Could you please help me deal with that issue?
    Thanks,
    Vitaliy

    Dear Vitaliy,
    Thank you for your question.
    Based on my understanding of your question, the issue is related with passing SQL_VARIANT data type in C++ application using Microsoft OLE DB Provider.
    As we can see from http://msdn.microsoft.com/en-us/library/ms173829(v=sql.100).aspx:
    ODBC does not fully support sql_variant. Therefore, queries of sql_variant columns are returned as binary data when you use Microsoft OLE DB Provider for ODBC (MSDASQL). For example, a sql_variant column that contains the character string data 'PS2091'
    is returned as 0x505332303931.
    According to above statement, as you are using OLEDB provider for ODBC with sql_variant in your application, it is not fully support. Seems there are some conversion failure within the Stored Procedure calling. You may consider to adjust your application
    slightly to use other commonly supported data types which also fits your application requirements.
    I listed some more information regarding sql_variant below for your reference:
    A column of type sql_variant may contain rows of different data types such as int, binary and char values.
    A sql_variant data type must first be cast to its base data type value
    before participating in operations such as addition and subtraction. You can find the conversion details in "Comparings sql_variant Values" part.
    Below types of values cannot be stored by using sql_variant:
    varchar(max)
    varbinary(max)
    nvarchar(max)
    xml
    text
    ntext
    image
    timestamp
    sql_variant
    geography
    hierarchyid
    geometry
    User-defined types
    Hope it will be helpful.
    Thank you!
    Best Regards,
    SQL Team - MSFT

  • Pass Hidden Field (Rep ID) as Parameter when user logs into site

    I have set-up user validation to my site based on a userID and password, but I want to also pass a hidden field/parameter (RepID) to the rest of the site pages so that I can filter my record sets on those pages based on that RepID parameter.
    I have coded everything the way I thought it should be, but I'm getting the following error when I test it and from what I can see it is defined...
    Element PSWD is undefined in FORM.
    Here is the form coding, as well as the CF coding for the user validation...
    <form id="login" name="login" method="POST" action="<cfoutput>#MM_loginAction#</cfoutput>">
                    <table border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td height="35" class="text_bold">Email</td>
                        <td height="35"><label for="email"></label>
                          <input type="text" name="email" id="email" /></td>
                      </tr>
                      <tr>
                        <td height="35" class="text_bold">Password</td>
                        <td height="35"><label for="pswd"></label>
                          <input name="pswd" type="password" id="pswd"  value="<cfoutput>#rsWeblogin#</cfoutput>" /></td>
                      </tr>
                      <tr>
                        <td height="35" class="text_bold"><input  name="salesman_id" type="hidden" id="salesman_id"  value="<cfoutput>#rsWeblogin.SALESMAN_ID#</cfoutput>"  /></td>
                        <td height="35"><input type="submit" name="submit" id="submit" value="Submit" /></td>
                      </tr>
                    </table>
                  </form>
    <cfparam name="FORM.email" default="1">
    <cfquery name="rsWeblogin" datasource="INSORB">
    SELECT *
    FROM dbo.WEBLOGIN
    WHERE E_MAIL = <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64">
    </cfquery>
    <cfif IsDefined("FORM.email")>
        <cfset MM_redirectLoginSuccess="index.cfm">
        <cfset MM_redirectLoginFailed="login.cfm">
        <cfquery  name="MM_rsUser" datasource="INSORB">
        SELECT E_MAIL,PSWD FROM dbo.WEBLOGIN WHERE E_MAIL=<cfqueryparam  value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64"> AND  PSWD=<cfqueryparam value="#FORM.pswd#" cfsqltype="cf_sql_clob"  maxlength="15">
        </cfquery>
        <cfif MM_rsUser.RecordCount NEQ 0>
          <cftry>
            <cflock scope="Session" timeout="30" type="Exclusive">
              <cfset Session.MM_Username=FORM.email>
              <cfset Session.MM_UserAuthorization="">
            </cflock>
            <cfif IsDefined("URL.accessdenied") AND true>
              <cfset MM_redirectLoginSuccess=URL.accessdenied>
            </cfif>
            <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
            <cfcatch type="Lock">
              <!--- code for handling timeout of cflock --->
            </cfcatch>
          </cftry>
        </cfif>
        <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
        <cfelse>
        <cfset MM_LoginAction=CGI.SCRIPT_NAME>
        <cfif CGI.QUERY_STRING NEQ "">
          <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
        </cfif>
    </cfif>
    Any help would be greatly appreciated!

    I don't have anything definitive to offer other than a couple of questions based on what I see on your login form:
    1. What is rsWeblogin that you are using to initialize the password field PSWD on the form? I would have expected the password field to be left empty in generating the form...
    2. The use of "#rsWeblogin#" to initialize the PSWD field, coupled with the use of "#rsWeblogin.salesman_ID#" to initialize the hidden field strike me as odd; that second one would lead me to believe rsWeblogin is a structure of some sort, and I'm not sure what you would be getting crunched into the password field as a result...
    Maybe one of those might give you some sort of clue?
    In addition, if the password field is left empty on the form itself, you may well not be getting a FORM.pswd variable coming through the submittal. You may need to either check that it is defined (probably best) or cfparam it to a known value that would never be used for a "real" password (problematic for all sorts of reasons) before using it in the authentication logic.
    /ron

  • Pass Hidden Field (Rep ID) as Parameter when user logs into site (CFusion)

    I have set-up user validation to my site based on a userID and password, but I want to also pass a hidden field/parameter (RepID) to the rest of the site pages so that I can filter my record sets on those pages based on that RepID parameter.
    I have coded everything the way I thought it should be, but I'm getting the following error when I test it and from what I can see it is defined...
    Element PSWD is undefined in FORM.
    Here is the form coding, as well as the CF coding for the user validation...
    <form id="login" name="login" method="POST" action="<cfoutput>#MM_loginAction#</cfoutput>">
                   <table border="0" cellspacing="0" cellpadding="5">
                     <tr>
                       <td height="35" class="text_bold">Email</td>
                       <td height="35"><label for="email"></label>
                         <input type="text" name="email" id="email" /></td>
                     </tr>
                     <tr>
                       <td height="35" class="text_bold">Password</td>
                       <td height="35"><label for="pswd"></label>
                         <input name="pswd" type="password" id="pswd"  value="<cfoutput>#rsWeblogin#</cfoutput>" /></td>
                     </tr>
                     <tr>
                       <td height="35" class="text_bold"><input  name="salesman_id" type="hidden" id="salesman_id"  value="<cfoutput>#rsWeblogin.SALESMAN_ID#</cfoutput>"  /></td>
                       <td height="35"><input type="submit" name="submit" id="submit" value="Submit" /></td>
                     </tr>
                   </table>
                 </form>
    <cfparam name="FORM.email" default="1">
    <cfquery name="rsWeblogin" datasource="INSORB">
    SELECT *
    FROM dbo.WEBLOGIN
    WHERE E_MAIL = <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64">
    </cfquery>
    <cfif IsDefined("FORM.email")>
       <cfset MM_redirectLoginSuccess="index.cfm">
       <cfset MM_redirectLoginFailed="login.cfm">
       <cfquery  name="MM_rsUser" datasource="INSORB">
       SELECT E_MAIL,PSWD FROM dbo.WEBLOGIN WHERE E_MAIL=<cfqueryparam  value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64"> AND  PSWD=<cfqueryparam value="#FORM.pswd#" cfsqltype="cf_sql_clob"  maxlength="15">
       </cfquery>
       <cfif MM_rsUser.RecordCount NEQ 0>
         <cftry>
           <cflock scope="Session" timeout="30" type="Exclusive">
             <cfset Session.MM_Username=FORM.email>
             <cfset Session.MM_UserAuthorization="">
           </cflock>
           <cfif IsDefined("URL.accessdenied") AND true>
             <cfset MM_redirectLoginSuccess=URL.accessdenied>
           </cfif>
           <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
           <cfcatch type="Lock">
             <!--- code for handling timeout of cflock --->
           </cfcatch>
         </cftry>
       </cfif>
       <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
       <cfelse>
       <cfset MM_LoginAction=CGI.SCRIPT_NAME>
       <cfif CGI.QUERY_STRING NEQ "">
         <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
       </cfif>
    </cfif>
    Any help would be greatly appreciated!

    The userID and the repID are both unique to the user, but are used for different identification purposes. Both fields are in the same user login table...
    I was able to solve the problem by adding <cfset Session.RepID=MM_rsUser.SALESMAN_ID> and adding the SALESMAN_ID field to the <cfquery>
    Now it works great!
    Thank you for your response!

  • Pass table name as parameter in prepared Statement

    Can I pass table name as parameter in prepared Statement
    for example
    select * from ? where name =?
    when i use setString method for passing parameters this method append single colon before and after of this parameter but table name should be send with out colon as SQL Spec.
    I have another way to make sql query in programing but i have a case where i have limitation of that thing so please tell me is it possible with prepared Statment SetXXx methods or not ?
    Thanks
    Haroon Idrees.

    haroonob wrote:
    I know ? is use for data only my question is this way to pass table name as parameterI assume you mean "how can I do it?" As I have already answered "is this the way?" with no.
    Well, I would say (ugly as it is) String concatenation, or stored procedures.

  • How to Pass a multi-select parameter in BI to a PL/SQL Program

    I am trying to pass a BI report parameter which is multi-select enabled in BI Enterprise Stand-Alone reporting tool. eg. it comes out in the data model like this: <P_CLASS_CODE>[DISABLED_VETERAN_OWNED, HUB_ZONE, LARGE_BUSINESS]</P_CLASS_CODE>
    to a pl/sql stored procedure. (this is some kind of record set)
    This works when passing the parameter as bind variable being passed to and IN CLAUSE. However, In my case I need a little bit more flexibilty with the programming so I need to get the value into PL/SQL so I can work with the individual values in the record set.
    I am trying to figure out which collection type or record type I can use in pl/sql to be able to parse out the elements in the collection from within a stored procedure so I can loop through the elements.
    I am trying to call the BI before report trigger in the data template like this:
    <dataTrigger name="beforeReportTrigger" source="XXAPRPT03_SUPPLIER_DIVERSITY.before_report_trigger(:p_class_code)"/>
    this call refers to the default package
    I get this error: 'Invalid column type'
    what type should I be using in my procedure definition to support the multi-selection record set which my parameter is passing from BI.

    Hi,
    Okie :) please feel free to post any problem :)
    Please apply the patch that has the fix for this issue:
    [Patch 9791839|https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=9791839]
    The above link worked fine for me .
    Ideally, you should pick up the latest patch, which is [ Patch 11846804|https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=11846804]
    Click on View Read me for install instructions. Let me know if you find any problem with patch install.
    Regards,
    Ajay Kumar

  • CR XI - Pass a Multi-value Parameter to a Stored Procedure

    Hello,
    Here is my problem !
    My Main Report accept a Multi-value Parameter "myParameter".
    I create a formula "lstParameter" (Join({?myParameter},',')  linked to my SubReport (string static parameter based on a Stored Procedure  which returns a RefCursor (ORACLE)).
    When I launch the Main Report, he is blank...but if I open the subreport in the overview i can see the result...
    it seems like the MainReport don't call the SubReport, or something like that...
    I hope you can help me !
    Thanks
    Anthony
    Edited by: anthony.44 on Jan 12, 2012 4:53 PM
    Edited by: anthony.44 on Jan 13, 2012 9:51 AM

    hello,
    I resolve my problem....just inside into the detail of the Master report a result of a query (ex: select sysdate from dual)...and the sub report is called correctly

  • Passing (byref) String from Java to C++ via JNI

    I wish to pass a string to a C++ Dll as a parameter in a function. The problem is that I don't know howto receive back the data after it is filled in the C++ dll. I am trying to do what is called passing parameters by reference.
    Java Code:
    public class ABKeyBoard {
    public native long leerBanda(int pista, String datos);
    public static void main(String[] args) {
    String datos=new String();
    System.loadLibrary("ABKeyBoard");
    new ABKeyBoard().leerBanda(1,datos);
    System.out.println(datos); //the content of datos here is empty.
    C++ Code:
    Java_ABKeyBoard_leerBanda(JNIEnv *env, jobject obj,jint pista, jstring datos)
         char buffer[2024];
         memset(buffer,     0x00,     sizeof(buffer));
         strcpy(buffer, "xxxx");
         datos = env->NewStringUTF(buffer);
    return;
    Thanks for your help.

    In java every parameter are always passed by value.
    The datos parameter is a local copy of the string
    reference you pass to the method.This is wrong. The String passed to the native method is the same String object you use in Java. Although everything is passed by value in Java, what is actually passed by value is the reference to the String. This means that you can modify the object you pass, but you are not allowed to change the reference to point to a totally different object. That is where the problem is coming in.
    The trouble is that it is illegal to modify a String, even from native code. If you need to make changes in-place to the text, pass an array of chars (if your native code uses Unicode), an array of bytes (if it uses normal 8-bit characters) or a StringBuffer. You can legally modify any of these data structures with the new data. But the StringBuffer object is the only one whose length can be changed after it is created. Unfortunately it is also the hardest to use from JNI.
    Generally I think you should always pass arrays of bytes/chars to native code instead of Strings when possible. They can be modified in place, and you can use String's methods to get a byte-array in the platform's proper encoding. Using the GetStringUTFChars method is problematic because UTF only maps directly onto ASCII in the case of characters which are in the set of 7-bit ASCII characters. Your code will do wrong things if your String happens to contain some other character, unless your native code expects UTF format strings.
    The good news is that C(++) functions which return results in their arguments do not ordinarily change the length. So you should be able to allocate a byte[] or char[] ahead of time of the appropriate size (don't forget to add the trailing null, which is not a component of Java strings). I think byte[] or char[] is the best answer because you can easily map those onto C-style arrays with Get[Primitive]ArrayRegion; the return of that is suitable for passing directly to native code, as long as you have remembered the null-terminator. For instance you could do (*env)->GetByteArrayRegion(env, javaArray, 0, arrayLength, CArray) and then your CArray would be changed to point at the contents of the javaArray (note: it does not copy data into CArray, it changes CArray to point at the array contents, so do not allocate memory for CArray first). Then when you do ReleaseByteArrayRegion the results will be propagated back to Java.

  • Hoe to pass object as a parameter thru webSerive

    I need to pass Object as a parameter to web service:
    example:
    public calss returnCodes{
    int ret_code;
    String ret_string;
    public retrunCodes(int ret_code, String ret_string){
    this.ret_code = ret_code;
    this.ret_string = ret_string;
    public int getret_code()
    return this.ret_code;
    public String getret_string {
    return this,ret_string
    and other repc holder class to hold returnCodes
    public class retrunCodesHolder implents javax.xml.rpc.Holder
    returnCode value;
    pubic returnCodesHolder(){
    public returnCodesHolder(returnCodes value) {
    this.value = value;
    In Webservice I use returnCodesHolder as parameter.
    WebService getReturnCodesWs I have
    returnCodes retCodes = new returnCodes(04,"Good return code)
    returnCodesHolder retholder = new returnCodesHolder(retCodes)
    return myString;
    When I am calling above webService in servlet I have code:
    org.test.mytest.returnCodesHolder retHolder = new org.test.mytest.returnCodesHolder();
    String result = port.getReturnCodesWs(retHolder);
    How to I access /get values of returnCodes class in my calling servlet?
    I am using Tomcat v 6.0

    I believe (although have never used, so if I'm wrong,
    correct me please!) you can do it with implicit
    dynamic cursors, such as:
    For rec in 'select col1, col2 from table 1 '||lstr
    loop
    Not really:
    michaels>  declare
       lstr   varchar2 (30) := ' where empno = 7788';
    begin
       for rec in 'select * from emp e ' || lstr
       loop
          null;
       end loop;
    end;
    Error at line 1
    ORA-06550: line 5, column 4:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
       . ( * @ % & - + / at mod remainder rem .. <an exponent (**)>
       ||

  • How to pass a table as parameter on a stored procedure

    Hello all,
    I want to pass the name of a table as parameter into a stored procedure, that will be used for cursors etc.
    But when i pass the parameter and i compile the S.P. it give me error (error: table not existing...)
    Any Help?
    Thanks in advance, Marco

    Marco wrote:
    As i've written above, i'm using stored procedures like 'batch' programs which will be executed with oracle scheduler (passing to s.p. the name of the 'input' tables)
    These input tables are 'external' tables which have got the same structure; for example i've got TABLEX_001, TABLEX_002, XXTAB etc. with the same structure.
    This is the the reason... what do you think?An external table definition can reference multiple files via the LOCATION definition or you can user "ALTER TABLE" to alter the location and change the file that the external table points to.
    Thus you only need one static External Table and use an alter table (via execute immediate) to change the file location it points to, or if you want all the data together, just specify all the files in the location.
    That would be clean design, using one fixed table, without the need to pass any table names, just dynamically altering the file names if necessary at run time.

  • How do I pass the exact datetime parameter in a procedure.

    How do I pass the exact datetime parameter in a procedure.
    Hi All,
    I have a datetime problem which is driving me crazy.
    I need pass a datetime field as a parameter in an oracle procedure exactly as below with timestamp.
    Example: '6/01/2005 5:25:24 AM'
    SQL > exec myprod(‘value1’,’value2’,’value3’, to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss'));
    I get an error “INVALID MONTH”
    Next Changed to_date to to_char
    SQL > exec myprod(‘value1’,’value2’,’value3’, to_char('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss'));
    I get a different error, “INVALID NUMBER”
    Next pass the datetime as it is.
    SQL > exec myprod(‘value1’,’value2’,’value3’, '6/01/2005 5:25:24 AM');
    I get an error “INVALID MONTH”
    Here is the my procedure.
    CREATE OR REPLACE PROCEDURE myprod (
    p_value1 varchar2,
    p_value2 varchar2,
    p_value3 varchar2 ,
    p_value4 date )
    IS
    filehandler UTL_FILE.FILE_TYPE;
    va_currentdate DATE;
    BEGIN
    SELECT sysdate
         INTO va_currentdate
    FROM dual;
    END;
    Do you know any solutions for this problem.
    Thanks

    What is your NLS_DATE_FORMAT value?
    There seem to be some implicit data conversions in your arguments.
    SQL> select parameter,value from nls_session_parameters where parameter like '%DATE%';
    PARAMETER                                                    VALUE
    NLS_DATE_FORMAT                                              YYYY-MM-DD HH24:MI:SS
    NLS_DATE_LANGUAGE                                            AMERICAN
    SQL> select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss') from dual;
    select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss') from dual
    ERROR at line 1:
    ORA-01830: date format picture ends before converting entire input string
    SQL> select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh:mi:ss am') from dual;
    TO_DATE('6/01/20055
    2005-01-06 05:25:24

  • Is it possible to pass a string from an applet to the web site?

    Hi, everybody!
    Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
    Please, help!
    Thank you so much!

    Why do you want to do this in Java?
    Javascript is the correct language for these type of situations.
    for instance:
    in the head of your html document:
    <script language=javascript type="text/javascript">
    createWindow(form){
    if(form.text.value!=""){
    newDoc = new document
    newDoc.write(form.text.value)
    newWin = window.open(document,'newWin','width=200;height=150')
    </script>
    in the body:
    <form onSubmit="createWindow(this)">
    <p>
    Enter a String:<input type=text size=30 name="text">
    </p><p>
    <input type=submit value="submit"> 
    <input type=reset value="reset">
    </p>
    </form>

  • How to pass a string value from XL sheet cell to SQL query.

    Hi,
    I am using SQL query in XL sheet to fetch some data. for that i am using ODBC connection. Now I want to pass a string from XL sheet Cell value in the where clause of Select statement, Please let me know how to do this.
    Below is My code:
    nge("A4").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
    "ODBC;DRIVER={Microsoft ODBC for Oracle};UID=xyz;PWD=xyz;SERVER=xyz;" _
    , Destination:=Range("A4"))
    .CommandText = Array( _
    "SELECT CRYSTAL_REPORT1.PROJECT, CRYSTAL_REPORT1.OBJECT" & Chr(13) & "" & Chr(10) & "FROM NAIODEV.CRYSTAL_REPORT1 CRYSTAL_REPORT1" _
    .Name = "Query from gg"
    Thanks,
    Priya

    What does "XL" (whatever that is) have to do with Crystal Reports which is what you are obviously working with have to do with the Oracle database?
    The rules for using Crystal with Oracle are quite clearly described in all the Crystal Reports docs ... you MUST use IN OUT ref cursors unless you are doing direct table or view access.

  • How to pass more than one parameter using common...

    Hi,
    I am using ODP.NET with my 2005 VB
    I want to create function from where I can pass more than one parameter to execute SP, or query just like i created for SQL SERVER as below
    Public shared Function CreateParameter(ByVal paramname As String, ByVal paramvalue As Object) As DbParameter
    Dim param As DbParameter
    param = New SqlParameter
    param.ParameterName = paramname
    param.Value = paramvalue
    Return param
    End Function
    Public Shared Function ExecuteQuery(ByVal sql As String, ByVal commtype As CommandType, ByVal ParamArray parameter As DbParameter())
    Dim cmd As DbCommand = New SqlCommand()
    cmd.Connection = OpenConnection()
    cmd.CommandType = commtype
    cmd.CommandText = sql
    cmd.Parameters.AddRange(parameter)
    Dim RetVal As Integer = cmd.ExecuteNonQuery()
    Return RetVal
    End Function
    specially part is in bold to be converted
    I tried like but oracleCommand.parameters doesnt support AddRange
    please help me out
    Regards

    Hello,
    I used the following way:
    pCommand.CommandText = "Update " + sDataTable + " set "
    + sColumnName + " = :1 ";
    pCommand.Parameters.Add("ValueToDb",
    this.DefaultDbType,
    this.m_Value,
    System.Data.ParameterDirection.Input);
    Of course, you can add :2,... to your command text, too.
    The way back is:
    sEndOfTheClause += " RETURNING " + sDataTable + "." + sColName + " INTO :iNewValue";
    pCommand.CommandText = ... + sEndOfTheClause;
    pCommand.Parameters.Add("iNewValue", this.DefaultDbType,
    ParameterDirection.Output);
    bool bReturn = (pCommand.ExecuteNonQuery() != 0);
    if ((bReturn == true) && (pCommand.Parameters.Count > 0))
    this.Value = DataService.Convert<DATA_TYPE>(pCommand.Parameters[0].Value);
    ....

Maybe you are looking for