Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 696959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:07:07+00:00 2026-05-14T03:07:07+00:00

If the database is not Oracle, it is MS SQl 2008. My task: if

  • 0

If the database is not Oracle, it is MS SQl 2008.
My task: if Oracle, add two more parameters when calling a stored proc.

Oracle and MSFT stored procs are generated; Oracle ones have 3 extra parameters:

Vret_val out number,
Vparam2 in out number,
Vparam3 in out number,
... the rest

(The are not actually named Vparam2 and Vparam3, but this should not matter).
So, the code for a helper VB.Net class that calls a stored proc:

Imports System.Data.Odbc
Imports System.Configuration

Dim objCon As OdbcConnection = Nothing
Dim objAdapter As OdbcDataAdapter
Dim cmdCommand As New OdbcCommand
Dim objDataTable As DataTable

Dim sconnection As String

Try
    sconnection = mConnectionString
    objAdapter = New OdbcDataAdapter
    objCon = New OdbcConnection(sconnection)
    objCon.Open()

    objAdapter.SelectCommand = cmdCommand
    objAdapter.SelectCommand.Connection = objCon
    objAdapter.SelectCommand.CommandType = CommandType.StoredProcedure

    objAdapter.SelectCommand.CommandTimeout = Globals.mReportTimeOut

    If Not mIsOracle Then
        objAdapter.SelectCommand.CommandText = String.Format("{{call {0}}}", spName)
    Else
        Dim returnValue As New OdbcParameter
        returnValue.Direction = ParameterDirection.Output
        returnValue.ParameterName = "@Vret_val"
        returnValue.OdbcType = OdbcType.Numeric
        objAdapter.SelectCommand.Parameters.Add(returnValue)

        objAdapter.SelectCommand.CommandText = String.Format("{{call {0}(?)}}", spName)
    End If

    Try

        objDataTable = New DataTable(spName)
        objAdapter.Fill(objDataTable)

    Catch ex As Exception
    ...

Question: I am puzzled as to what String.Format("{{call {0}(?)}}", spName) does, in particular the (?) part. My understanding of the String.Format is that it will simply replace {0} with spName. The {{, }}, and (?) do throw me off because { reminds me of formatting, (?) hints at some advanced regex use.

Unfortunately I am getting little help from a key person who is on vacation without a leash [smart]phone.

I am guessing that I simply add 5 more lines for each additional parameter, and change String.Format("{{call {0}(?)}}", spName) to String.Format("{{call {0}(?,?,?)}}", spName). I forgot to mention that I am coding this “blindly” – I have a compiler to help me, but no environment set up to test this.

This will be over in a few days, but I need to do my best to try finishing it on time 🙂

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:07:08+00:00Added an answer on May 14, 2026 at 3:07 am

    String.Format("{{call {0}(?)}}", spName) will produce a string like this: "{call ProcName(?)}" (assuming spName contains the string ProcName). {{ and ´}}are needed if you want the to include{or}` in the string without them being part of the formatting.

    This is mentioned in the documentation for string.Format:

    The leading and trailing brace
    characters, ‘{‘ and ‘}’, are required.
    To specify a single literal brace
    character in format, specify two
    leading or trailing brace characters;
    that is, “{{” or “}}”.

    The (?) means nothing special for the string.Format function, but will be used when executing the given procedure, each question mark representing a parameter that should be passed to the procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Hibernate for ORM of my Java app to an Oracle database (not
this is a different question concerning: add a connection to database not working, asp.net
I have a SQL Server 2000 database that will not display the column list
I have setup multiple SQL Service Broker Queues in a database but have not
How do I query the database name in Oracle SQL Developer? I have tried
I am using Oracle PL/SQL on Oracle Database 10g I use SYS.DBS_JOB to set
We have an Oracle database that contains IP addresses stored as decimal integers -
For smaller websites which are view-only or require light online-editing, SQL Server 2008, Oracle,
Hi I am developing a database in Oracle SQL dev, that is trying to
My database background is mainly Oracle, but I've recently been helping with some SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.