Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: passing table name as parameter - CORRECTION

Re: passing table name as parameter - CORRECTION

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Thu, 05 Sep 2002 02:11:39 GMT
Message-ID: <v3zd9.361256$UU1.59355@sccrnsc03>

Where is the pl/sql stored procedure you are calling? That is probably where the error is.
I hope this is an occaisional thing and not some SQLServer like temp table thing. If it is I would recommend not doing this; instead do it without a temp table. (Oracle can have a type of temp table see Global temporary tables, if you really really need it.) If it is an occaisional thing (this kills scalability) then in your pl/sql function use execute immediate. Jim

"Patricia Paulson" <miapjp_at_chartermi.net> wrote in message news:unced142ivqa4a_at_corp.supernews.com...
> whoops, in sub it's
> Sub truncate_table(table_name as string)
>
> I forgot to put in the parameter after taking it out to check hard-coded
> results.
>
> Pat
>
> "Patricia Paulson" <miapjp_at_chartermi.net> wrote in message
> news:unce21sh25r1cd_at_corp.supernews.com...
> > Hi,
> >
> > I'm having problems using the truncate command when I'm passing in the
 table
> > name. Hard-coding works fine, so I'm thinking it's something to do with
 DDL
> > and the double quotes for a string var????? I've tried all sorts of
 things,
> > and searched the Web for hours. Any help would be greatly
 appreciated!!!
> >
> > Code:
> >
> > calling the sub:
> > truncate_table ("im_header") ' I tried inlcuding the schema name also,
 no
> > go.
> >
> > the sub:
> > Sub truncate_table()
> >
> > On Error GoTo err_hand
> >
> > Dim truncate_table As ADODB.Command
> > Dim table_name_parm As ADODB.Parameter
> >
> > Set truncate_table = New ADODB.Command
> >
> > With truncate_table
> > .ActiveConnection = rtkprd
> > .CommandType = adCmdText
> > .CommandText = "truncate table ?"
> > Set table_name_parm = .CreateParameter("table_name", adVarChar,
> > adParamInput, 50, table_name)
> > .Parameters.Append table_name_parm
> > .Execute
> > End With
> >
> > Exit Sub
> >
> > err_hand:
> >
> > Err.Raise Err.Number, , Err.Description & vbCrLf & "Error truncating
> > tables."
> >
> > Exit Sub
> >
> >
> > Thanks in advance!
> >
> > Pat
> >
> >
>
>
Received on Wed Sep 04 2002 - 21:11:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US