首页 \ 问答 \ Oracle将一个表的值更新为另一个表字段的过程(Oracle procedure to update values of one table to another another table field)

Oracle将一个表的值更新为另一个表字段的过程(Oracle procedure to update values of one table to another another table field)

我有两个具有两个属性的表。我编写了一个过程,它应该从table1获取值并在表2中更新它。

MEDICINE 

BARCODE varchar2 13 byte
PDF_KUB_PATH  varchar2 1000 byte

PARSED_ILAC_REHBERI

BARCODE varchar2 13 byte
PDF_KUB_PATH  varchar2 1000 byte

这是我在PL / SQL中的程序,我无法找到我的错误,提前谢谢

CREATE OR REPLACE PROCEDURE Deneme
IS
    BARCODETEMP VARCHAR2(13 BYTE);
    S_KUB VARCHAR2 (1000 BYTE);

    CURSOR c1 IS
    SELECT a.PDF_KUB_PATH, a.BARCODE
    FROM medicine b,parsed_ilac_rehberi a
    WHERE a.BARCODE = b.barcode;
BEGIN

    OPEN c1;
    LOOP
    FETCH c1 INTO  S_KUB , BARCODETEMP,

    EXIT WHEN c1%NOTFOUND;

    UPDATE medicine
    SET PDF_KUB_PATH = S_KUB
    WHERE BARCODE = BARCODETEMP; 

    END LOOP;

    CLOSE c1;

    COMMIT;

EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,'An error was encountered - '
                                    ||SQLCODE||' -ERROR'||SQLERRM);
end;

I have two tables with two attributes.I have written a procedure which should take valuesfrom table1 and update it in Table 2.

MEDICINE 

BARCODE varchar2 13 byte
PDF_KUB_PATH  varchar2 1000 byte

PARSED_ILAC_REHBERI

BARCODE varchar2 13 byte
PDF_KUB_PATH  varchar2 1000 byte

This is my procedure in PL/SQL, i cant find where is my mistake, thanks in advance

CREATE OR REPLACE PROCEDURE Deneme
IS
    BARCODETEMP VARCHAR2(13 BYTE);
    S_KUB VARCHAR2 (1000 BYTE);

    CURSOR c1 IS
    SELECT a.PDF_KUB_PATH, a.BARCODE
    FROM medicine b,parsed_ilac_rehberi a
    WHERE a.BARCODE = b.barcode;
BEGIN

    OPEN c1;
    LOOP
    FETCH c1 INTO  S_KUB , BARCODETEMP,

    EXIT WHEN c1%NOTFOUND;

    UPDATE medicine
    SET PDF_KUB_PATH = S_KUB
    WHERE BARCODE = BARCODETEMP; 

    END LOOP;

    CLOSE c1;

    COMMIT;

EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,'An error was encountered - '
                                    ||SQLCODE||' -ERROR'||SQLERRM);
end;

原文:https://stackoverflow.com/questions/24044297
更新时间:2022-04-21 18:04

最满意答案

虽然我同意这不是真正的编程和可以说是offtopic,但关于(加密)密钥和证书的命令行工具(openssl,keytool,certutil等)的许多类似的Q显然被社区接受(upvoted) - 但我没见过直接解决了这一点。

openssl pkcs12 -export上的不同选项允许您提供不同文件中的部分,但这不是必需的。 如果在一个PEM文件中确实有私钥证书链,默认情况下由pkcs12 [not -export] ,则可以从该文件中读取所有内容

 openssl pkcs12 -export -in file -out p12
 # or ONLY IF the privatekey is first in the file
 openssl pkcs12 -export <file -out p12

只要先放私钥,你甚至可以“动态”组合各个部分:

 cat privkey.pem mycert.pem chain.pem | openssl pkcs12 -export -out p12

Although I concur this is not really programming and arguably offtopic, numerous similar Qs about commandline tools (openssl, keytool, certutil etc) for (crypto) keys and certs are apparently accepted by the community (upvoted) -- but none I've seen directly addresses this point.

