sql - What characters are allowed in Oracle bind param placeholders? -
could please point me characters allowed bind variable name listed? i've spent several hours digging through oracle sql docs no avail.
i mean ":id" in following:
select * mytable id = :id
e.g. can dot used there ":some.id"? function version without dot?
these pages both state bind variables must "legal oracle identifiers" documentation found doesn't dot can part of legal identifer. able use dot in both table name , bind variable name, looks not recommended.
pages have bind variable naming conventions (these pages state bind variable must legal identifier):
http://www.utoug.org/i/doc/concept_bind_var.htm
http://docs.oracle.com/cd/e23903_01/doc/doc.41/e21674/concept_ses_val.htm#beiegccc
page describes legal identifiers: http://docs.oracle.com/cd/b19306_01/server.102/b14200/sql_elements008.htm
i not find on page says dot legal part of identifier (e.g. table or bind variable name) except in db link. though $ , # legal, not recommended, "." may work not recommended (not mentioned legal on page)
bind variable names must correspond item name. bind variable names not case-sensitive. bind variable names cannot longer 30 characters (that is, must valid oracle identifier).
i know valid oracle identifer (based on oracle's definition of legal identifier) cannot start number, , can have special characters $ , . if there special characters identifier must in double quotes.
i able identifier dot work in bind variable, had put double quotes around bind variable when bind variable had dot in it.
create or replace function f0416b return varchar2 v_stmt varchar2(1999); v_result varchar2(1999); begin v_stmt := 'insert test0411(field1, field2) values ( :"a.1" , :"a.2")'; execute immediate v_stmt using 'as201', 'as202'; return 'insert-ok'; commit; exception when others return sqlerrm; end;
this may work according above documentation period/dot
in bind variable or other object name not legal/recommended...
this sentence on oracle schema object naming page is
telling me this:
nonquoted identifiers can contain alphanumeric characters database character set , underscore (_), dollar sign ($), , pound sign (#). database links can contain periods (.) , "at" signs (@). oracle discourages using $ , # in nonquoted identifiers.
Comments
Post a Comment