oracle中的动态变量创建: [英] Dynamic variable creation in oracle:

查看:88
本文介绍了oracle中的动态变量创建:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

oracle中的动态变量创建:



我不知道这是我想问的准确问题:



Bassicly我想在运行时创建变量:像这样:



 选择 * 来自  t 其中 t.name  in  这里我不知道值的数量,并且可以在运行时插入); 





我的完整问题是,我是给出decimel格式的多个值,首先我必须手动转换这些HAX格式的值然后连接其中的一些值,然后将它放入查询中,我想在oracle中自动完成整个过程,比如当我运行程序时它问我对于decimle中的值(未知值的数量),然后过程在HAX和一些中转换这些值这些值合并,然后将其插入查询中。

如何完成此任务。

解决方案

您需要创建存储过程 [ ^ ]并使用逗号分隔值传递字符串。然后你需要拆分逗号分隔值 [< a href =http://www.codeproject.com/Tips/584680/Using-comma-separated-value-parameter-strings-in-Starget =_ blanktitle =New Window> ^ ]能够将它们与数据库值进行比较。



这就是全部!试试!

Dynamic variable creation in oracle:

I dont know is it accurate question which i want to ask:

Bassicly i want to create variable at run time: like this:

select * from table t where t.name in ("here i dont know the number of values, and can be insert at run time");



my complete problem is, I was given multiple values in decimel format, first i have to convert these values in HAX format manually and then concate some of these values and then put it in query, I want to automate this whole process in oracle, say when i run procedure it ask me for values in decimle(number of values unknown) then procedure convert these values in HAX and some of these values concatinate and then insert it in query.
How can i accomplish this task.

解决方案

You need to create stored procedure[^] and pass string with comma separated values. Then you need to split comma separated values[^] to be able to compare them to database values.

That's all! Try!


这篇关于oracle中的动态变量创建:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