The different options on openssl pkcs12 -export allow you to provide the pieces in different files, but that is not required. If you do have the privatekey and chain of certs in one PEM file, as output by default by pkcs12 [not -export], you can let everything be read from that one file:

 openssl pkcs12 -export -in file -out p12
 # or ONLY IF the privatekey is first in the file
 openssl pkcs12 -export <file -out p12

and you can even combine the pieces 'on the fly' as long as you put privatekey first:

 cat privkey.pem mycert.pem chain.pem | openssl pkcs12 -export -out p12

相关问答

更多
  • pfx文件不是证书,而是密钥库。 要将其转换为pem证书而不诉诸openssl,您可以执行以下操作: FileInputStream fis = new FileInputStream(""); java.security.KeyStore ks = java.security.KeyStore.getInstance("PKCS12"); ks.load(fis,"pfx_password".toCharArray()); Certificate cert = ks.g ...
  • 我相信使用Windows管理控制台中的证书管理器导入它然后导出它的简单方法。 the simple way I believe is to import it then export it, using the certificate manager in Windows Management Console.
  • 您可以使用OpenSSL命令行工具。 以下命令应该做到这一点 openssl pkcs12 -in client_ssl.pfx -out client_ssl.pem -clcerts openssl pkcs12 -in client_ssl.pfx -out root.pem -cacerts 如果您希望您的文件受到密码保护等,那么还有其他选项。 您可以在这里阅读整个文档。 You can use the OpenSSL Command line tool. The following comma ...
  • 使用OpenSSL,您可以使用下一个命令将pfx转换为Apache兼容格式: openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer openssl pkcs12 -in domain.pfx -nocerts -nodes -out domain.key 第一个命令将公钥提取到domain.cer 。 第二个命令将private key提取到domain.key 。 更新您的Apache配置文件:
  • 使用JDK 1.6或更高版本 Justin在下面的评论中已经指出,keytool单独可以使用以下命令(尽管只在JDK 1.6及更高版本中)执行此操作: keytool -importkeystore -srckeystore mypfxfile.pfx -srcstoretype pkcs12 -destkeystore clientcert.jks -deststoretype JKS 使用JDK 1.5或更低版本 OpenSSL可以做到这一切。 这个JGuru的答案是我迄今为止发现的最好的方法。 首 ...
  • openssl pkcs12 -inkey bob_key.pem -in bob_cert.cert -export -out bob_pfx.pfx openssl pkcs12 -inkey bob_key.pem -in bob_cert.cert -export -out bob_pfx.pfx
  • 您可以使用OpenSSL库进行此转换 http://www.openssl.org/ Windows二进制文件可以在这里找到: http://www.slproweb.com/products/Win32OpenSSL.html 一旦安装了库,您需要发出的命令是: openssl x509 -in mycert.crt -out mycert.pem -outform PEM You can do this conversion with the OpenSSL library http://www.op ...
  • req命令默认创建证书请求 ,而不是证书。 如果添加-x509参数,它将使用提供的密钥对请求进行自签名,并输出证书。 然后,您应该能够成功创建.pfx。 The req command creates a certificate request by default, not a certificate. If you add the -x509 argument, it will self-sign the request using the provided key, and output a cert ...
  • 虽然我同意这不是真正的编程和可以说是offtopic,但关于(加密)密钥和证书的命令行工具(openssl,keytool,certutil等)的许多类似的Q显然被社区接受(upvoted) - 但我没见过直接解决了这一点。 openssl pkcs12 -export上的不同选项允许您提供不同文件中的部分,但这不是必需的。 如果在一个PEM文件中确实有私钥和证书链,默认情况下由pkcs12 [not -export] ,则可以从该文件中读取所有内容 : openssl pkcs12 -export -i ...
  • 请尝试在命令行上提供--ssl-client-certificate-file选项,查看http://phantomjs.org/api/command-line.html以获取更多相关选项。 Please try supplying --ssl-client-certificate-file option on command line, look http://phantomjs.org/api/command-line.html for more related options.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)